debian-mirror-gitlab/db/migrate/20230330101440_remove_old_fk_ml_candidate_params_on_candidate_id.rb
2023-06-20 00:43:36 +05:30

22 lines
503 B
Ruby

# frozen_string_literal: true
class RemoveOldFkMlCandidateParamsOnCandidateId < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
OLD_CONSTRAINT_NAME = 'fk_rails_d4a51d1185'
def up
remove_foreign_key_if_exists(:ml_candidate_params, column: :candidate_id, name: OLD_CONSTRAINT_NAME)
end
def down
add_concurrent_foreign_key(
:ml_candidate_params,
:ml_candidates,
column: :candidate_id,
validate: false,
name: OLD_CONSTRAINT_NAME
)
end
end