Sha256: 09459eefe50703f7880b1039a06e2412161e7a3e4ec09dfb605e30be2a17681f

Contents?: true

Size: 754 Bytes

Versions: 1

Compression:

Stored size: 754 Bytes

Contents

class CreateResourceImportFileTransitions < ActiveRecord::Migration[5.0]
  def change
    create_table :resource_import_file_transitions do |t|
      t.string :to_state
      if ActiveRecord::Base.configurations[Rails.env]["adapter"].try(:match, /mysql/)
        t.jsonb :metadata
      else
        t.jsonb :metadata, default: "{}"
      end
      t.integer :sort_key
      t.integer :resource_import_file_id
      t.timestamps
    end

    add_index :resource_import_file_transitions, :resource_import_file_id, name: "index_resource_import_file_transitions_on_file_id"
    add_index :resource_import_file_transitions, [:sort_key, :resource_import_file_id], unique: true, name: "index_resource_import_file_transitions_on_sort_key_and_file_id"
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
enju_seed-0.3.0.beta.4 spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb