Sha256: c9d080cc1725220beda57736a357365ad5ab159bd6c35beead1c55103e979ec4

Contents?: true

Size: 652 Bytes

Versions: 3

Compression:

Stored size: 652 Bytes

Contents

class CreateMessageRequestTransitions < ActiveRecord::Migration
  def change
    create_table :message_request_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 :message_request_id
      t.timestamps
    end

    add_index :message_request_transitions, :message_request_id
    add_index :message_request_transitions, [:sort_key, :message_request_id], unique: true, name: 'index_message_request_transitions_on_sort_key_and_request_id'
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
enju_seed-0.3.0.beta.3 spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb
enju_seed-0.3.0.beta.2 spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb
enju_seed-0.3.0.beta.1 spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb