debian-mirror-gitlab/db/migrate/20210420120734_initialize_conversion_of_ci_job_artifacts_to_bigint.rb
2021-06-08 01:23:25 +05:30

23 lines
579 B
Ruby

# frozen_string_literal: true
class InitializeConversionOfCiJobArtifactsToBigint < ActiveRecord::Migration[6.0]
include Gitlab::Database::MigrationHelpers
TABLE = :ci_job_artifacts
COLUMNS = %i(id job_id)
TARGET_COLUMNS = COLUMNS.map { |col| "#{col}_convert_to_bigint" }
def up
initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS)
end
def down
trigger_name = rename_trigger_name(TABLE, COLUMNS, TARGET_COLUMNS)
remove_rename_triggers TABLE, trigger_name
TARGET_COLUMNS.each do |column|
remove_column TABLE, column
end
end
end