Sha256: ef7132946aaed5d8efefe9ac824eb9bd59a334f559743f3dc677e04ef1f42700

Contents?: true

Size: 510 Bytes

Versions: 4

Compression:

Stored size: 510 Bytes

Contents

class CreateItemTransitions < ActiveRecord::Migration[4.2]
  def change
    create_table :item_transitions do |t|
      t.string :to_state
      if ActiveRecord::Base.configurations[Rails.env]["adapter"].try(:match, /mysql/)
        t.text :metadata
      else
        t.text :metadata, default: "{}"
      end
      t.integer :sort_key
      t.integer :item_id
      t.timestamps
    end

    add_index :item_transitions, :item_id
    add_index :item_transitions, %i[sort_key item_id], unique: true
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
enju_leaf-1.3.2 spec/dummy/db/migrate/20140529014410_create_item_transitions.rb
enju_leaf-1.3.1 spec/dummy/db/migrate/20140529014410_create_item_transitions.rb
enju_leaf-1.3.0 spec/dummy/db/migrate/20140529014410_create_item_transitions.rb
enju_leaf-1.3.0.rc.1 spec/dummy/db/migrate/20140529014410_create_item_transitions.rb