Commit eb762fe4 authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 're-remove-foreign-keys-on-gitlab-com' into 'master'

Re-remove foreign keys on GitLab.com (LFK)

See merge request gitlab-org/gitlab!79418
parents 3d812cc1 8ed4f00e
# frozen_string_literal: true
class ReRemoveProjectsCiStagesProjectIdFk < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
def up
return unless foreign_key_exists?(:ci_stages, :projects, name: "fk_2360681d1d")
with_lock_retries do
execute('LOCK projects, ci_stages IN ACCESS EXCLUSIVE MODE') if transaction_open?
remove_foreign_key_if_exists(:ci_stages, :projects, name: "fk_2360681d1d")
end
end
def down
# no-op, since the FK will be added via rollback by prior-migration
end
end
# frozen_string_literal: true
class ReRemoveProjectsCiJobArtifactsProjectIdFk < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
def up
return unless foreign_key_exists?(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9")
with_lock_retries do
execute('LOCK projects, ci_job_artifacts IN ACCESS EXCLUSIVE MODE') if transaction_open?
remove_foreign_key_if_exists(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9")
end
end
def down
# no-op, since the FK will be added via rollback by prior-migration
end
end
# frozen_string_literal: true
class ReRemoveProjectsCiBuildsMetadataProjectIdFk < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
def up
return unless foreign_key_exists?(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02")
with_lock_retries do
execute('LOCK projects, ci_builds_metadata IN ACCESS EXCLUSIVE MODE') if transaction_open?
remove_foreign_key_if_exists(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02")
end
end
def down
# no-op, since the FK will be added via rollback by prior-migration
end
end
# frozen_string_literal: true
class ReRemoveProjectsCiBuildsProjectIdFk < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
def up
return unless foreign_key_exists?(:ci_builds, :projects, name: "fk_befce0568a")
with_lock_retries do
execute('LOCK projects, ci_builds IN ACCESS EXCLUSIVE MODE') if transaction_open?
remove_foreign_key_if_exists(:ci_builds, :projects, name: "fk_befce0568a")
end
end
def down
# no-op, since the FK will be added via rollback by prior-migration
end
end
b7b9f5e516664e7eb3f7a5307d1871bb4f58a31f4807e0298fbf9414bad567fa
\ No newline at end of file
0e8559121504f1a34394b5f613ef2c5554261f6aeaeaaf5a15d018803c4e5452
\ No newline at end of file
6c147287ba8436bd0231dc22195c95a71d19987d23741c1291a117407f493184
\ No newline at end of file
80a75bf72b40ee791bebd9ae97a793ce41fbd352841d83421525b6ad78e1c5e8
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment