Skip to content

Create Operations User Lists Table

Jason Goodman requested to merge add-operations-ff-lists-table into master

What does this MR do?

Add a migration to create the operations_user_lists table. This is the table for #205409 (closed), which is the CRUD API for user lists for use with feature flags.

Issue: #205409 (closed)

Migration Output

$  bin/rails db:migrate
== 20200401211005 CreateOperationsUserLists: migrating ========================
-- create_table(:operations_user_lists)
   -> 0.0110s
== 20200401211005 CreateOperationsUserLists: migrated (0.0110s) ===============

$ bin/rails dbconsole
psql (10.12)
Type "help" for help.

gitlabhq_development=# \d operations_user_lists
                                       Table "public.operations_user_lists"
   Column   |           Type           | Collation | Nullable |                      Default                      
------------+--------------------------+-----------+----------+---------------------------------------------------
 id         | bigint                   |           | not null | nextval('operations_user_lists_id_seq'::regclass)
 project_id | bigint                   |           | not null | 
 created_at | timestamp with time zone |           | not null | 
 updated_at | timestamp with time zone |           | not null | 
 iid        | integer                  |           | not null | 
 name       | character varying(255)   |           | not null | 
 user_ids   | text                     |           | not null | ''::text
Indexes:
    "operations_user_lists_pkey" PRIMARY KEY, btree (id)
    "index_operations_user_lists_on_project_id_and_iid" UNIQUE, btree (project_id, iid)
    "index_operations_user_lists_on_project_id_and_name" UNIQUE, btree (project_id, name)
Foreign-key constraints:
    "fk_rails_0c716e079b" FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE

gitlabhq_development=# \q
$ bin/rails db:rollback
== 20200401211005 CreateOperationsUserLists: reverting ========================
-- drop_table(:operations_user_lists)
   -> 0.0018s
== 20200401211005 CreateOperationsUserLists: reverted (0.0028s) ===============

$ 

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