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
8e85a96a
Commit
8e85a96a
authored
Apr 27, 2020
by
Jason Goodman
Committed by
Toon Claes
Apr 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create operations_strategies_user_lists table
For applying user lists to a feature flag strategy
parent
e2bd19b6
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
0 deletions
+50
-0
changelogs/unreleased/add-ops-strategies-user-lists-table.yml
...gelogs/unreleased/add-ops-strategies-user-lists-table.yml
+5
-0
db/migrate/20200422213749_create_operations_strategies_user_lists.rb
...20200422213749_create_operations_strategies_user_lists.rb
+14
-0
db/structure.sql
db/structure.sql
+31
-0
No files found.
changelogs/unreleased/add-ops-strategies-user-lists-table.yml
0 → 100644
View file @
8e85a96a
---
title
:
Create operations_strategies_user_lists table
merge_request
:
30243
author
:
type
:
added
db/migrate/20200422213749_create_operations_strategies_user_lists.rb
0 → 100644
View file @
8e85a96a
# frozen_string_literal: true
class
CreateOperationsStrategiesUserLists
<
ActiveRecord
::
Migration
[
6.0
]
DOWNTIME
=
false
def
change
create_table
:operations_strategies_user_lists
do
|
t
|
t
.
references
:strategy
,
index:
false
,
foreign_key:
{
on_delete: :cascade
,
to_table: :operations_strategies
},
null:
false
t
.
references
:user_list
,
index:
true
,
foreign_key:
{
on_delete: :cascade
,
to_table: :operations_user_lists
},
null:
false
t
.
index
[
:strategy_id
,
:user_list_id
],
unique:
true
,
name: :index_ops_strategies_user_lists_on_strategy_id_and_user_list_id
end
end
end
db/structure.sql
View file @
8e85a96a
...
...
@@ -4393,6 +4393,21 @@ CREATE SEQUENCE public.operations_strategies_id_seq
ALTER
SEQUENCE
public
.
operations_strategies_id_seq
OWNED
BY
public
.
operations_strategies
.
id
;
CREATE
TABLE
public
.
operations_strategies_user_lists
(
id
bigint
NOT
NULL
,
strategy_id
bigint
NOT
NULL
,
user_list_id
bigint
NOT
NULL
);
CREATE
SEQUENCE
public
.
operations_strategies_user_lists_id_seq
START
WITH
1
INCREMENT
BY
1
NO
MINVALUE
NO
MAXVALUE
CACHE
1
;
ALTER
SEQUENCE
public
.
operations_strategies_user_lists_id_seq
OWNED
BY
public
.
operations_strategies_user_lists
.
id
;
CREATE
TABLE
public
.
operations_user_lists
(
id
bigint
NOT
NULL
,
project_id
bigint
NOT
NULL
,
...
...
@@ -7464,6 +7479,8 @@ ALTER TABLE ONLY public.operations_scopes ALTER COLUMN id SET DEFAULT nextval('p
ALTER
TABLE
ONLY
public
.
operations_strategies
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'public.operations_strategies_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
public
.
operations_strategies_user_lists
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'public.operations_strategies_user_lists_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
public
.
operations_user_lists
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'public.operations_user_lists_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
public
.
packages_build_infos
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'public.packages_build_infos_id_seq'
::
regclass
);
...
...
@@ -8286,6 +8303,9 @@ ALTER TABLE ONLY public.operations_scopes
ALTER
TABLE
ONLY
public
.
operations_strategies
ADD
CONSTRAINT
operations_strategies_pkey
PRIMARY
KEY
(
id
);
ALTER
TABLE
ONLY
public
.
operations_strategies_user_lists
ADD
CONSTRAINT
operations_strategies_user_lists_pkey
PRIMARY
KEY
(
id
);
ALTER
TABLE
ONLY
public
.
operations_user_lists
ADD
CONSTRAINT
operations_user_lists_pkey
PRIMARY
KEY
(
id
);
...
...
@@ -9887,10 +9907,14 @@ CREATE UNIQUE INDEX index_operations_scopes_on_strategy_id_and_environment_scope
CREATE
INDEX
index_operations_strategies_on_feature_flag_id
ON
public
.
operations_strategies
USING
btree
(
feature_flag_id
);
CREATE
INDEX
index_operations_strategies_user_lists_on_user_list_id
ON
public
.
operations_strategies_user_lists
USING
btree
(
user_list_id
);
CREATE
UNIQUE
INDEX
index_operations_user_lists_on_project_id_and_iid
ON
public
.
operations_user_lists
USING
btree
(
project_id
,
iid
);
CREATE
UNIQUE
INDEX
index_operations_user_lists_on_project_id_and_name
ON
public
.
operations_user_lists
USING
btree
(
project_id
,
name
);
CREATE
UNIQUE
INDEX
index_ops_strategies_user_lists_on_strategy_id_and_user_list_id
ON
public
.
operations_strategies_user_lists
USING
btree
(
strategy_id
,
user_list_id
);
CREATE
UNIQUE
INDEX
index_packages_build_infos_on_package_id
ON
public
.
packages_build_infos
USING
btree
(
package_id
);
CREATE
INDEX
index_packages_build_infos_on_pipeline_id
ON
public
.
packages_build_infos
USING
btree
(
pipeline_id
);
...
...
@@ -11533,6 +11557,9 @@ ALTER TABLE ONLY public.ci_resources
ALTER
TABLE
ONLY
public
.
clusters_applications_fluentd
ADD
CONSTRAINT
fk_rails_4319b1dcd2
FOREIGN
KEY
(
cluster_id
)
REFERENCES
public
.
clusters
(
id
)
ON
DELETE
CASCADE
;
ALTER
TABLE
ONLY
public
.
operations_strategies_user_lists
ADD
CONSTRAINT
fk_rails_43241e8d29
FOREIGN
KEY
(
strategy_id
)
REFERENCES
public
.
operations_strategies
(
id
)
ON
DELETE
CASCADE
;
ALTER
TABLE
ONLY
public
.
lfs_file_locks
ADD
CONSTRAINT
fk_rails_43df7a0412
FOREIGN
KEY
(
project_id
)
REFERENCES
public
.
projects
(
id
)
ON
DELETE
CASCADE
;
...
...
@@ -12106,6 +12133,9 @@ ALTER TABLE ONLY public.ci_daily_report_results
ALTER
TABLE
ONLY
public
.
issues_self_managed_prometheus_alert_events
ADD
CONSTRAINT
fk_rails_cc5d88bbb0
FOREIGN
KEY
(
issue_id
)
REFERENCES
public
.
issues
(
id
)
ON
DELETE
CASCADE
;
ALTER
TABLE
ONLY
public
.
operations_strategies_user_lists
ADD
CONSTRAINT
fk_rails_ccb7e4bc0b
FOREIGN
KEY
(
user_list_id
)
REFERENCES
public
.
operations_user_lists
(
id
)
ON
DELETE
CASCADE
;
ALTER
TABLE
ONLY
public
.
issue_tracker_data
ADD
CONSTRAINT
fk_rails_ccc0840427
FOREIGN
KEY
(
service_id
)
REFERENCES
public
.
services
(
id
)
ON
DELETE
CASCADE
;
...
...
@@ -13425,6 +13455,7 @@ COPY "schema_migrations" (version) FROM STDIN;
20200420172752
20200420172927
20200421233150
20200422213749
20200423075720
20200423080334
20200423080607
...
...
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