Sha256: 813ca386d0d179ff15b75de19825f8dc95c19965bac146f217bc36f0d43484f3

Contents?: true

Size: 805 Bytes

Versions: 1

Compression:

Stored size: 805 Bytes

Contents

class CreateManifestationCheckoutStatTransitions < ActiveRecord::Migration[5.1]
  def change
    create_table :manifestation_checkout_stat_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 :manifestation_checkout_stat_id
      t.timestamps
    end

    add_index :manifestation_checkout_stat_transitions, :manifestation_checkout_stat_id, name: 'index_manifestation_checkout_stat_transitions_on_stat_id'
    add_index :manifestation_checkout_stat_transitions, [:sort_key, :manifestation_checkout_stat_id], unique: true, name: 'index_manifestation_checkout_stat_transitions_on_transition'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enju_seed-0.4.0.beta.1 spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb