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

16 lines
377 B
Ruby

# frozen_string_literal: true
class AddProjectIdForeignKeyToMlCandidates < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
def up
add_concurrent_foreign_key :ml_candidates, :projects, column: :project_id, on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key_if_exists :ml_candidates, column: :project_id
end
end
end