Introduce new tables and models for the enablement-only secret push protection profile
Why are we doing this work
In this issue, we will introduce the required database tables and their associated models to enable the rest of the security scan profiles effort.
Implementation plan
Introduce the following tables;
-
security_scan_profilesColumn | Type | Nullable | Default --------------------+--------------------------+----------+-------- id | bigint | not null | nextval(sequence) created_at | timestamp with time zone | not null | updated_at | timestamp with time zone | not null | namespace_id | bigint | not null | type | smallint | not null | gitlab_recommended | boolean | not null | false name | text | not null | description | text | |- Configure LFK for the
namespace_idcolumn. - Add a 256-character text limit for the
namecolumn. - Add a 2048-character text limit for the
descriptioncolumn. - Add a compound unique index on
namespace_id,type, andname(case insensitive) columns.
- Configure LFK for the
-
security_scan_profiles_projectsColumn | Type | Nullable | Default -----------------+--------------------------+----------+--------- id | bigint | not null | nextval(sequence) created_at | timestamp with time zone | not null | updated_at | timestamp with time zone | not null | scan_profile_id | bigint | not null | project_id | bigint | not null |- Configure LFK for the
project_idcolumn. - Add a foreign key to the
scan_profile_idwith cascading delete configuration.
- Configure LFK for the
-
security_scan_profile_triggersColumn | Type | Nullable | Default ------------------+--------------------------+----------+------------ id | bigint | not null | nextval(sequence) created_at | timestamp with time zone | not null | updated_at | timestamp with time zone | not null | scan_profile_id | bigint | not null | namespace_id | bigint | not null | type | smallint | not null |- Configure LFK for the
namespace_idcolumn. - Add a foreign key to the
scan_profile_idwith cascading delete configuration.
- Configure LFK for the
Verification steps
-
Check the schema on the production database.
Edited by Mehmet Emin INAC