Sha256: 686323777be43680a6cdc08e1aac8b160ea5e33087220d4dcb73bf2a78d76761

Contents?: true

Size: 1.75 KB

Versions: 6

Compression:

Stored size: 1.75 KB

Contents

class AlterKeyAndIndexToBigint < ActiveRecord::Migration[5.0]
  def up
    change_column :job_definitions, :id, :bigint, auto_increment: true
    change_column :admin_assignments, :job_definition_id, :bigint
    change_column :execution_histories, :job_definition_id, :bigint
    change_column :executions, :job_definition_id, :bigint
    change_column :job_definition_tags, :job_definition_id, :bigint
    change_column :job_instances, :job_definition_id, :bigint
    change_column :job_schedules, :job_definition_id, :bigint
    change_column :job_suspend_schedules, :job_definition_id, :bigint
    change_column :memory_expectancies, :job_definition_id, :bigint
    change_column :stars, :job_definition_id, :bigint
    change_column :tokens, :job_definition_id, :bigint

    change_column :users, :id, :bigint, auto_increment: true
    change_column :admin_assignments, :user_id, :bigint
    change_column :stars, :user_id, :bigint
  end

  def down
    change_column :job_definitions, :id, :int, auto_increment: true
    change_column :admin_assignments, :job_definition_id, :int
    change_column :execution_histories, :job_definition_id, :int
    change_column :executions, :job_definition_id, :int
    change_column :job_definition_tags, :job_definition_id, :int
    change_column :job_instances, :job_definition_id, :int
    change_column :job_schedules, :job_definition_id, :int
    change_column :job_suspend_schedules, :job_definition_id, :int
    change_column :memory_expectancies, :job_definition_id, :int
    change_column :stars, :job_definition_id, :int
    change_column :tokens, :job_definition_id, :int

    change_column :users, :id, :int, auto_increment: true
    change_column :admin_assignments, :user_id, :int
    change_column :stars, :user_id, :int
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kuroko2-0.8.0 db/migrate/033_alter_key_and_index_to_bigint.rb
kuroko2-0.7.0 db/migrate/033_alter_key_and_index_to_bigint.rb
kuroko2-0.6.0 db/migrate/033_alter_key_and_index_to_bigint.rb
kuroko2-0.5.2 db/migrate/033_alter_key_and_index_to_bigint.rb
kuroko2-0.5.1 db/migrate/033_alter_key_and_index_to_bigint.rb
kuroko2-0.5.0 db/migrate/033_alter_key_and_index_to_bigint.rb