Migration and model changes for User permission uploads
What does this MR do?
Adds migrations and model changes for User permission uploads table. This table will be used to store the CSV exports of User permissions requested by admins.
Database changes
Column ordering:
Column | Type | Bytes |
---|---|---|
id | bigint | 8 |
created_at | timestamptz | 8 |
updated_at | timestamptz | 8 |
user_id | bigint | 8 |
file_store | integer | 4 |
status | integer | 2 |
file | variable | 8 |
Migration
== 20201116211829 CreateUserPermissionUploads: migrating ======================
-- table_exists?(:user_permission_uploads)
-> 0.0005s
-- create_table(:user_permission_uploads)
-> 0.0106s
-- transaction_open?()
-> 0.0000s
-- current_schema()
-> 0.0002s
-- execute("ALTER TABLE user_permission_uploads\nADD CONSTRAINT check_f71e45a125\nCHECK ( char_length(file) <= 255 )\nNOT VALID;\n")
-> 0.0005s
-- current_schema()
-> 0.0002s
-- execute("SET statement_timeout TO 0")
-> 0.0003s
-- execute("ALTER TABLE user_permission_uploads VALIDATE CONSTRAINT check_f71e45a125;")
-> 0.0007s
-- execute("RESET ALL")
-> 0.0002s
== 20201116211829 CreateUserPermissionUploads: migrated (0.0217s) =============
Rollback
== 20201116211829 CreateUserPermissionUploads: reverting ======================
-- drop_table(:user_permission_uploads)
-> 0.0055s
== 20201116211829 CreateUserPermissionUploads: reverted (0.0055s) =============
Mentions #273470 (closed)
Screenshots (strongly suggested)
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
Related to #273470 (closed)
Edited by Peter Leitzen