Commit 8ed4f00e authored by Kamil Trzciński's avatar Kamil Trzciński

Re-remove foreign keys on GitLab.com

Some migrations were skipped on GitLab.com
to avoid blocking deployments.

This tries to use regular deployments to not use
change management issues, and mark such migrations
as executed if they fail to acquire lock in time.

Changelog: added
parent b7eb0950
# 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