Sha256: f3d2a6fa918454d6467fbc42bbbbe8d57938cf1f12fec8b2a6f1be9cbb9cfc75

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

class CreateUnidomGovernmentAgencies < ActiveRecord::Migration

  def change

    create_table :unidom_government_agencies, id: :uuid do |t|

      t.references :supervision_region, type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }

      t.string :name, null: false, default: '', limit: 200

      t.column :function_code, 'char(4)', null: false, default: 'ZZZZ'

      t.text :description

      t.string   :slug,             null: false, default: nil, limit: 200
      t.column   :state, 'char(1)', null: false, default: Unidom::Common::STATE
      t.datetime :opened_at,        null: false, default: Unidom::Common::OPENED_AT
      t.datetime :closed_at,        null: false, default: Unidom::Common::CLOSED_AT
      t.boolean  :defunct,          null: false, default: false
      t.jsonb    :notation,         null: false, default: {}

      t.timestamps null: false

    end

    add_index :unidom_government_agencies, :supervision_region_id
    add_index :unidom_government_agencies, :slug, unique: true

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unidom-party-2.0 db/migrate/20010104000000_create_unidom_government_agencies.rb