2020-03-06 11:28:26 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class AddCiSourcesProjectPipelineForeignKey < ActiveRecord::Migration[6.0]
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
2020-03-12 12:09:17 +00:00
|
|
|
def up
|
2020-03-06 11:28:26 +00:00
|
|
|
with_lock_retries do
|
|
|
|
add_foreign_key :ci_sources_projects, :ci_pipelines, column: :pipeline_id, on_delete: :cascade # rubocop:disable Migration/AddConcurrentForeignKey
|
|
|
|
end
|
|
|
|
end
|
2020-03-12 12:09:17 +00:00
|
|
|
|
|
|
|
def down
|
|
|
|
with_lock_retries do
|
|
|
|
remove_foreign_key :ci_sources_projects, :ci_pipelines, column: :pipeline_id
|
|
|
|
end
|
|
|
|
end
|
2020-03-06 11:28:26 +00:00
|
|
|
end
|