Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6518666b
Commit
6518666b
authored
May 04, 2021
by
Aishwarya Subramanian
Committed by
Adam Hegyi
May 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorder source_project_id foreign key constraint
parent
2c4abf28
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
3 deletions
+33
-3
changelogs/unreleased/fix-project-deletion-timeout.yml
changelogs/unreleased/fix-project-deletion-timeout.yml
+5
-0
db/migrate/20210423171304_re_order_fk_source_project_id_in_merge_requests.rb
...171304_re_order_fk_source_project_id_in_merge_requests.rb
+24
-0
db/schema_migrations/20210423171304
db/schema_migrations/20210423171304
+1
-0
db/structure.sql
db/structure.sql
+3
-3
No files found.
changelogs/unreleased/fix-project-deletion-timeout.yml
0 → 100644
View file @
6518666b
---
title
:
Reorder source_project_id foreign key constraint in merge_requests table
merge_request
:
60313
author
:
type
:
changed
db/migrate/20210423171304_re_order_fk_source_project_id_in_merge_requests.rb
0 → 100644
View file @
6518666b
# frozen_string_literal: true
class
ReOrderFkSourceProjectIdInMergeRequests
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
OLD_SOURCE_PROJECT_FK
=
'fk_3308fe130c'
NEW_SOURCE_PROJECT_FK
=
'fk_source_project'
def
up
add_concurrent_foreign_key
:merge_requests
,
:projects
,
column: :source_project_id
,
on_delete: :nullify
,
name:
NEW_SOURCE_PROJECT_FK
remove_foreign_key_if_exists
:merge_requests
,
column: :source_project_id
,
name:
OLD_SOURCE_PROJECT_FK
end
def
down
add_concurrent_foreign_key
:merge_requests
,
:projects
,
column: :source_project_id
,
on_delete: :nullify
remove_foreign_key_if_exists
:merge_requests
,
column: :source_project_id
,
name:
NEW_SOURCE_PROJECT_FK
end
end
db/schema_migrations/20210423171304
0 → 100644
View file @
6518666b
06ead319cbc56b25769ed06b6a246d705b467d34a5d09ab9282e2d83c55511ba
\ No newline at end of file
db/structure.sql
View file @
6518666b
...
@@ -25068,9 +25068,6 @@ ALTER TABLE ONLY approvals
...
@@ -25068,9 +25068,6 @@ ALTER TABLE ONLY approvals
ALTER TABLE ONLY namespaces
ALTER TABLE ONLY namespaces
ADD CONSTRAINT fk_319256d87a FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL;
ADD CONSTRAINT fk_319256d87a FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL;
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_3308fe130c FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL;
ALTER TABLE ONLY ci_group_variables
ALTER TABLE ONLY ci_group_variables
ADD CONSTRAINT fk_33ae4d58d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
ADD CONSTRAINT fk_33ae4d58d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
...
@@ -27159,6 +27156,9 @@ ALTER TABLE ONLY ci_builds_metadata
...
@@ -27159,6 +27156,9 @@ ALTER TABLE ONLY ci_builds_metadata
ALTER TABLE ONLY services
ALTER TABLE ONLY services
ADD CONSTRAINT fk_services_inherit_from_id FOREIGN KEY (inherit_from_id) REFERENCES services(id) ON DELETE CASCADE;
ADD CONSTRAINT fk_services_inherit_from_id FOREIGN KEY (inherit_from_id) REFERENCES services(id) ON DELETE CASCADE;
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_source_project FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL;
ALTER TABLE ONLY timelogs
ALTER TABLE ONLY timelogs
ADD CONSTRAINT fk_timelogs_issues_issue_id FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
ADD CONSTRAINT fk_timelogs_issues_issue_id FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment