Skip to content
Snippets Groups Projects
Unverified Commit 73307629 authored by Marius Bobin's avatar Marius Bobin
Browse files

Merge branch '422822-foreign-key' into 'master'

Add foreign key for ci_pipeline_chat_data.pipeline_id_convert_to_bigint

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/130893



Merged-by: default avatarMarius Bobin <mbobin@gitlab.com>
Approved-by: default avatarMarius Bobin <mbobin@gitlab.com>
Approved-by: default avatarJoão Pereira <jpereira@gitlab.com>
Reviewed-by: default avatarTianwen Chen <tchen@gitlab.com>
Co-authored-by: default avatarTianwen Chen <tchen@gitlab.com>
parents d03c8d7f 17229ead
No related branches found
No related tags found
No related merge requests found
# frozen_string_literal: true
class AddForeignKeyForCiPipelineChatDataForPipelineIdBigint < Gitlab::Database::Migration[2.1]
TABLE_NAME = :ci_pipeline_chat_data
REFERENCING_TABLE_NAME = :ci_pipelines
COLUMN_NAME = :pipeline_id_convert_to_bigint
disable_ddl_transaction!
def up
add_concurrent_foreign_key(
TABLE_NAME, REFERENCING_TABLE_NAME,
column: COLUMN_NAME, on_delete: :cascade, reverse_lock_order: true
)
end
def down
remove_foreign_key_if_exists TABLE_NAME, column: COLUMN_NAME
end
end
f9bebf09d3265a506ab0f783cfd2a77415b05be27684c30998bd702a67ffc6b1
\ No newline at end of file
Loading
Loading
@@ -36390,6 +36390,9 @@ ALTER TABLE ONLY approval_merge_request_rules
ALTER TABLE ONLY deploy_keys_projects
ADD CONSTRAINT fk_58a901ca7e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
 
ALTER TABLE ONLY ci_pipeline_chat_data
ADD CONSTRAINT fk_5b21bde562 FOREIGN KEY (pipeline_id_convert_to_bigint) REFERENCES ci_pipelines(id) ON DELETE CASCADE;
ALTER TABLE ONLY dependency_list_exports
ADD CONSTRAINT fk_5b3d11e1ef FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL;
 
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment