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
76955471
Commit
76955471
authored
Jun 17, 2020
by
Etienne Baqué
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added group_deploy_key_groups table
Added migration file and db structure updates.
parent
405fd65a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
changelogs/unreleased/215160-add-intermediate-group-deploy-key-table.yml
...leased/215160-add-intermediate-group-deploy-key-table.yml
+5
-0
db/migrate/20200522205606_create_group_deploy_keys_group.rb
db/migrate/20200522205606_create_group_deploy_keys_group.rb
+27
-0
db/structure.sql
db/structure.sql
+33
-0
No files found.
changelogs/unreleased/215160-add-intermediate-group-deploy-key-table.yml
0 → 100644
View file @
76955471
---
title
:
Create group_deploy_keys_groups intermediate table
merge_request
:
32901
author
:
type
:
added
db/migrate/20200522205606_create_group_deploy_keys_group.rb
0 → 100644
View file @
76955471
# frozen_string_literal: true
class
CreateGroupDeployKeysGroup
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
up
with_lock_retries
do
create_table
:group_deploy_keys_groups
do
|
t
|
t
.
timestamps_with_timezone
t
.
references
:group
,
index:
false
,
null:
false
,
foreign_key:
{
to_table: :namespaces
,
on_delete: :cascade
}
t
.
references
:group_deploy_key
,
null:
false
,
foreign_key:
{
on_delete: :cascade
}
t
.
index
[
:group_id
,
:group_deploy_key_id
],
unique:
true
,
name:
'index_group_deploy_keys_group_on_group_deploy_key_and_group_ids'
end
end
end
def
down
with_lock_retries
do
# rubocop:disable Migration/DropTable
drop_table
:group_deploy_keys_groups
# rubocop:enable Migration/DropTable
end
end
end
db/structure.sql
View file @
76955471
...
...
@@ -3204,6 +3204,23 @@ CREATE TABLE public.group_deploy_keys (
CONSTRAINT
check_f58fa0a0f7
CHECK
((
char_length
(
key
)
<=
4096
))
);
CREATE
TABLE
public
.
group_deploy_keys_groups
(
id
bigint
NOT
NULL
,
created_at
timestamp
with
time
zone
NOT
NULL
,
updated_at
timestamp
with
time
zone
NOT
NULL
,
group_id
bigint
NOT
NULL
,
group_deploy_key_id
bigint
NOT
NULL
);
CREATE
SEQUENCE
public
.
group_deploy_keys_groups_id_seq
START
WITH
1
INCREMENT
BY
1
NO
MINVALUE
NO
MAXVALUE
CACHE
1
;
ALTER
SEQUENCE
public
.
group_deploy_keys_groups_id_seq
OWNED
BY
public
.
group_deploy_keys_groups
.
id
;
CREATE
SEQUENCE
public
.
group_deploy_keys_id_seq
START
WITH
1
INCREMENT
BY
1
...
...
@@ -7731,6 +7748,8 @@ ALTER TABLE ONLY public.group_custom_attributes ALTER COLUMN id SET DEFAULT next
ALTER
TABLE
ONLY
public
.
group_deploy_keys
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'public.group_deploy_keys_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
public
.
group_deploy_keys_groups
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'public.group_deploy_keys_groups_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
public
.
group_deploy_tokens
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'public.group_deploy_tokens_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
public
.
group_group_links
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'public.group_group_links_id_seq'
::
regclass
);
...
...
@@ -8539,6 +8558,9 @@ ALTER TABLE ONLY public.group_custom_attributes
ALTER
TABLE
ONLY
public
.
group_deletion_schedules
ADD
CONSTRAINT
group_deletion_schedules_pkey
PRIMARY
KEY
(
group_id
);
ALTER
TABLE
ONLY
public
.
group_deploy_keys_groups
ADD
CONSTRAINT
group_deploy_keys_groups_pkey
PRIMARY
KEY
(
id
);
ALTER
TABLE
ONLY
public
.
group_deploy_keys
ADD
CONSTRAINT
group_deploy_keys_pkey
PRIMARY
KEY
(
id
);
...
...
@@ -9997,6 +10019,10 @@ CREATE INDEX index_group_deletion_schedules_on_marked_for_deletion_on ON public.
CREATE
INDEX
index_group_deletion_schedules_on_user_id
ON
public
.
group_deletion_schedules
USING
btree
(
user_id
);
CREATE
UNIQUE
INDEX
index_group_deploy_keys_group_on_group_deploy_key_and_group_ids
ON
public
.
group_deploy_keys_groups
USING
btree
(
group_id
,
group_deploy_key_id
);
CREATE
INDEX
index_group_deploy_keys_groups_on_group_deploy_key_id
ON
public
.
group_deploy_keys_groups
USING
btree
(
group_deploy_key_id
);
CREATE
UNIQUE
INDEX
index_group_deploy_keys_on_fingerprint
ON
public
.
group_deploy_keys
USING
btree
(
fingerprint
);
CREATE
INDEX
index_group_deploy_keys_on_fingerprint_sha256
ON
public
.
group_deploy_keys
USING
btree
(
fingerprint_sha256
);
...
...
@@ -12704,6 +12730,9 @@ ALTER TABLE ONLY public.project_repositories
ALTER
TABLE
ONLY
public
.
packages_nuget_dependency_link_metadata
ADD
CONSTRAINT
fk_rails_c3313ee2e4
FOREIGN
KEY
(
dependency_link_id
)
REFERENCES
public
.
packages_dependency_links
(
id
)
ON
DELETE
CASCADE
;
ALTER
TABLE
ONLY
public
.
group_deploy_keys_groups
ADD
CONSTRAINT
fk_rails_c3854f19f5
FOREIGN
KEY
(
group_deploy_key_id
)
REFERENCES
public
.
group_deploy_keys
(
id
)
ON
DELETE
CASCADE
;
ALTER
TABLE
ONLY
public
.
merge_request_user_mentions
ADD
CONSTRAINT
fk_rails_c440b9ea31
FOREIGN
KEY
(
note_id
)
REFERENCES
public
.
notes
(
id
)
ON
DELETE
CASCADE
;
...
...
@@ -12842,6 +12871,9 @@ ALTER TABLE ONLY public.merge_request_metrics
ALTER
TABLE
ONLY
public
.
draft_notes
ADD
CONSTRAINT
fk_rails_e753681674
FOREIGN
KEY
(
merge_request_id
)
REFERENCES
public
.
merge_requests
(
id
)
ON
DELETE
CASCADE
;
ALTER
TABLE
ONLY
public
.
group_deploy_keys_groups
ADD
CONSTRAINT
fk_rails_e87145115d
FOREIGN
KEY
(
group_id
)
REFERENCES
public
.
namespaces
(
id
)
ON
DELETE
CASCADE
;
ALTER
TABLE
ONLY
public
.
description_versions
ADD
CONSTRAINT
fk_rails_e8f4caf9c7
FOREIGN
KEY
(
epic_id
)
REFERENCES
public
.
epics
(
id
)
ON
DELETE
CASCADE
;
...
...
@@ -13945,6 +13977,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200521225327
20200521225337
20200521225346
20200522205606
20200522235146
20200525114553
20200525121014
...
...
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