Sha256: f832365d1e4728d502df078612e83e51386372f63eb03da549867877c3f5c4ad

Contents?: true

Size: 1.28 KB

Versions: 2

Compression:

Stored size: 1.28 KB

Contents

class CreateUnidomActings < ActiveRecord::Migration

  def change

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

      t.references :actor_visitor, type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }
      t.references :actor_party,   type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }
      t.references :acted,         type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }
      t.references :reason,        type: :uuid, null: true

      t.column :action_code, 'char(1)', null: false, default: 'C'

      t.jsonb :from_value, null: false, default: {}
      t.jsonb :thru_value, null: false, default: {}

      t.column   :state, 'char(1)', null: false, default: 'C'
      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_actings, :actor_visitor_id
    add_index :unidom_actings, :actor_party_id
    add_index :unidom_actings, :acted_id
    add_index :unidom_actings, :reason_id

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unidom-action-2.0 db/migrate/20000510000000_create_unidom_actings.rb
unidom-action-1.17.18 db/migrate/20000510000000_create_unidom_actings.rb