Sha256: 9da5b6998340f1d74398881eccaa15c27203f3411deb1daa9644e30d009a1cf7

Contents?: true

Size: 1.26 KB

Versions: 45

Compression:

Stored size: 1.26 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: Time.utc(1970)
      t.datetime :closed_at,        null: false, default: Time.utc(3000)
      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

45 entries across 45 versions & 1 rubygems

Version Path
unidom-action-0.7 db/migrate/20000510000000_create_unidom_actings.rb
unidom-action-0.6 db/migrate/20000510000000_create_unidom_actings.rb
unidom-action-0.5 db/migrate/20000510000000_create_unidom_actings.rb
unidom-action-0.4 db/migrate/20000510000000_create_unidom_actings.rb
unidom-action-0.3 db/migrate/20000510000000_create_unidom_actings.rb