Sha256: 5f5deb043c5b82bb4c920d6323b2d234b7c0abbff30820ee5843c280678f9051

Contents?: true

Size: 1.32 KB

Versions: 2

Compression:

Stored size: 1.32 KB

Contents

class CreateUnidomStateTransitions < ActiveRecord::Migration

  def change

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

      t.references :transitor_visitor, type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }
      t.references :transitor_party,   type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }
      t.references :subject,           type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }
      t.references :reason,            type: :uuid, null: true

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

      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_state_transitions, :transitor_visitor_id
    add_index :unidom_state_transitions, :transitor_party_id
    add_index :unidom_state_transitions, :subject_id
    add_index :unidom_state_transitions, :reason_id

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unidom-action-2.0 db/migrate/20000511000000_create_unidom_state_transitions.rb
unidom-action-1.17.18 db/migrate/20000511000000_create_unidom_state_transitions.rb