Commit 76706f64 authored by Adam Hegyi's avatar Adam Hegyi

Merge branch 'remove-ci_pipelines_dast_site_profiles_pipelines_ci_pipeline_id-fk' into 'master'

Swap FK dast_site_profiles_pipelines.ci_pipeline_id to ci_pipelines for LFK

See merge request gitlab-org/gitlab!79103
parents 4f9714c1 7efa6cb1
# frozen_string_literal: true
class RemoveCiPipelinesDastSiteProfilesPipelinesCiPipelineIdFk < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
def up
return unless foreign_key_exists?(:dast_site_profiles_pipelines, :ci_pipelines, name: "fk_53849b0ad5")
with_lock_retries do
execute('LOCK ci_pipelines, dast_site_profiles_pipelines IN ACCESS EXCLUSIVE MODE') if transaction_open?
remove_foreign_key_if_exists(:dast_site_profiles_pipelines, :ci_pipelines, name: "fk_53849b0ad5")
end
end
def down
add_concurrent_foreign_key(:dast_site_profiles_pipelines, :ci_pipelines, name: "fk_53849b0ad5", column: :ci_pipeline_id, target_column: :id, on_delete: :cascade)
end
end
2c3f7c587b2a20de1d8581584f7392fd81643af4eb7e25ffc8e08514b6ad83ab
\ No newline at end of file
...@@ -29390,9 +29390,6 @@ ALTER TABLE ONLY alert_management_alerts ...@@ -29390,9 +29390,6 @@ ALTER TABLE ONLY alert_management_alerts
ALTER TABLE ONLY path_locks ALTER TABLE ONLY path_locks
ADD CONSTRAINT fk_5265c98f24 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ADD CONSTRAINT fk_5265c98f24 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
ALTER TABLE ONLY dast_site_profiles_pipelines
ADD CONSTRAINT fk_53849b0ad5 FOREIGN KEY (ci_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
ALTER TABLE ONLY clusters_applications_prometheus ALTER TABLE ONLY clusters_applications_prometheus
ADD CONSTRAINT fk_557e773639 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; ADD CONSTRAINT fk_557e773639 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE;
...@@ -32,7 +32,6 @@ RSpec.describe 'cross-database foreign keys' do ...@@ -32,7 +32,6 @@ RSpec.describe 'cross-database foreign keys' do
ci_sources_projects.source_project_id ci_sources_projects.source_project_id
ci_stages.project_id ci_stages.project_id
ci_unit_tests.project_id ci_unit_tests.project_id
dast_site_profiles_pipelines.ci_pipeline_id
vulnerability_feedback.pipeline_id vulnerability_feedback.pipeline_id
).freeze ).freeze
end end
......
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