Sha256: 01200ec306e6b00264e7f7673e01c2156f7409aad697e03bb6e4317bdf70a350

Contents?: true

Size: 724 Bytes

Versions: 2

Compression:

Stored size: 724 Bytes

Contents

class CreateUserExportFileTransitions < ActiveRecord::Migration
  def change
    create_table :user_export_file_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.references :user_export_file, index: true
      t.timestamps
    end

    add_index :user_export_file_transitions, :user_export_file_id, name: 'index_user_export_file_transitions_on_file_id'
    add_index :user_export_file_transitions, [:sort_key, :user_export_file_id], unique: true, name: 'index_user_export_file_transitions_on_sort_key_and_file_id'
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
enju_seed-0.3.0.beta.2 spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb
enju_seed-0.3.0.beta.1 spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb