Skip to content

Create Ops Strategies User Lists Table

Jason Goodman requested to merge add-ops-strategies-user-lists-table into master

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

Availability and Testing

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

Merge request reports