Create Ops Strategies User Lists Table
What does this MR do?
Create operations_strategies_user_lists
table.
This is for associating a feature flag strategy with a user list so that a feature flag can be enabled for a reusable list of users. See the issue for more details about the feature.
Issue: #35930 (closed)
Migration Output
$ bin/rails db:migrate
== 20200422213749 CreateOperationsStrategiesUserLists: migrating ==============
-- create_table(:operations_strategies_user_lists)
-> 0.0088s
== 20200422213749 CreateOperationsStrategiesUserLists: migrated (0.0089s) =====
$ bin/rails dbconsole
psql (10.12)
Type "help" for help.
gitlabhq_development=# \d operations_strategies_user_lists
Table "public.operations_strategies_user_lists"
Column | Type | Collation | Nullable | Default
--------------+--------+-----------+----------+--------------------------------------------------------------
id | bigint | | not null | nextval('operations_strategies_user_lists_id_seq'::regclass)
strategy_id | bigint | | not null |
user_list_id | bigint | | not null |
Indexes:
"operations_strategies_user_lists_pkey" PRIMARY KEY, btree (id)
"index_ops_strategies_user_lists_on_strategy_id_and_user_list_id" UNIQUE, btree (strategy_id, user_list_id)
"index_operations_strategies_user_lists_on_user_list_id" btree (user_list_id)
Foreign-key constraints:
"fk_rails_43241e8d29" FOREIGN KEY (strategy_id) REFERENCES operations_strategies(id) ON DELETE CASCADE
"fk_rails_ccb7e4bc0b" FOREIGN KEY (user_list_id) REFERENCES operations_user_lists(id) ON DELETE CASCADE
gitlabhq_development=# \q
$ bin/rails db:rollback
== 20200422213749 CreateOperationsStrategiesUserLists: reverting ==============
-- drop_table(:operations_strategies_user_lists)
-> 0.0014s
== 20200422213749 CreateOperationsStrategiesUserLists: reverted (0.0024s) =====
$ bin/rails dbconsole
psql (10.12)
Type "help" for help.
gitlabhq_development=# \d operations_strategies_user_lists
Did not find any relation named "operations_strategies_user_lists".
gitlabhq_development=# \q
$
Does this MR meet the acceptance criteria?
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Edited by Jason Goodman