Commit 118f4060 authored by Yorick Peterse's avatar Yorick Peterse Committed by Adam Hegyi

Use loose foreign keys for pages_deployments

parent 1024b284
# frozen_string_literal: true
class DropPagesDeploymentsBuildsFk < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
FK_NAME = 'fk_rails_c3a90cf29b'
def up
remove_foreign_key_if_exists(:pages_deployments, :ci_builds, name: FK_NAME)
end
def down
add_concurrent_foreign_key(
:pages_deployments,
:ci_builds,
name: FK_NAME,
column: :ci_build_id,
target_column: :id,
on_delete: :nullify
)
end
end
2630b21c7134ac539a18798f2f2b99f468e171b79e30a184f7e8cdaccd11d465
\ No newline at end of file
...@@ -31056,9 +31056,6 @@ ALTER TABLE ONLY packages_nuget_dependency_link_metadata ...@@ -31056,9 +31056,6 @@ ALTER TABLE ONLY packages_nuget_dependency_link_metadata
ALTER TABLE ONLY group_deploy_keys_groups ALTER TABLE ONLY group_deploy_keys_groups
ADD CONSTRAINT fk_rails_c3854f19f5 FOREIGN KEY (group_deploy_key_id) REFERENCES group_deploy_keys(id) ON DELETE CASCADE; ADD CONSTRAINT fk_rails_c3854f19f5 FOREIGN KEY (group_deploy_key_id) REFERENCES group_deploy_keys(id) ON DELETE CASCADE;
ALTER TABLE ONLY pages_deployments
ADD CONSTRAINT fk_rails_c3a90cf29b FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE SET NULL;
ALTER TABLE ONLY merge_request_user_mentions ALTER TABLE ONLY merge_request_user_mentions
ADD CONSTRAINT fk_rails_c440b9ea31 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; ADD CONSTRAINT fk_rails_c440b9ea31 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE;
...@@ -37,3 +37,7 @@ packages_package_file_build_infos: ...@@ -37,3 +37,7 @@ packages_package_file_build_infos:
- table: ci_pipelines - table: ci_pipelines
column: pipeline_id column: pipeline_id
on_delete: async_nullify on_delete: async_nullify
pages_deployments:
- table: ci_builds
column: ci_build_id
on_delete: async_nullify
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