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
118f4060
Commit
118f4060
authored
Dec 07, 2021
by
Yorick Peterse
Committed by
Adam Hegyi
Dec 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use loose foreign keys for pages_deployments
parent
1024b284
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
3 deletions
+27
-3
db/post_migrate/20211118130836_drop_pages_deployments_builds_fk.rb
...igrate/20211118130836_drop_pages_deployments_builds_fk.rb
+22
-0
db/schema_migrations/20211118130836
db/schema_migrations/20211118130836
+1
-0
db/structure.sql
db/structure.sql
+0
-3
lib/gitlab/database/gitlab_loose_foreign_keys.yml
lib/gitlab/database/gitlab_loose_foreign_keys.yml
+4
-0
No files found.
db/post_migrate/20211118130836_drop_pages_deployments_builds_fk.rb
0 → 100644
View file @
118f4060
# 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
db/schema_migrations/20211118130836
0 → 100644
View file @
118f4060
2630b21c7134ac539a18798f2f2b99f468e171b79e30a184f7e8cdaccd11d465
\ No newline at end of file
db/structure.sql
View file @
118f4060
...
@@ -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;
lib/gitlab/database/gitlab_loose_foreign_keys.yml
View file @
118f4060
...
@@ -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
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