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
3a12e4cd
Commit
3a12e4cd
authored
Jan 13, 2022
by
Thong Kuah
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes FK for ci_job_token_project_scope_links to users
Changelog: changed
parent
b5fb1331
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
3 deletions
+22
-3
db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb
..._users_ci_job_token_project_scope_links_added_by_id_fk.rb
+15
-0
db/schema_migrations/20220113035519
db/schema_migrations/20220113035519
+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
+1
-0
spec/models/ci/job_token/project_scope_link_spec.rb
spec/models/ci/job_token/project_scope_link_spec.rb
+5
-0
No files found.
db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb
0 → 100644
View file @
3a12e4cd
# frozen_string_literal: true
class
RemoveUsersCiJobTokenProjectScopeLinksAddedByIdFk
<
Gitlab
::
Database
::
Migration
[
1.0
]
disable_ddl_transaction!
def
up
with_lock_retries
do
remove_foreign_key_if_exists
(
:ci_job_token_project_scope_links
,
:users
,
name:
"fk_rails_35f7f506ce"
)
end
end
def
down
add_concurrent_foreign_key
(
:ci_job_token_project_scope_links
,
:users
,
name:
"fk_rails_35f7f506ce"
,
column: :added_by_id
,
target_column: :id
,
on_delete: :nullify
)
end
end
db/schema_migrations/20220113035519
0 → 100644
View file @
3a12e4cd
4a90811aace678528b75171868fb178ab885d5aac885048e8eacecaf8b0ee374
\ No newline at end of file
db/structure.sql
View file @
3a12e4cd
...
...
@@ -30251,9 +30251,6 @@ ALTER TABLE ONLY metrics_dashboard_annotations
ALTER TABLE ONLY wiki_page_slugs
ADD CONSTRAINT fk_rails_358b46be14 FOREIGN KEY (wiki_page_meta_id) REFERENCES wiki_page_meta(id) ON DELETE CASCADE;
ALTER TABLE ONLY ci_job_token_project_scope_links
ADD CONSTRAINT fk_rails_35f7f506ce FOREIGN KEY (added_by_id) REFERENCES users(id) ON DELETE SET NULL;
ALTER TABLE ONLY board_labels
ADD CONSTRAINT fk_rails_362b0600a3 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE;
lib/gitlab/database/gitlab_loose_foreign_keys.yml
View file @
3a12e4cd
---
dast_site_profiles_pipelines
:
-
table
:
ci_pipelines
column
:
ci_pipeline_id
...
...
spec/models/ci/job_token/project_scope_link_spec.rb
View file @
3a12e4cd
...
...
@@ -9,6 +9,11 @@ RSpec.describe Ci::JobToken::ProjectScopeLink do
let_it_be
(
:project
)
{
create
(
:project
)
}
it_behaves_like
'cleanup by a loose foreign key'
do
let!
(
:parent
)
{
create
(
:user
)
}
let!
(
:model
)
{
create
(
:ci_job_token_project_scope_link
,
added_by:
parent
)
}
end
describe
'unique index'
do
let!
(
:link
)
{
create
(
:ci_job_token_project_scope_link
)
}
...
...
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