diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-05 01:22:57 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-05 01:22:57 +0000 |
commit | 7fa016711e540f9b6dda45aa1f47867737c52940 (patch) | |
tree | 545fa4ba39a17df75301c6c90d7aef1e77cba98d /db | |
parent | ee3c8d00bd8c17201da0b116a9b3b276804b855f (diff) | |
download | gitlab-ce-7fa016711e540f9b6dda45aa1f47867737c52940.tar.gz |
Add latest changes from gitlab-org/gitlab@15-11-stable-ee
Diffstat (limited to 'db')
600 files changed, 6625 insertions, 820 deletions
diff --git a/db/init_structure.sql b/db/init_structure.sql index 63961f05c6b..aee0f767996 100644 --- a/db/init_structure.sql +++ b/db/init_structure.sql @@ -45,45 +45,23 @@ RETURN NULL; END $$; -CREATE FUNCTION insert_or_update_vulnerability_reads() RETURNS trigger +CREATE FUNCTION insert_projects_sync_event() RETURNS trigger LANGUAGE plpgsql AS $$ -DECLARE - severity smallint; - state smallint; - report_type smallint; - resolved_on_default_branch boolean; BEGIN - IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN - RETURN NULL; - END IF; - - IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN - RETURN NULL; - END IF; - - SELECT - vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch - INTO - severity, state, report_type, resolved_on_default_branch - FROM - vulnerabilities - WHERE - vulnerabilities.id = NEW.vulnerability_id; - - INSERT INTO vulnerability_reads (vulnerability_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id) - VALUES (NEW.vulnerability_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id') - ON CONFLICT(vulnerability_id) DO NOTHING; - RETURN NULL; +INSERT INTO projects_sync_events (project_id) +VALUES(COALESCE(NEW.id, OLD.id)); +RETURN NULL; + END $$; -CREATE FUNCTION insert_projects_sync_event() RETURNS trigger +CREATE FUNCTION integrations_set_type_new() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN -INSERT INTO projects_sync_events (project_id) -VALUES(COALESCE(NEW.id, OLD.id)); +UPDATE integrations SET type_new = regexp_replace(NEW.type, '\A(.+)Service\Z', 'Integrations::\1') +WHERE integrations.id = NEW.id; RETURN NULL; END @@ -129,83 +107,6 @@ RETURN NULL; END $$; -CREATE FUNCTION set_has_issues_on_vulnerability_reads() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN -UPDATE - vulnerability_reads -SET - has_issues = true -WHERE - vulnerability_id = NEW.vulnerability_id AND has_issues IS FALSE; -RETURN NULL; - -END -$$; - -CREATE FUNCTION unset_has_issues_on_vulnerability_reads() RETURNS trigger - LANGUAGE plpgsql - AS $$ -DECLARE - has_issue_links integer; -BEGIN - PERFORM 1 - FROM - vulnerability_reads - WHERE - vulnerability_id = OLD.vulnerability_id - FOR UPDATE; - - SELECT 1 INTO has_issue_links FROM vulnerability_issue_links WHERE vulnerability_id = OLD.vulnerability_id LIMIT 1; - - IF (has_issue_links = 1) THEN - RETURN NULL; - END IF; - - UPDATE - vulnerability_reads - SET - has_issues = false - WHERE - vulnerability_id = OLD.vulnerability_id; - - RETURN NULL; -END -$$; - -CREATE FUNCTION update_location_from_vulnerability_occurrences() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN -UPDATE - vulnerability_reads -SET - location_image = NEW.location->>'image', - cluster_agent_id = NEW.location->'kubernetes_resource'->>'agent_id' -WHERE - vulnerability_id = NEW.vulnerability_id; -RETURN NULL; - -END -$$; - -CREATE FUNCTION update_vulnerability_reads_from_vulnerability() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN -UPDATE - vulnerability_reads -SET - severity = NEW.severity, - state = NEW.state, - resolved_on_default_branch = NEW.resolved_on_default_branch -WHERE vulnerability_id = NEW.id; -RETURN NULL; - -END -$$; - CREATE TABLE audit_events ( id bigint NOT NULL, author_id integer NOT NULL, @@ -491,7 +392,7 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) ); -ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000 FOR VALUES FROM (MINVALUE) TO ('2023-03-01 00:00:00+00'); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_000000 FOR VALUES FROM (MINVALUE) TO ('2023-02-28 18:00:00-06'); CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 ( id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, @@ -505,7 +406,7 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) ); -ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 FOR VALUES FROM ('2023-03-01 00:00:00+00') TO ('2023-04-01 00:00:00+00'); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304 ( id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, @@ -519,7 +420,7 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) ); -ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304 FOR VALUES FROM ('2023-04-01 00:00:00+00') TO ('2023-05-01 00:00:00+00'); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 ( id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, @@ -533,7 +434,7 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) ); -ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 FOR VALUES FROM ('2023-05-01 00:00:00+00') TO ('2023-06-01 00:00:00+00'); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 ( id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, @@ -547,7 +448,7 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) ); -ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 FOR VALUES FROM ('2023-06-01 00:00:00+00') TO ('2023-07-01 00:00:00+00'); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 ( id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, @@ -561,7 +462,7 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) ); -ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 FOR VALUES FROM ('2023-07-01 00:00:00+00') TO ('2023-08-01 00:00:00+00'); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 ( id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, @@ -575,7 +476,7 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) ); -ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 FOR VALUES FROM ('2023-08-01 00:00:00+00') TO ('2023-09-01 00:00:00+00'); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 ( id bigint DEFAULT nextval('batched_background_migration_job_transition_logs_id_seq'::regclass) NOT NULL, @@ -589,7 +490,7 @@ CREATE TABLE gitlab_partitions_dynamic.batched_background_migration_job_transiti CONSTRAINT check_50e580811a CHECK ((char_length(exception_message) <= 1000)), CONSTRAINT check_76e202c37a CHECK ((char_length(exception_class) <= 100)) ); -ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 FOR VALUES FROM ('2023-09-01 00:00:00+00') TO ('2023-10-01 00:00:00+00'); +ALTER TABLE ONLY batched_background_migration_job_transition_logs ATTACH PARTITION gitlab_partitions_dynamic.batched_background_migration_job_transition_logs_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05'); CREATE TABLE incident_management_pending_alert_escalations ( id bigint NOT NULL, @@ -636,7 +537,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 FOR VALUES FROM ('2023-01-01 00:00:00+00') TO ('2023-02-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202301 FOR VALUES FROM ('2022-12-31 18:00:00-06') TO ('2023-01-31 18:00:00-06'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 ( id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL, @@ -646,7 +547,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 FOR VALUES FROM ('2023-02-01 00:00:00+00') TO ('2023-03-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202302 FOR VALUES FROM ('2023-01-31 18:00:00-06') TO ('2023-02-28 18:00:00-06'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 ( id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL, @@ -656,7 +557,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 FOR VALUES FROM ('2023-03-01 00:00:00+00') TO ('2023-04-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 ( id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL, @@ -666,7 +567,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 FOR VALUES FROM ('2023-04-01 00:00:00+00') TO ('2023-05-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 ( id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL, @@ -676,7 +577,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 FOR VALUES FROM ('2023-05-01 00:00:00+00') TO ('2023-06-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 ( id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL, @@ -686,7 +587,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 FOR VALUES FROM ('2023-06-01 00:00:00+00') TO ('2023-07-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 ( id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL, @@ -696,7 +597,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 FOR VALUES FROM ('2023-07-01 00:00:00+00') TO ('2023-08-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 ( id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL, @@ -706,7 +607,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 FOR VALUES FROM ('2023-08-01 00:00:00+00') TO ('2023-09-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 ( id bigint DEFAULT nextval('incident_management_pending_alert_escalations_id_seq'::regclass) NOT NULL, @@ -716,7 +617,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_alert_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 FOR VALUES FROM ('2023-09-01 00:00:00+00') TO ('2023-10-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_alert_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_alert_escalations_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05'); CREATE TABLE incident_management_pending_issue_escalations ( id bigint NOT NULL, @@ -763,7 +664,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 FOR VALUES FROM ('2023-01-01 00:00:00+00') TO ('2023-02-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202301 FOR VALUES FROM ('2022-12-31 18:00:00-06') TO ('2023-01-31 18:00:00-06'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 ( id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL, @@ -773,7 +674,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 FOR VALUES FROM ('2023-02-01 00:00:00+00') TO ('2023-03-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202302 FOR VALUES FROM ('2023-01-31 18:00:00-06') TO ('2023-02-28 18:00:00-06'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 ( id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL, @@ -783,7 +684,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 FOR VALUES FROM ('2023-03-01 00:00:00+00') TO ('2023-04-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 ( id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL, @@ -793,7 +694,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 FOR VALUES FROM ('2023-04-01 00:00:00+00') TO ('2023-05-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 ( id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL, @@ -803,7 +704,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 FOR VALUES FROM ('2023-05-01 00:00:00+00') TO ('2023-06-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 ( id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL, @@ -813,7 +714,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 FOR VALUES FROM ('2023-06-01 00:00:00+00') TO ('2023-07-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 ( id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL, @@ -823,7 +724,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 FOR VALUES FROM ('2023-07-01 00:00:00+00') TO ('2023-08-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 ( id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL, @@ -833,7 +734,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 FOR VALUES FROM ('2023-08-01 00:00:00+00') TO ('2023-09-01 00:00:00+00'); +ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 ( id bigint DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass) NOT NULL, @@ -843,42 +744,7 @@ CREATE TABLE gitlab_partitions_dynamic.incident_management_pending_issue_escalat created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL ); -ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 FOR VALUES FROM ('2023-09-01 00:00:00+00') TO ('2023-10-01 00:00:00+00'); - -CREATE TABLE loose_foreign_keys_deleted_records ( - id bigint NOT NULL, - partition bigint DEFAULT 1 NOT NULL, - primary_key_value bigint NOT NULL, - status smallint DEFAULT 1 NOT NULL, - created_at timestamp with time zone DEFAULT now() NOT NULL, - fully_qualified_table_name text NOT NULL, - consume_after timestamp with time zone DEFAULT now(), - cleanup_attempts smallint DEFAULT 0, - CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150)) -) -PARTITION BY LIST (partition); - -CREATE SEQUENCE loose_foreign_keys_deleted_records_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE loose_foreign_keys_deleted_records_id_seq OWNED BY loose_foreign_keys_deleted_records.id; - -CREATE TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1 ( - id bigint DEFAULT nextval('loose_foreign_keys_deleted_records_id_seq'::regclass) NOT NULL, - partition bigint DEFAULT 1 NOT NULL, - primary_key_value bigint NOT NULL, - status smallint DEFAULT 1 NOT NULL, - created_at timestamp with time zone DEFAULT now() NOT NULL, - fully_qualified_table_name text NOT NULL, - consume_after timestamp with time zone DEFAULT now(), - cleanup_attempts smallint DEFAULT 0, - CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150)) -); -ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1 FOR VALUES IN ('1'); +ALTER TABLE ONLY incident_management_pending_issue_escalations ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05'); CREATE TABLE verification_codes ( created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -887,7 +753,7 @@ CREATE TABLE verification_codes ( phone text NOT NULL, CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), - CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50)) + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ) PARTITION BY RANGE (created_at); @@ -900,9 +766,9 @@ CREATE TABLE gitlab_partitions_dynamic.verification_codes_000000 ( phone text NOT NULL, CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), - CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50)) + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_000000 FOR VALUES FROM (MINVALUE) TO ('2023-02-01 00:00:00+00'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_000000 FOR VALUES FROM (MINVALUE) TO ('2023-01-31 18:00:00-06'); CREATE TABLE gitlab_partitions_dynamic.verification_codes_202302 ( created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -911,9 +777,9 @@ CREATE TABLE gitlab_partitions_dynamic.verification_codes_202302 ( phone text NOT NULL, CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), - CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50)) + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202302 FOR VALUES FROM ('2023-02-01 00:00:00+00') TO ('2023-03-01 00:00:00+00'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202302 FOR VALUES FROM ('2023-01-31 18:00:00-06') TO ('2023-02-28 18:00:00-06'); CREATE TABLE gitlab_partitions_dynamic.verification_codes_202303 ( created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -922,9 +788,9 @@ CREATE TABLE gitlab_partitions_dynamic.verification_codes_202303 ( phone text NOT NULL, CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), - CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50)) + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202303 FOR VALUES FROM ('2023-03-01 00:00:00+00') TO ('2023-04-01 00:00:00+00'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202303 FOR VALUES FROM ('2023-02-28 18:00:00-06') TO ('2023-03-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.verification_codes_202304 ( created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -933,9 +799,9 @@ CREATE TABLE gitlab_partitions_dynamic.verification_codes_202304 ( phone text NOT NULL, CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), - CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50)) + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202304 FOR VALUES FROM ('2023-04-01 00:00:00+00') TO ('2023-05-01 00:00:00+00'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202304 FOR VALUES FROM ('2023-03-31 19:00:00-05') TO ('2023-04-30 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.verification_codes_202305 ( created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -944,9 +810,9 @@ CREATE TABLE gitlab_partitions_dynamic.verification_codes_202305 ( phone text NOT NULL, CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), - CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50)) + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202305 FOR VALUES FROM ('2023-05-01 00:00:00+00') TO ('2023-06-01 00:00:00+00'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202305 FOR VALUES FROM ('2023-04-30 19:00:00-05') TO ('2023-05-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.verification_codes_202306 ( created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -955,9 +821,9 @@ CREATE TABLE gitlab_partitions_dynamic.verification_codes_202306 ( phone text NOT NULL, CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), - CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50)) + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202306 FOR VALUES FROM ('2023-06-01 00:00:00+00') TO ('2023-07-01 00:00:00+00'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202306 FOR VALUES FROM ('2023-05-31 19:00:00-05') TO ('2023-06-30 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.verification_codes_202307 ( created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -966,9 +832,9 @@ CREATE TABLE gitlab_partitions_dynamic.verification_codes_202307 ( phone text NOT NULL, CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), - CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50)) + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202307 FOR VALUES FROM ('2023-07-01 00:00:00+00') TO ('2023-08-01 00:00:00+00'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202307 FOR VALUES FROM ('2023-06-30 19:00:00-05') TO ('2023-07-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.verification_codes_202308 ( created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -977,9 +843,9 @@ CREATE TABLE gitlab_partitions_dynamic.verification_codes_202308 ( phone text NOT NULL, CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), - CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50)) + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202308 FOR VALUES FROM ('2023-08-01 00:00:00+00') TO ('2023-09-01 00:00:00+00'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202308 FOR VALUES FROM ('2023-07-31 19:00:00-05') TO ('2023-08-31 19:00:00-05'); CREATE TABLE gitlab_partitions_dynamic.verification_codes_202309 ( created_at timestamp with time zone DEFAULT now() NOT NULL, @@ -988,9 +854,9 @@ CREATE TABLE gitlab_partitions_dynamic.verification_codes_202309 ( phone text NOT NULL, CONSTRAINT check_9b84e6aaff CHECK ((char_length(code) <= 8)), CONSTRAINT check_ccc542256b CHECK ((char_length(visitor_id_code) <= 64)), - CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 50)) + CONSTRAINT check_f5684c195b CHECK ((char_length(phone) <= 32)) ); -ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202309 FOR VALUES FROM ('2023-09-01 00:00:00+00') TO ('2023-10-01 00:00:00+00'); +ALTER TABLE ONLY verification_codes ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_202309 FOR VALUES FROM ('2023-08-31 19:00:00-05') TO ('2023-09-30 19:00:00-05'); CREATE TABLE web_hook_logs ( id bigint NOT NULL, @@ -2648,6 +2514,39 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_63 ( ); ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_63 FOR VALUES WITH (modulus 64, remainder 63); +CREATE TABLE loose_foreign_keys_deleted_records ( + id bigint NOT NULL, + partition bigint DEFAULT 1 NOT NULL, + primary_key_value bigint NOT NULL, + status smallint DEFAULT 1 NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + fully_qualified_table_name text NOT NULL, + consume_after timestamp with time zone DEFAULT now(), + CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150)) +) +PARTITION BY LIST (partition); + +CREATE SEQUENCE loose_foreign_keys_deleted_records_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE loose_foreign_keys_deleted_records_id_seq OWNED BY loose_foreign_keys_deleted_records.id; + +CREATE TABLE gitlab_partitions_static.loose_foreign_keys_deleted_records_1 ( + id bigint DEFAULT nextval('loose_foreign_keys_deleted_records_id_seq'::regclass) NOT NULL, + partition bigint DEFAULT 1 NOT NULL, + primary_key_value bigint NOT NULL, + status smallint DEFAULT 1 NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + fully_qualified_table_name text NOT NULL, + consume_after timestamp with time zone DEFAULT now(), + CONSTRAINT check_1a541f3235 CHECK ((char_length(fully_qualified_table_name) <= 150)) +); +ALTER TABLE ONLY loose_foreign_keys_deleted_records ATTACH PARTITION gitlab_partitions_static.loose_foreign_keys_deleted_records_1 FOR VALUES IN ('1'); + CREATE TABLE product_analytics_events_experimental ( id bigint NOT NULL, project_id integer NOT NULL, @@ -11394,29 +11293,6 @@ CREATE SEQUENCE alert_management_alert_assignees_id_seq ALTER SEQUENCE alert_management_alert_assignees_id_seq OWNED BY alert_management_alert_assignees.id; -CREATE TABLE alert_management_alert_metric_images ( - id bigint NOT NULL, - alert_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - file_store smallint, - file text NOT NULL, - url text, - url_text text, - CONSTRAINT check_2587666252 CHECK ((char_length(url_text) <= 128)), - CONSTRAINT check_4d811d9007 CHECK ((char_length(url) <= 255)), - CONSTRAINT check_70fafae519 CHECK ((char_length(file) <= 255)) -); - -CREATE SEQUENCE alert_management_alert_metric_images_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE alert_management_alert_metric_images_id_seq OWNED BY alert_management_alert_metric_images.id; - CREATE TABLE alert_management_alert_user_mentions ( id bigint NOT NULL, alert_management_alert_id bigint NOT NULL, @@ -11516,30 +11392,6 @@ CREATE SEQUENCE allowed_email_domains_id_seq ALTER SEQUENCE allowed_email_domains_id_seq OWNED BY allowed_email_domains.id; -CREATE TABLE analytics_cycle_analytics_aggregations ( - group_id bigint NOT NULL, - incremental_runtimes_in_seconds integer[] DEFAULT '{}'::integer[] NOT NULL, - incremental_processed_records integer[] DEFAULT '{}'::integer[] NOT NULL, - last_full_run_runtimes_in_seconds integer[] DEFAULT '{}'::integer[] NOT NULL, - last_full_run_processed_records integer[] DEFAULT '{}'::integer[] NOT NULL, - last_incremental_issues_id integer, - last_incremental_merge_requests_id integer, - last_full_run_issues_id integer, - last_full_run_merge_requests_id integer, - last_incremental_run_at timestamp with time zone, - last_incremental_issues_updated_at timestamp with time zone, - last_incremental_merge_requests_updated_at timestamp with time zone, - last_full_run_at timestamp with time zone, - last_full_run_issues_updated_at timestamp with time zone, - last_full_run_mrs_updated_at timestamp with time zone, - last_consistency_check_updated_at timestamp with time zone, - enabled boolean DEFAULT true NOT NULL, - CONSTRAINT chk_rails_1ef688e577 CHECK ((cardinality(incremental_runtimes_in_seconds) <= 10)), - CONSTRAINT chk_rails_7810292ec9 CHECK ((cardinality(last_full_run_processed_records) <= 10)), - CONSTRAINT chk_rails_8b9e89687c CHECK ((cardinality(last_full_run_runtimes_in_seconds) <= 10)), - CONSTRAINT chk_rails_e16bf3913a CHECK ((cardinality(incremental_processed_records) <= 10)) -); - CREATE TABLE analytics_cycle_analytics_group_stages ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -11671,7 +11523,7 @@ CREATE TABLE analytics_devops_adoption_snapshots ( runner_configured boolean NOT NULL, pipeline_succeeded boolean NOT NULL, deploy_succeeded boolean NOT NULL, - security_scan_succeeded boolean, + security_scan_succeeded boolean NOT NULL, end_time timestamp with time zone NOT NULL, total_projects_count integer, code_owners_used_count integer, @@ -11947,7 +11799,7 @@ CREATE TABLE application_settings ( throttle_protected_paths_enabled boolean DEFAULT false NOT NULL, throttle_protected_paths_requests_per_period integer DEFAULT 10 NOT NULL, throttle_protected_paths_period_in_seconds integer DEFAULT 60 NOT NULL, - protected_paths character varying(255)[] DEFAULT '{/users/password,/users/sign_in,/api/v3/session.json,/api/v3/session,/api/v4/session.json,/api/v4/session,/users,/users/confirmation,/unsubscribes/,/import/github/personal_access_token,/admin/session}'::character varying[], + protected_paths character varying(255)[] DEFAULT '{/users/password,/users/sign_in,/api/v3/session.json,/api/v3/session,/api/v4/session.json,/api/v4/session,/users,/users/confirmation,/unsubscribes/,/import/github/personal_access_token,/admin/session,/oauth/authorize,/oauth/token}'::character varying[], snowplow_collector_hostname character varying, sourcegraph_enabled boolean DEFAULT false NOT NULL, sourcegraph_url character varying(255), @@ -12030,7 +11882,7 @@ CREATE TABLE application_settings ( kroki_url text, kroki_enabled boolean DEFAULT false NOT NULL, help_page_documentation_base_url text, - container_registry_expiration_policies_worker_capacity integer DEFAULT 4 NOT NULL, + container_registry_expiration_policies_worker_capacity integer DEFAULT 0 NOT NULL, require_admin_approval_after_user_signup boolean DEFAULT true NOT NULL, automatic_purchased_storage_allocation boolean DEFAULT false NOT NULL, encrypted_ci_jwt_signing_key text, @@ -12132,41 +11984,15 @@ CREATE TABLE application_settings ( max_ssh_key_lifetime integer, static_objects_external_storage_auth_token_encrypted text, future_subscriptions jsonb DEFAULT '[]'::jsonb NOT NULL, - user_email_lookup_limit integer DEFAULT 60 NOT NULL, - packages_cleanup_package_file_worker_capacity smallint DEFAULT 2 NOT NULL, - container_registry_import_max_tags_count integer DEFAULT 100 NOT NULL, - container_registry_import_max_retries integer DEFAULT 3 NOT NULL, - container_registry_import_start_max_retries integer DEFAULT 50 NOT NULL, - container_registry_import_max_step_duration integer DEFAULT 300 NOT NULL, - container_registry_import_target_plan text DEFAULT 'free'::text NOT NULL, - container_registry_import_created_before timestamp with time zone DEFAULT '2022-01-23 00:00:00+00'::timestamp with time zone NOT NULL, - runner_token_expiration_interval integer, - group_runner_token_expiration_interval integer, - project_runner_token_expiration_interval integer, - ecdsa_sk_key_restriction integer DEFAULT 0 NOT NULL, - ed25519_sk_key_restriction integer DEFAULT 0 NOT NULL, - users_get_by_id_limit integer DEFAULT 300 NOT NULL, - users_get_by_id_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL, - container_registry_expiration_policies_caching boolean DEFAULT true NOT NULL, - search_rate_limit integer DEFAULT 30 NOT NULL, - search_rate_limit_unauthenticated integer DEFAULT 10 NOT NULL, - encrypted_database_grafana_api_key bytea, - encrypted_database_grafana_api_key_iv bytea, - database_grafana_api_url text, - database_grafana_tag text, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)), CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)), - CONSTRAINT app_settings_p_cleanup_package_file_worker_capacity_positive CHECK ((packages_cleanup_package_file_worker_capacity >= 0)), CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)), CONSTRAINT app_settings_yaml_max_depth_positive CHECK ((max_yaml_depth > 0)), CONSTRAINT app_settings_yaml_max_size_positive CHECK ((max_yaml_size_bytes > 0)), CONSTRAINT check_17d9558205 CHECK ((char_length(kroki_url) <= 1024)), - CONSTRAINT check_2b820eaac3 CHECK ((char_length(database_grafana_tag) <= 255)), CONSTRAINT check_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)), CONSTRAINT check_32710817e9 CHECK ((char_length(static_objects_external_storage_auth_token_encrypted) <= 255)), - CONSTRAINT check_3455368420 CHECK ((char_length(database_grafana_api_url) <= 255)), - CONSTRAINT check_3559645ae5 CHECK ((char_length(container_registry_import_target_plan) <= 255)), CONSTRAINT check_3def0f1829 CHECK ((char_length(sentry_clientside_dsn) <= 255)), CONSTRAINT check_4f8b811780 CHECK ((char_length(sentry_dsn) <= 255)), CONSTRAINT check_51700b31b5 CHECK ((char_length(default_branch_name) <= 255)), @@ -12437,9 +12263,7 @@ CREATE TABLE audit_events_external_audit_event_destinations ( destination_url text NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - verification_token text, - CONSTRAINT check_2feafb9daf CHECK ((char_length(destination_url) <= 255)), - CONSTRAINT check_8ec80a7d06 CHECK ((char_length(verification_token) <= 24)) + CONSTRAINT check_2feafb9daf CHECK ((char_length(destination_url) <= 255)) ); CREATE SEQUENCE audit_events_external_audit_event_destinations_id_seq @@ -12592,7 +12416,6 @@ CREATE TABLE batched_background_migrations ( job_arguments jsonb DEFAULT '"[]"'::jsonb NOT NULL, total_tuple_count bigint, pause_ms integer DEFAULT 100 NOT NULL, - max_batch_size integer, CONSTRAINT check_5bb0382d6f CHECK ((char_length(column_name) <= 63)), CONSTRAINT check_6b6a06254a CHECK ((char_length(table_name) <= 63)), CONSTRAINT check_batch_size_in_range CHECK ((batch_size >= sub_batch_size)), @@ -12862,8 +12685,7 @@ CREATE TABLE broadcast_messages ( cached_markdown_version integer, dismissable boolean, target_path character varying(255), - broadcast_type smallint DEFAULT 1 NOT NULL, - target_access_levels integer[] DEFAULT '{}'::integer[] NOT NULL + broadcast_type smallint DEFAULT 1 NOT NULL ); CREATE SEQUENCE broadcast_messages_id_seq @@ -13885,11 +13707,7 @@ CREATE TABLE ci_runners ( token_encrypted character varying, public_projects_minutes_cost_factor double precision DEFAULT 0.0 NOT NULL, private_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL, - config jsonb DEFAULT '{}'::jsonb NOT NULL, - executor_type smallint, - maintainer_note text, - token_expires_at timestamp with time zone, - CONSTRAINT check_ce275cee06 CHECK ((char_length(maintainer_note) <= 1024)) + config jsonb DEFAULT '{}'::jsonb NOT NULL ); CREATE SEQUENCE ci_runners_id_seq @@ -13920,29 +13738,6 @@ CREATE SEQUENCE ci_running_builds_id_seq ALTER SEQUENCE ci_running_builds_id_seq OWNED BY ci_running_builds.id; -CREATE TABLE ci_secure_files ( - id bigint NOT NULL, - project_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - file_store smallint DEFAULT 1 NOT NULL, - permissions smallint DEFAULT 0 NOT NULL, - name text NOT NULL, - file text NOT NULL, - checksum bytea NOT NULL, - CONSTRAINT check_320790634d CHECK ((char_length(file) <= 255)), - CONSTRAINT check_402c7b4a56 CHECK ((char_length(name) <= 255)) -); - -CREATE SEQUENCE ci_secure_files_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE ci_secure_files_id_seq OWNED BY ci_secure_files.id; - CREATE TABLE ci_sources_pipelines ( id integer NOT NULL, project_id integer, @@ -14124,7 +13919,6 @@ CREATE TABLE cluster_agent_tokens ( description text, name text, last_used_at timestamp with time zone, - status smallint DEFAULT 0 NOT NULL, CONSTRAINT check_0fb634d04d CHECK ((name IS NOT NULL)), CONSTRAINT check_2b79dbb315 CHECK ((char_length(name) <= 255)), CONSTRAINT check_4e4ec5070a CHECK ((char_length(description) <= 1024)), @@ -14633,19 +14427,7 @@ CREATE TABLE container_repositories ( status smallint, expiration_policy_started_at timestamp with time zone, expiration_policy_cleanup_status smallint DEFAULT 0 NOT NULL, - expiration_policy_completed_at timestamp with time zone, - migration_pre_import_started_at timestamp with time zone, - migration_pre_import_done_at timestamp with time zone, - migration_import_started_at timestamp with time zone, - migration_import_done_at timestamp with time zone, - migration_aborted_at timestamp with time zone, - migration_skipped_at timestamp with time zone, - migration_retries_count integer DEFAULT 0 NOT NULL, - migration_skipped_reason smallint, - migration_state text DEFAULT 'default'::text NOT NULL, - migration_aborted_in_state text, - CONSTRAINT check_13c58fe73a CHECK ((char_length(migration_state) <= 255)), - CONSTRAINT check_97f0249439 CHECK ((char_length(migration_aborted_in_state) <= 255)) + expiration_policy_completed_at timestamp with time zone ); CREATE SEQUENCE container_repositories_id_seq @@ -14965,8 +14747,6 @@ CREATE TABLE dast_site_profiles ( auth_password_field text, auth_username text, target_type smallint DEFAULT 0 NOT NULL, - scan_method smallint DEFAULT 0 NOT NULL, - scan_file_path text, CONSTRAINT check_5203110fee CHECK ((char_length(auth_username_field) <= 255)), CONSTRAINT check_6cfab17b48 CHECK ((char_length(name) <= 255)), CONSTRAINT check_c329dffdba CHECK ((char_length(auth_password_field) <= 255)), @@ -15193,9 +14973,7 @@ CREATE TABLE deployment_approvals ( user_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - status smallint NOT NULL, - comment text, - CONSTRAINT check_e2eb6a17d8 CHECK ((char_length(comment) <= 255)) + status smallint NOT NULL ); CREATE SEQUENCE deployment_approvals_id_seq @@ -15389,7 +15167,6 @@ CREATE TABLE dora_daily_metrics ( date date NOT NULL, deployment_frequency integer, lead_time_for_changes_in_seconds integer, - time_to_restore_service_in_seconds integer, CONSTRAINT dora_daily_metrics_deployment_frequency_positive CHECK ((deployment_frequency >= 0)), CONSTRAINT dora_daily_metrics_lead_time_for_changes_in_seconds_positive CHECK ((lead_time_for_changes_in_seconds >= 0)) ); @@ -16510,22 +16287,6 @@ CREATE SEQUENCE grafana_integrations_id_seq ALTER SEQUENCE grafana_integrations_id_seq OWNED BY grafana_integrations.id; -CREATE TABLE group_crm_settings ( - group_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - enabled boolean DEFAULT false NOT NULL -); - -CREATE SEQUENCE group_crm_settings_group_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE group_crm_settings_group_id_seq OWNED BY group_crm_settings.group_id; - CREATE TABLE group_custom_attributes ( id integer NOT NULL, created_at timestamp with time zone NOT NULL, @@ -16611,13 +16372,6 @@ CREATE SEQUENCE group_deploy_tokens_id_seq ALTER SEQUENCE group_deploy_tokens_id_seq OWNED BY group_deploy_tokens.id; -CREATE TABLE group_features ( - group_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - wiki_access_level smallint DEFAULT 20 NOT NULL -); - CREATE TABLE group_group_links ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -17010,6 +16764,7 @@ ALTER SEQUENCE insights_id_seq OWNED BY insights.id; CREATE TABLE integrations ( id integer NOT NULL, + type character varying, project_id integer, created_at timestamp without time zone, updated_at timestamp without time zone, @@ -17038,8 +16793,6 @@ CREATE TABLE integrations ( vulnerability_events boolean DEFAULT false NOT NULL, type_new text, archive_trace_events boolean DEFAULT false NOT NULL, - encrypted_properties bytea, - encrypted_properties_iv bytea, CONSTRAINT check_a948a0aa7e CHECK ((char_length(type_new) <= 255)) ); @@ -17093,8 +16846,6 @@ CREATE TABLE issuable_metric_images ( file_store smallint, file text NOT NULL, url text, - url_text text, - CONSTRAINT check_3bc6d47661 CHECK ((char_length(url_text) <= 128)), CONSTRAINT check_5b3011e234 CHECK ((char_length(url) <= 255)), CONSTRAINT check_7ed527062f CHECK ((char_length(file) <= 255)) ); @@ -17754,8 +17505,7 @@ CREATE TABLE members ( ldap boolean DEFAULT false NOT NULL, override boolean DEFAULT false NOT NULL, invite_email_success boolean DEFAULT true NOT NULL, - state smallint DEFAULT 0, - member_namespace_id bigint + state smallint DEFAULT 0 ); CREATE SEQUENCE members_id_seq @@ -17773,8 +17523,7 @@ CREATE TABLE merge_request_assignees ( user_id integer NOT NULL, merge_request_id integer NOT NULL, created_at timestamp with time zone, - state smallint DEFAULT 0 NOT NULL, - updated_state_by_user_id bigint + state smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE merge_request_assignees_id_seq @@ -18003,8 +17752,7 @@ CREATE TABLE merge_request_reviewers ( user_id bigint NOT NULL, merge_request_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, - state smallint DEFAULT 0 NOT NULL, - updated_state_by_user_id bigint + state smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE merge_request_reviewers_id_seq @@ -18101,8 +17849,7 @@ CREATE TABLE merge_requests_compliance_violations ( id bigint NOT NULL, violating_user_id bigint NOT NULL, merge_request_id bigint NOT NULL, - reason smallint NOT NULL, - severity_level smallint DEFAULT 0 NOT NULL + reason smallint NOT NULL ); CREATE SEQUENCE merge_requests_compliance_violations_id_seq @@ -18278,8 +18025,7 @@ CREATE TABLE namespace_root_storage_statistics ( packages_size bigint DEFAULT 0 NOT NULL, snippets_size bigint DEFAULT 0 NOT NULL, pipeline_artifacts_size bigint DEFAULT 0 NOT NULL, - uploads_size bigint DEFAULT 0 NOT NULL, - dependency_proxy_size bigint DEFAULT 0 NOT NULL + uploads_size bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE namespace_root_storage_statistics_namespace_id_seq @@ -18307,9 +18053,6 @@ CREATE TABLE namespace_settings ( new_user_signups_cap integer, setup_for_company boolean, jobs_to_be_done smallint, - runner_token_expiration_interval integer, - subgroup_runner_token_expiration_interval integer, - project_runner_token_expiration_interval integer, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)) ); @@ -18319,8 +18062,7 @@ CREATE TABLE namespace_statistics ( shared_runners_seconds integer DEFAULT 0 NOT NULL, shared_runners_seconds_last_reset timestamp without time zone, storage_size bigint DEFAULT 0 NOT NULL, - wiki_size bigint DEFAULT 0 NOT NULL, - dependency_proxy_size bigint DEFAULT 0 NOT NULL + wiki_size bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE namespace_statistics_id_seq @@ -18622,14 +18364,7 @@ CREATE TABLE onboarding_progresses ( issue_auto_closed_at timestamp with time zone, repository_imported_at timestamp with time zone, repository_mirrored_at timestamp with time zone, - issue_created_at timestamp with time zone, - secure_dependency_scanning_run_at timestamp with time zone, - secure_container_scanning_run_at timestamp with time zone, - secure_dast_run_at timestamp with time zone, - secure_secret_detection_run_at timestamp with time zone, - secure_coverage_fuzzing_run_at timestamp with time zone, - secure_cluster_image_scanning_run_at timestamp with time zone, - secure_api_fuzzing_run_at timestamp with time zone + issue_created_at timestamp with time zone ); CREATE SEQUENCE onboarding_progresses_id_seq @@ -19269,7 +19004,6 @@ CREATE TABLE packages_package_files ( verification_checksum bytea, verification_state smallint DEFAULT 0 NOT NULL, verification_started_at timestamp with time zone, - status smallint DEFAULT 0 NOT NULL, CONSTRAINT check_4c5e6bb0b3 CHECK ((file_store IS NOT NULL)) ); @@ -19305,7 +19039,7 @@ ALTER SEQUENCE packages_packages_id_seq OWNED BY packages_packages.id; CREATE TABLE packages_pypi_metadata ( package_id bigint NOT NULL, - required_python text DEFAULT ''::text, + required_python text, CONSTRAINT check_0d9aed55b2 CHECK ((required_python IS NOT NULL)), CONSTRAINT check_379019d5da CHECK ((char_length(required_python) <= 255)) ); @@ -19479,6 +19213,28 @@ CREATE SEQUENCE pages_domains_id_seq ALTER SEQUENCE pages_domains_id_seq OWNED BY pages_domains.id; +CREATE TABLE partitioned_foreign_keys ( + id bigint NOT NULL, + cascade_delete boolean DEFAULT true NOT NULL, + from_table text NOT NULL, + from_column text NOT NULL, + to_table text NOT NULL, + to_column text NOT NULL, + CONSTRAINT check_2c2e02a62b CHECK ((char_length(from_column) <= 63)), + CONSTRAINT check_40738efb57 CHECK ((char_length(to_table) <= 63)), + CONSTRAINT check_741676d405 CHECK ((char_length(from_table) <= 63)), + CONSTRAINT check_7e98be694f CHECK ((char_length(to_column) <= 63)) +); + +CREATE SEQUENCE partitioned_foreign_keys_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE partitioned_foreign_keys_id_seq OWNED BY partitioned_foreign_keys.id; + CREATE TABLE path_locks ( id integer NOT NULL, path character varying NOT NULL, @@ -19958,25 +19714,6 @@ CREATE SEQUENCE project_auto_devops_id_seq ALTER SEQUENCE project_auto_devops_id_seq OWNED BY project_auto_devops.id; -CREATE TABLE project_build_artifacts_size_refreshes ( - id bigint NOT NULL, - project_id bigint NOT NULL, - last_job_artifact_id bigint, - state smallint DEFAULT 1 NOT NULL, - refresh_started_at timestamp with time zone, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL -); - -CREATE SEQUENCE project_build_artifacts_size_refreshes_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE project_build_artifacts_size_refreshes_id_seq OWNED BY project_build_artifacts_size_refreshes.id; - CREATE TABLE project_ci_cd_settings ( id integer NOT NULL, project_id integer NOT NULL, @@ -19988,8 +19725,7 @@ CREATE TABLE project_ci_cd_settings ( auto_rollback_enabled boolean DEFAULT false NOT NULL, keep_latest_artifact boolean DEFAULT true NOT NULL, restrict_user_defined_variables boolean DEFAULT false NOT NULL, - job_token_scope_enabled boolean DEFAULT false NOT NULL, - runner_token_expiration_interval integer + job_token_scope_enabled boolean DEFAULT false NOT NULL ); CREATE SEQUENCE project_ci_cd_settings_id_seq @@ -20138,8 +19874,7 @@ CREATE TABLE project_features ( requirements_access_level integer DEFAULT 20 NOT NULL, operations_access_level integer DEFAULT 20 NOT NULL, security_and_compliance_access_level integer DEFAULT 10 NOT NULL, - container_registry_access_level integer DEFAULT 0 NOT NULL, - package_registry_access_level integer DEFAULT 0 NOT NULL + container_registry_access_level integer DEFAULT 0 NOT NULL ); CREATE SEQUENCE project_features_id_seq @@ -20343,7 +20078,6 @@ CREATE TABLE project_settings ( merge_commit_template text, has_shimo boolean DEFAULT false NOT NULL, squash_commit_template text, - legacy_open_source_license_available boolean DEFAULT true NOT NULL, CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096)), CONSTRAINT check_b09644994b CHECK ((char_length(squash_commit_template) <= 500)), CONSTRAINT check_eaf7cfb6a7 CHECK ((char_length(merge_commit_template) <= 500)) @@ -20493,8 +20227,7 @@ CREATE TABLE projects ( remove_source_branch_after_merge boolean, suggestion_commit_message character varying(255), autoclose_referenced_issues boolean, - project_namespace_id bigint, - hidden boolean DEFAULT false NOT NULL + project_namespace_id bigint ); CREATE SEQUENCE projects_id_seq @@ -20669,28 +20402,6 @@ CREATE SEQUENCE protected_branches_id_seq ALTER SEQUENCE protected_branches_id_seq OWNED BY protected_branches.id; -CREATE TABLE protected_environment_approval_rules ( - id bigint NOT NULL, - protected_environment_id bigint NOT NULL, - user_id bigint, - group_id bigint, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - access_level smallint, - required_approvals smallint NOT NULL, - CONSTRAINT chk_rails_bed75249bc CHECK ((((access_level IS NOT NULL) AND (group_id IS NULL) AND (user_id IS NULL)) OR ((user_id IS NOT NULL) AND (access_level IS NULL) AND (group_id IS NULL)) OR ((group_id IS NOT NULL) AND (user_id IS NULL) AND (access_level IS NULL)))), - CONSTRAINT chk_rails_cfa90ae3b5 CHECK ((required_approvals > 0)) -); - -CREATE SEQUENCE protected_environment_approval_rules_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE protected_environment_approval_rules_id_seq OWNED BY protected_environment_approval_rules.id; - CREATE TABLE protected_environment_deploy_access_levels ( id integer NOT NULL, created_at timestamp with time zone NOT NULL, @@ -20719,8 +20430,7 @@ CREATE TABLE protected_environments ( name character varying NOT NULL, group_id bigint, required_approval_count integer DEFAULT 0 NOT NULL, - CONSTRAINT protected_environments_project_or_group_existence CHECK (((project_id IS NULL) <> (group_id IS NULL))), - CONSTRAINT protected_environments_required_approval_count_positive CHECK ((required_approval_count >= 0)) + CONSTRAINT protected_environments_project_or_group_existence CHECK (((project_id IS NULL) <> (group_id IS NULL))) ); CREATE SEQUENCE protected_environments_id_seq @@ -20853,24 +20563,6 @@ CREATE SEQUENCE redirect_routes_id_seq ALTER SEQUENCE redirect_routes_id_seq OWNED BY redirect_routes.id; -CREATE TABLE related_epic_links ( - id bigint NOT NULL, - source_id bigint NOT NULL, - target_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - link_type smallint DEFAULT 0 NOT NULL -); - -CREATE SEQUENCE related_epic_links_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE related_epic_links_id_seq OWNED BY related_epic_links.id; - CREATE TABLE release_links ( id bigint NOT NULL, release_id integer NOT NULL, @@ -21142,8 +20834,7 @@ CREATE TABLE routes ( path character varying NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone, - name character varying, - namespace_id bigint + name character varying ); CREATE SEQUENCE routes_id_seq @@ -21198,26 +20889,6 @@ CREATE SEQUENCE saml_providers_id_seq ALTER SEQUENCE saml_providers_id_seq OWNED BY saml_providers.id; -CREATE TABLE saved_replies ( - id bigint NOT NULL, - user_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - name text NOT NULL, - content text NOT NULL, - CONSTRAINT check_0cb57dc22a CHECK ((char_length(content) <= 10000)), - CONSTRAINT check_2eb3366d7f CHECK ((char_length(name) <= 255)) -); - -CREATE SEQUENCE saved_replies_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE saved_replies_id_seq OWNED BY saved_replies.id; - CREATE TABLE scim_identities ( id bigint NOT NULL, group_id bigint NOT NULL, @@ -21263,9 +20934,9 @@ CREATE TABLE security_findings ( confidence smallint NOT NULL, project_fingerprint text, deduplicated boolean DEFAULT false NOT NULL, + "position" integer, uuid uuid, overridden_uuid uuid, - CONSTRAINT check_6c2851a8c9 CHECK ((uuid IS NOT NULL)), CONSTRAINT check_b9508c6df8 CHECK ((char_length(project_fingerprint) <= 40)) ); @@ -21280,13 +20951,11 @@ ALTER SEQUENCE security_findings_id_seq OWNED BY security_findings.id; CREATE TABLE security_orchestration_policy_configurations ( id bigint NOT NULL, - project_id bigint, + project_id bigint NOT NULL, security_policy_management_project_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - configured_at timestamp with time zone, - namespace_id bigint, - CONSTRAINT cop_configs_project_or_namespace_existence CHECK (((project_id IS NULL) <> (namespace_id IS NULL))) + configured_at timestamp with time zone ); COMMENT ON TABLE security_orchestration_policy_configurations IS '{"owner":"group::container security","description":"Configuration used to store relationship between project and security policy repository"}'; @@ -21346,47 +21015,6 @@ CREATE SEQUENCE security_scans_id_seq ALTER SEQUENCE security_scans_id_seq OWNED BY security_scans.id; -CREATE TABLE security_training_providers ( - id bigint NOT NULL, - name text NOT NULL, - description text, - url text NOT NULL, - logo_url text, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - CONSTRAINT check_544b3dc935 CHECK ((char_length(url) <= 512)), - CONSTRAINT check_6fe222f071 CHECK ((char_length(logo_url) <= 512)), - CONSTRAINT check_a8ff21ced5 CHECK ((char_length(description) <= 512)), - CONSTRAINT check_dae433eed6 CHECK ((char_length(name) <= 256)) -); - -CREATE SEQUENCE security_training_providers_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE security_training_providers_id_seq OWNED BY security_training_providers.id; - -CREATE TABLE security_trainings ( - id bigint NOT NULL, - project_id bigint NOT NULL, - provider_id bigint NOT NULL, - is_primary boolean DEFAULT false NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL -); - -CREATE SEQUENCE security_trainings_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE security_trainings_id_seq OWNED BY security_trainings.id; - CREATE TABLE self_managed_prometheus_alert_events ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -21682,7 +21310,7 @@ CREATE TABLE sprints ( group_id bigint, iid integer NOT NULL, cached_markdown_version integer, - title text, + title text NOT NULL, title_html text, description text, description_html text, @@ -21707,8 +21335,7 @@ CREATE TABLE status_check_responses ( merge_request_id bigint NOT NULL, external_approval_rule_id bigint, sha bytea NOT NULL, - external_status_check_id bigint NOT NULL, - status smallint DEFAULT 0 NOT NULL + external_status_check_id bigint NOT NULL ); CREATE SEQUENCE status_check_responses_id_seq @@ -21940,7 +21567,7 @@ CREATE TABLE timelogs ( updated_at timestamp without time zone NOT NULL, issue_id integer, merge_request_id integer, - spent_at timestamp with time zone DEFAULT now(), + spent_at timestamp with time zone, note_id integer, project_id integer, summary text, @@ -22008,7 +21635,6 @@ CREATE TABLE topics ( avatar text, description text, total_projects_count bigint DEFAULT 0 NOT NULL, - non_private_projects_count bigint DEFAULT 0 NOT NULL, CONSTRAINT check_26753fb43a CHECK ((char_length(avatar) <= 255)), CONSTRAINT check_5d1a07c8c8 CHECK ((char_length(description) <= 1024)), CONSTRAINT check_7a90d4c757 CHECK ((char_length(name) <= 255)) @@ -22188,7 +21814,7 @@ CREATE TABLE user_credit_card_validations ( network text, CONSTRAINT check_1765e2b30f CHECK ((char_length(network) <= 32)), CONSTRAINT check_3eea080c91 CHECK (((last_digits >= 0) AND (last_digits <= 9999))), - CONSTRAINT check_cc0c8dc0fe CHECK ((char_length(holder_name) <= 50)) + CONSTRAINT check_eafe45d88b CHECK ((char_length(holder_name) <= 26)) ); CREATE TABLE user_custom_attributes ( @@ -22221,9 +21847,8 @@ CREATE TABLE user_details ( pronunciation text, registration_objective smallint, phone text, - requires_credit_card_verification boolean DEFAULT false NOT NULL, CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)), - CONSTRAINT check_a73b398c60 CHECK ((char_length(phone) <= 50)), + CONSTRAINT check_a73b398c60 CHECK ((char_length(phone) <= 32)), CONSTRAINT check_b132136b01 CHECK ((char_length(other_role) <= 100)), CONSTRAINT check_eeeaf8d4f0 CHECK ((char_length(pronouns) <= 50)), CONSTRAINT check_f932ed37db CHECK ((char_length(pronunciation) <= 255)) @@ -22319,11 +21944,7 @@ CREATE TABLE user_preferences ( experience_level smallint, view_diffs_file_by_file boolean DEFAULT false NOT NULL, gitpod_enabled boolean DEFAULT false NOT NULL, - markdown_surround_selection boolean DEFAULT true NOT NULL, - diffs_deletion_color text, - diffs_addition_color text, - CONSTRAINT check_89bf269f41 CHECK ((char_length(diffs_deletion_color) <= 7)), - CONSTRAINT check_d07ccd35f7 CHECK ((char_length(diffs_addition_color) <= 7)) + markdown_surround_selection boolean DEFAULT true NOT NULL ); CREATE SEQUENCE user_preferences_id_seq @@ -22658,12 +22279,140 @@ CREATE SEQUENCE vulnerability_feedback_id_seq ALTER SEQUENCE vulnerability_feedback_id_seq OWNED BY vulnerability_feedback.id; +CREATE TABLE vulnerability_finding_evidence_assets ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_finding_evidence_id bigint NOT NULL, + type text, + name text, + url text, + CONSTRAINT check_5adf5d69de CHECK ((char_length(type) <= 2048)), + CONSTRAINT check_839f29d7ca CHECK ((char_length(name) <= 2048)), + CONSTRAINT check_9272d912c0 CHECK ((char_length(url) <= 2048)) +); + +CREATE SEQUENCE vulnerability_finding_evidence_assets_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidence_assets_id_seq OWNED BY vulnerability_finding_evidence_assets.id; + +CREATE TABLE vulnerability_finding_evidence_headers ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_finding_evidence_request_id bigint, + vulnerability_finding_evidence_response_id bigint, + name text NOT NULL, + value text NOT NULL, + CONSTRAINT check_01d21e8d92 CHECK ((char_length(name) <= 255)), + CONSTRAINT check_3f9011f903 CHECK ((char_length(value) <= 8192)) +); + +CREATE SEQUENCE vulnerability_finding_evidence_headers_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidence_headers_id_seq OWNED BY vulnerability_finding_evidence_headers.id; + +CREATE TABLE vulnerability_finding_evidence_requests ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_finding_evidence_id bigint, + method text, + url text, + body text, + vulnerability_finding_evidence_supporting_message_id bigint, + CONSTRAINT check_7e37f2d01a CHECK ((char_length(body) <= 2048)), + CONSTRAINT check_8152fbb236 CHECK ((char_length(url) <= 2048)), + CONSTRAINT check_d9d11300f4 CHECK ((char_length(method) <= 32)) +); + +CREATE SEQUENCE vulnerability_finding_evidence_requests_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidence_requests_id_seq OWNED BY vulnerability_finding_evidence_requests.id; + +CREATE TABLE vulnerability_finding_evidence_responses ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_finding_evidence_id bigint, + status_code integer, + reason_phrase text, + body text, + vulnerability_finding_evidence_supporting_message_id bigint, + CONSTRAINT check_58b124ab48 CHECK ((char_length(reason_phrase) <= 2048)), + CONSTRAINT check_76bac0c32b CHECK ((char_length(body) <= 2048)) +); + +CREATE SEQUENCE vulnerability_finding_evidence_responses_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidence_responses_id_seq OWNED BY vulnerability_finding_evidence_responses.id; + +CREATE TABLE vulnerability_finding_evidence_sources ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_finding_evidence_id bigint NOT NULL, + name text, + url text, + CONSTRAINT check_0fe01298d6 CHECK ((char_length(url) <= 2048)), + CONSTRAINT check_86b537ba1a CHECK ((char_length(name) <= 2048)) +); + +CREATE SEQUENCE vulnerability_finding_evidence_sources_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidence_sources_id_seq OWNED BY vulnerability_finding_evidence_sources.id; + +CREATE TABLE vulnerability_finding_evidence_supporting_messages ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + vulnerability_finding_evidence_id bigint NOT NULL, + name text, + CONSTRAINT check_fa33b9ae85 CHECK ((char_length(name) <= 2048)) +); + +CREATE SEQUENCE vulnerability_finding_evidence_supporting_messages_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidence_supporting_messages_id_seq OWNED BY vulnerability_finding_evidence_supporting_messages.id; + CREATE TABLE vulnerability_finding_evidences ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, vulnerability_occurrence_id bigint NOT NULL, - data jsonb DEFAULT '{}'::jsonb NOT NULL + summary text, + data jsonb DEFAULT '{}'::jsonb NOT NULL, + CONSTRAINT check_5773b236fb CHECK ((char_length(summary) <= 8000000)) ); CREATE SEQUENCE vulnerability_finding_evidences_id_seq @@ -22901,9 +22650,7 @@ CREATE TABLE vulnerability_reads ( resolved_on_default_branch boolean DEFAULT false NOT NULL, uuid uuid NOT NULL, location_image text, - cluster_agent_id text, - CONSTRAINT check_380451bdbe CHECK ((char_length(location_image) <= 2048)), - CONSTRAINT check_a105eb825a CHECK ((char_length(cluster_agent_id) <= 10)) + CONSTRAINT check_380451bdbe CHECK ((char_length(location_image) <= 2048)) ); CREATE SEQUENCE vulnerability_reads_id_seq @@ -23241,8 +22988,6 @@ ALTER TABLE ONLY agent_project_authorizations ALTER COLUMN id SET DEFAULT nextva ALTER TABLE ONLY alert_management_alert_assignees ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_assignees_id_seq'::regclass); -ALTER TABLE ONLY alert_management_alert_metric_images ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_metric_images_id_seq'::regclass); - ALTER TABLE ONLY alert_management_alert_user_mentions ALTER COLUMN id SET DEFAULT nextval('alert_management_alert_user_mentions_id_seq'::regclass); ALTER TABLE ONLY alert_management_alerts ALTER COLUMN id SET DEFAULT nextval('alert_management_alerts_id_seq'::regclass); @@ -23437,8 +23182,6 @@ ALTER TABLE ONLY ci_runners ALTER COLUMN id SET DEFAULT nextval('ci_runners_id_s ALTER TABLE ONLY ci_running_builds ALTER COLUMN id SET DEFAULT nextval('ci_running_builds_id_seq'::regclass); -ALTER TABLE ONLY ci_secure_files ALTER COLUMN id SET DEFAULT nextval('ci_secure_files_id_seq'::regclass); - ALTER TABLE ONLY ci_sources_pipelines ALTER COLUMN id SET DEFAULT nextval('ci_sources_pipelines_id_seq'::regclass); ALTER TABLE ONLY ci_sources_projects ALTER COLUMN id SET DEFAULT nextval('ci_sources_projects_id_seq'::regclass); @@ -23663,8 +23406,6 @@ ALTER TABLE ONLY gpg_signatures ALTER COLUMN id SET DEFAULT nextval('gpg_signatu ALTER TABLE ONLY grafana_integrations ALTER COLUMN id SET DEFAULT nextval('grafana_integrations_id_seq'::regclass); -ALTER TABLE ONLY group_crm_settings ALTER COLUMN group_id SET DEFAULT nextval('group_crm_settings_group_id_seq'::regclass); - ALTER TABLE ONLY group_custom_attributes ALTER COLUMN id SET DEFAULT nextval('group_custom_attributes_id_seq'::regclass); ALTER TABLE ONLY group_deploy_keys ALTER COLUMN id SET DEFAULT nextval('group_deploy_keys_id_seq'::regclass); @@ -23913,6 +23654,8 @@ ALTER TABLE ONLY pages_domain_acme_orders ALTER COLUMN id SET DEFAULT nextval('p ALTER TABLE ONLY pages_domains ALTER COLUMN id SET DEFAULT nextval('pages_domains_id_seq'::regclass); +ALTER TABLE ONLY partitioned_foreign_keys ALTER COLUMN id SET DEFAULT nextval('partitioned_foreign_keys_id_seq'::regclass); + ALTER TABLE ONLY path_locks ALTER COLUMN id SET DEFAULT nextval('path_locks_id_seq'::regclass); ALTER TABLE ONLY personal_access_tokens ALTER COLUMN id SET DEFAULT nextval('personal_access_tokens_id_seq'::regclass); @@ -23937,8 +23680,6 @@ ALTER TABLE ONLY project_aliases ALTER COLUMN id SET DEFAULT nextval('project_al ALTER TABLE ONLY project_auto_devops ALTER COLUMN id SET DEFAULT nextval('project_auto_devops_id_seq'::regclass); -ALTER TABLE ONLY project_build_artifacts_size_refreshes ALTER COLUMN id SET DEFAULT nextval('project_build_artifacts_size_refreshes_id_seq'::regclass); - ALTER TABLE ONLY project_ci_cd_settings ALTER COLUMN id SET DEFAULT nextval('project_ci_cd_settings_id_seq'::regclass); ALTER TABLE ONLY project_ci_feature_usages ALTER COLUMN id SET DEFAULT nextval('project_ci_feature_usages_id_seq'::regclass); @@ -23993,8 +23734,6 @@ ALTER TABLE ONLY protected_branch_unprotect_access_levels ALTER COLUMN id SET DE ALTER TABLE ONLY protected_branches ALTER COLUMN id SET DEFAULT nextval('protected_branches_id_seq'::regclass); -ALTER TABLE ONLY protected_environment_approval_rules ALTER COLUMN id SET DEFAULT nextval('protected_environment_approval_rules_id_seq'::regclass); - ALTER TABLE ONLY protected_environment_deploy_access_levels ALTER COLUMN id SET DEFAULT nextval('protected_environment_deploy_access_levels_id_seq'::regclass); ALTER TABLE ONLY protected_environments ALTER COLUMN id SET DEFAULT nextval('protected_environments_id_seq'::regclass); @@ -24009,8 +23748,6 @@ ALTER TABLE ONLY raw_usage_data ALTER COLUMN id SET DEFAULT nextval('raw_usage_d ALTER TABLE ONLY redirect_routes ALTER COLUMN id SET DEFAULT nextval('redirect_routes_id_seq'::regclass); -ALTER TABLE ONLY related_epic_links ALTER COLUMN id SET DEFAULT nextval('related_epic_links_id_seq'::regclass); - ALTER TABLE ONLY release_links ALTER COLUMN id SET DEFAULT nextval('release_links_id_seq'::regclass); ALTER TABLE ONLY releases ALTER COLUMN id SET DEFAULT nextval('releases_id_seq'::regclass); @@ -24041,8 +23778,6 @@ ALTER TABLE ONLY saml_group_links ALTER COLUMN id SET DEFAULT nextval('saml_grou ALTER TABLE ONLY saml_providers ALTER COLUMN id SET DEFAULT nextval('saml_providers_id_seq'::regclass); -ALTER TABLE ONLY saved_replies ALTER COLUMN id SET DEFAULT nextval('saved_replies_id_seq'::regclass); - ALTER TABLE ONLY scim_identities ALTER COLUMN id SET DEFAULT nextval('scim_identities_id_seq'::regclass); ALTER TABLE ONLY scim_oauth_access_tokens ALTER COLUMN id SET DEFAULT nextval('scim_oauth_access_tokens_id_seq'::regclass); @@ -24055,10 +23790,6 @@ ALTER TABLE ONLY security_orchestration_policy_rule_schedules ALTER COLUMN id SE ALTER TABLE ONLY security_scans ALTER COLUMN id SET DEFAULT nextval('security_scans_id_seq'::regclass); -ALTER TABLE ONLY security_training_providers ALTER COLUMN id SET DEFAULT nextval('security_training_providers_id_seq'::regclass); - -ALTER TABLE ONLY security_trainings ALTER COLUMN id SET DEFAULT nextval('security_trainings_id_seq'::regclass); - ALTER TABLE ONLY self_managed_prometheus_alert_events ALTER COLUMN id SET DEFAULT nextval('self_managed_prometheus_alert_events_id_seq'::regclass); ALTER TABLE ONLY sent_notifications ALTER COLUMN id SET DEFAULT nextval('sent_notifications_id_seq'::regclass); @@ -24161,6 +23892,18 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER COLUMN id SET DEFAULT ALTER TABLE ONLY vulnerability_feedback ALTER COLUMN id SET DEFAULT nextval('vulnerability_feedback_id_seq'::regclass); +ALTER TABLE ONLY vulnerability_finding_evidence_assets ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_assets_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_finding_evidence_headers ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_headers_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_finding_evidence_requests ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_requests_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_finding_evidence_responses ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_responses_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_finding_evidence_sources ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_sources_id_seq'::regclass); + +ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidence_supporting_messages_id_seq'::regclass); + ALTER TABLE ONLY vulnerability_finding_evidences ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_evidences_id_seq'::regclass); ALTER TABLE ONLY vulnerability_finding_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_links_id_seq'::regclass); @@ -24350,12 +24093,6 @@ ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_esc ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 ADD CONSTRAINT incident_management_pending_issue_escalations_202309_pkey PRIMARY KEY (id, process_at); -ALTER TABLE ONLY loose_foreign_keys_deleted_records - ADD CONSTRAINT loose_foreign_keys_deleted_records_pkey PRIMARY KEY (partition, id); - -ALTER TABLE ONLY gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1 - ADD CONSTRAINT loose_foreign_keys_deleted_records_1_pkey PRIMARY KEY (partition, id); - ALTER TABLE ONLY verification_codes ADD CONSTRAINT verification_codes_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); @@ -24815,6 +24552,12 @@ ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_62 ALTER TABLE ONLY gitlab_partitions_static.issue_search_data_63 ADD CONSTRAINT issue_search_data_63_pkey PRIMARY KEY (project_id, issue_id); +ALTER TABLE ONLY loose_foreign_keys_deleted_records + ADD CONSTRAINT loose_foreign_keys_deleted_records_pkey PRIMARY KEY (partition, id); + +ALTER TABLE ONLY gitlab_partitions_static.loose_foreign_keys_deleted_records_1 + ADD CONSTRAINT loose_foreign_keys_deleted_records_1_pkey PRIMARY KEY (partition, id); + ALTER TABLE ONLY product_analytics_events_experimental ADD CONSTRAINT product_analytics_events_experimental_pkey PRIMARY KEY (id, project_id); @@ -25025,9 +24768,6 @@ ALTER TABLE ONLY agent_project_authorizations ALTER TABLE ONLY alert_management_alert_assignees ADD CONSTRAINT alert_management_alert_assignees_pkey PRIMARY KEY (id); -ALTER TABLE ONLY alert_management_alert_metric_images - ADD CONSTRAINT alert_management_alert_metric_images_pkey PRIMARY KEY (id); - ALTER TABLE ONLY alert_management_alert_user_mentions ADD CONSTRAINT alert_management_alert_user_mentions_pkey PRIMARY KEY (id); @@ -25040,9 +24780,6 @@ ALTER TABLE ONLY alert_management_http_integrations ALTER TABLE ONLY allowed_email_domains ADD CONSTRAINT allowed_email_domains_pkey PRIMARY KEY (id); -ALTER TABLE ONLY analytics_cycle_analytics_aggregations - ADD CONSTRAINT analytics_cycle_analytics_aggregations_pkey PRIMARY KEY (group_id); - ALTER TABLE ONLY analytics_cycle_analytics_group_stages ADD CONSTRAINT analytics_cycle_analytics_group_stages_pkey PRIMARY KEY (id); @@ -25217,6 +24954,9 @@ ALTER TABLE ONLY chat_teams ALTER TABLE vulnerability_scanners ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID; +ALTER TABLE security_findings + ADD CONSTRAINT check_6c2851a8c9 CHECK ((uuid IS NOT NULL)) NOT VALID; + ALTER TABLE sprints ADD CONSTRAINT check_ccd8a1eae0 CHECK ((start_date IS NOT NULL)) NOT VALID; @@ -25343,9 +25083,6 @@ ALTER TABLE ONLY ci_runners ALTER TABLE ONLY ci_running_builds ADD CONSTRAINT ci_running_builds_pkey PRIMARY KEY (id); -ALTER TABLE ONLY ci_secure_files - ADD CONSTRAINT ci_secure_files_pkey PRIMARY KEY (id); - ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT ci_sources_pipelines_pkey PRIMARY KEY (id); @@ -25718,9 +25455,6 @@ ALTER TABLE ONLY gpg_signatures ALTER TABLE ONLY grafana_integrations ADD CONSTRAINT grafana_integrations_pkey PRIMARY KEY (id); -ALTER TABLE ONLY group_crm_settings - ADD CONSTRAINT group_crm_settings_pkey PRIMARY KEY (group_id); - ALTER TABLE ONLY group_custom_attributes ADD CONSTRAINT group_custom_attributes_pkey PRIMARY KEY (id); @@ -25736,9 +25470,6 @@ ALTER TABLE ONLY group_deploy_keys ALTER TABLE ONLY group_deploy_tokens ADD CONSTRAINT group_deploy_tokens_pkey PRIMARY KEY (id); -ALTER TABLE ONLY group_features - ADD CONSTRAINT group_features_pkey PRIMARY KEY (group_id); - ALTER TABLE ONLY group_group_links ADD CONSTRAINT group_group_links_pkey PRIMARY KEY (id); @@ -26159,6 +25890,9 @@ ALTER TABLE ONLY pages_domain_acme_orders ALTER TABLE ONLY pages_domains ADD CONSTRAINT pages_domains_pkey PRIMARY KEY (id); +ALTER TABLE ONLY partitioned_foreign_keys + ADD CONSTRAINT partitioned_foreign_keys_pkey PRIMARY KEY (id); + ALTER TABLE ONLY path_locks ADD CONSTRAINT path_locks_pkey PRIMARY KEY (id); @@ -26201,9 +25935,6 @@ ALTER TABLE ONLY project_authorizations ALTER TABLE ONLY project_auto_devops ADD CONSTRAINT project_auto_devops_pkey PRIMARY KEY (id); -ALTER TABLE ONLY project_build_artifacts_size_refreshes - ADD CONSTRAINT project_build_artifacts_size_refreshes_pkey PRIMARY KEY (id); - ALTER TABLE ONLY project_ci_cd_settings ADD CONSTRAINT project_ci_cd_settings_pkey PRIMARY KEY (id); @@ -26303,9 +26034,6 @@ ALTER TABLE ONLY protected_branch_unprotect_access_levels ALTER TABLE ONLY protected_branches ADD CONSTRAINT protected_branches_pkey PRIMARY KEY (id); -ALTER TABLE ONLY protected_environment_approval_rules - ADD CONSTRAINT protected_environment_approval_rules_pkey PRIMARY KEY (id); - ALTER TABLE ONLY protected_environment_deploy_access_levels ADD CONSTRAINT protected_environment_deploy_access_levels_pkey PRIMARY KEY (id); @@ -26330,15 +26058,9 @@ ALTER TABLE ONLY raw_usage_data ALTER TABLE ONLY redirect_routes ADD CONSTRAINT redirect_routes_pkey PRIMARY KEY (id); -ALTER TABLE ONLY related_epic_links - ADD CONSTRAINT related_epic_links_pkey PRIMARY KEY (id); - ALTER TABLE ONLY release_links ADD CONSTRAINT release_links_pkey PRIMARY KEY (id); -ALTER TABLE releases - ADD CONSTRAINT releases_not_null_tag CHECK ((tag IS NOT NULL)) NOT VALID; - ALTER TABLE ONLY releases ADD CONSTRAINT releases_pkey PRIMARY KEY (id); @@ -26384,9 +26106,6 @@ ALTER TABLE ONLY saml_group_links ALTER TABLE ONLY saml_providers ADD CONSTRAINT saml_providers_pkey PRIMARY KEY (id); -ALTER TABLE ONLY saved_replies - ADD CONSTRAINT saved_replies_pkey PRIMARY KEY (id); - ALTER TABLE ONLY scim_identities ADD CONSTRAINT scim_identities_pkey PRIMARY KEY (id); @@ -26405,12 +26124,6 @@ ALTER TABLE ONLY security_orchestration_policy_rule_schedules ALTER TABLE ONLY security_scans ADD CONSTRAINT security_scans_pkey PRIMARY KEY (id); -ALTER TABLE ONLY security_training_providers - ADD CONSTRAINT security_training_providers_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY security_trainings - ADD CONSTRAINT security_trainings_pkey PRIMARY KEY (id); - ALTER TABLE ONLY self_managed_prometheus_alert_events ADD CONSTRAINT self_managed_prometheus_alert_events_pkey PRIMARY KEY (id); @@ -26594,6 +26307,24 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER TABLE ONLY vulnerability_feedback ADD CONSTRAINT vulnerability_feedback_pkey PRIMARY KEY (id); +ALTER TABLE ONLY vulnerability_finding_evidence_assets + ADD CONSTRAINT vulnerability_finding_evidence_assets_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_finding_evidence_headers + ADD CONSTRAINT vulnerability_finding_evidence_headers_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_finding_evidence_requests + ADD CONSTRAINT vulnerability_finding_evidence_requests_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_finding_evidence_responses + ADD CONSTRAINT vulnerability_finding_evidence_responses_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_finding_evidence_sources + ADD CONSTRAINT vulnerability_finding_evidence_sources_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages + ADD CONSTRAINT vulnerability_finding_evidence_supporting_messages_pkey PRIMARY KEY (id); + ALTER TABLE ONLY vulnerability_finding_evidences ADD CONSTRAINT vulnerability_finding_evidences_pkey PRIMARY KEY (id); @@ -26834,10 +26565,6 @@ CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx8 ON CREATE INDEX incident_management_pending_issue_escalations_202_issue_id_idx9 ON gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202309 USING btree (issue_id); -CREATE INDEX index_loose_foreign_keys_deleted_records_for_partitioned_query ON ONLY loose_foreign_keys_deleted_records USING btree (partition, fully_qualified_table_name, consume_after, id) WHERE (status = 1); - -CREATE INDEX index_01e3390fac ON gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1 USING btree (partition, fully_qualified_table_name, consume_after, id) WHERE (status = 1); - CREATE INDEX index_web_hook_logs_part_on_web_hook_id ON ONLY web_hook_logs USING btree (web_hook_id); CREATE INDEX index_1554dc6f11 ON gitlab_partitions_dynamic.web_hook_logs_202301 USING btree (web_hook_id); @@ -26916,6 +26643,10 @@ CREATE INDEX index_merge_request_stage_events_project_duration ON ONLY analytics CREATE INDEX index_006f943df6 ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); +CREATE INDEX index_loose_foreign_keys_deleted_records_for_partitioned_query ON ONLY loose_foreign_keys_deleted_records USING btree (partition, fully_qualified_table_name, consume_after, id) WHERE (status = 1); + +CREATE INDEX index_01e3390fac ON gitlab_partitions_static.loose_foreign_keys_deleted_records_1 USING btree (partition, fully_qualified_table_name, consume_after, id) WHERE (status = 1); + CREATE INDEX index_02749b504c ON gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 USING btree (stage_event_hash_id, project_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); CREATE INDEX index_merge_request_stage_events_group_duration ON ONLY analytics_cycle_analytics_merge_request_stage_events USING btree (stage_event_hash_id, group_id, end_event_timestamp, merge_request_id, start_event_timestamp) WHERE (end_event_timestamp IS NOT NULL); @@ -27840,12 +27571,6 @@ CREATE INDEX approval_mr_rule_index_merge_request_id ON approval_merge_request_r CREATE UNIQUE INDEX bulk_import_trackers_uniq_relation_by_entity ON bulk_import_trackers USING btree (bulk_import_entity_id, relation); -CREATE INDEX ca_aggregations_last_consistency_check_updated_at ON analytics_cycle_analytics_aggregations USING btree (last_consistency_check_updated_at NULLS FIRST) WHERE (enabled IS TRUE); - -CREATE INDEX ca_aggregations_last_full_run_at ON analytics_cycle_analytics_aggregations USING btree (last_full_run_at NULLS FIRST) WHERE (enabled IS TRUE); - -CREATE INDEX ca_aggregations_last_incremental_run_at ON analytics_cycle_analytics_aggregations USING btree (last_incremental_run_at NULLS FIRST) WHERE (enabled IS TRUE); - CREATE INDEX cadence_create_iterations_automation ON iterations_cadences USING btree (automatic, duration_in_weeks, date((COALESCE(last_run_date, '1970-01-01'::date) + ((duration_in_weeks)::double precision * '7 days'::interval)))) WHERE (duration_in_weeks IS NOT NULL); CREATE INDEX ci_builds_gitlab_monitor_metrics ON ci_builds USING btree (status, created_at, project_id) WHERE ((type)::text = 'Ci::Build'::text); @@ -27870,11 +27595,25 @@ CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_and_note_id_index ON epic_user CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_index ON epic_user_mentions USING btree (epic_id) WHERE (note_id IS NULL); -CREATE UNIQUE INDEX finding_evidences_on_unique_vulnerability_occurrence_id ON vulnerability_finding_evidences USING btree (vulnerability_occurrence_id); +CREATE INDEX finding_evidence_assets_on_finding_evidence_id ON vulnerability_finding_evidence_assets USING btree (vulnerability_finding_evidence_id); + +CREATE INDEX finding_evidence_header_on_finding_evidence_request_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_request_id); + +CREATE INDEX finding_evidence_header_on_finding_evidence_response_id ON vulnerability_finding_evidence_headers USING btree (vulnerability_finding_evidence_response_id); + +CREATE INDEX finding_evidence_requests_on_finding_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_id); + +CREATE INDEX finding_evidence_requests_on_supporting_evidence_id ON vulnerability_finding_evidence_requests USING btree (vulnerability_finding_evidence_supporting_message_id); + +CREATE INDEX finding_evidence_responses_on_finding_evidences_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_id); + +CREATE INDEX finding_evidence_responses_on_supporting_evidence_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_supporting_message_id); -CREATE UNIQUE INDEX finding_link_name_url_idx ON vulnerability_finding_links USING btree (vulnerability_occurrence_id, name, url); +CREATE INDEX finding_evidence_sources_on_finding_evidence_id ON vulnerability_finding_evidence_sources USING btree (vulnerability_finding_evidence_id); -CREATE UNIQUE INDEX finding_link_url_idx ON vulnerability_finding_links USING btree (vulnerability_occurrence_id, url) WHERE (name IS NULL); +CREATE INDEX finding_evidence_supporting_messages_on_finding_evidence_id ON vulnerability_finding_evidence_supporting_messages USING btree (vulnerability_finding_evidence_id); + +CREATE UNIQUE INDEX finding_evidences_on_unique_vulnerability_occurrence_id ON vulnerability_finding_evidences USING btree (vulnerability_occurrence_id); CREATE INDEX finding_links_on_vulnerability_occurrence_id ON vulnerability_finding_links USING btree (vulnerability_occurrence_id); @@ -27886,8 +27625,6 @@ CREATE INDEX idx_analytics_devops_adoption_snapshots_finalized ON analytics_devo CREATE INDEX idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id ON award_emoji USING btree (user_id, name, awardable_type, awardable_id); -CREATE INDEX idx_build_artifacts_size_refreshes_state_updated_at ON project_build_artifacts_size_refreshes USING btree (state, updated_at); - CREATE INDEX idx_ci_pipelines_artifacts_locked ON ci_pipelines USING btree (ci_ref_id, id) WHERE (locked = 1); CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at ON container_expiration_policies USING btree (project_id, next_run_at) WHERE (enabled = true); @@ -27896,12 +27633,6 @@ CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at_enabled ON con CREATE INDEX idx_container_repos_on_exp_cleanup_status_project_id_start_date ON container_repositories USING btree (expiration_policy_cleanup_status, project_id, expiration_policy_started_at); -CREATE INDEX idx_container_repos_on_import_started_at_when_importing ON container_repositories USING btree (migration_import_started_at) WHERE (migration_state = 'importing'::text); - -CREATE INDEX idx_container_repos_on_pre_import_done_at_when_pre_import_done ON container_repositories USING btree (migration_pre_import_done_at) WHERE (migration_state = 'pre_import_done'::text); - -CREATE INDEX idx_container_repos_on_pre_import_started_at_when_pre_importing ON container_repositories USING btree (migration_pre_import_started_at) WHERE (migration_state = 'pre_importing'::text); - CREATE INDEX idx_deployment_clusters_on_cluster_id_and_kubernetes_namespace ON deployment_clusters USING btree (cluster_id, kubernetes_namespace); CREATE INDEX idx_devops_adoption_segments_namespace_end_time ON analytics_devops_adoption_snapshots USING btree (namespace_id, end_time); @@ -27970,16 +27701,12 @@ CREATE UNIQUE INDEX idx_on_external_status_checks_project_id_external_url ON ext CREATE UNIQUE INDEX idx_on_external_status_checks_project_id_name ON external_status_checks USING btree (project_id, name); +CREATE INDEX idx_packages_build_infos_on_package_id ON packages_build_infos USING btree (package_id); + CREATE INDEX idx_packages_debian_group_component_files_on_architecture_id ON packages_debian_group_component_files USING btree (architecture_id); CREATE INDEX idx_packages_debian_project_component_files_on_architecture_id ON packages_debian_project_component_files USING btree (architecture_id); -CREATE UNIQUE INDEX idx_packages_on_project_id_name_version_unique_when_generic ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 7) AND (status <> 4)); - -CREATE UNIQUE INDEX idx_packages_on_project_id_name_version_unique_when_golang ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 8) AND (status <> 4)); - -CREATE UNIQUE INDEX idx_packages_on_project_id_name_version_unique_when_helm ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 11) AND (status <> 4)); - CREATE INDEX idx_packages_packages_on_project_id_name_version_package_type ON packages_packages USING btree (project_id, name, version, package_type); CREATE INDEX idx_pkgs_debian_group_distribution_keys_on_distribution_id ON packages_debian_group_distribution_keys USING btree (distribution_id); @@ -27996,12 +27723,6 @@ CREATE UNIQUE INDEX idx_project_id_payload_key_self_managed_prometheus_alert_eve CREATE INDEX idx_project_repository_check_partial ON projects USING btree (repository_storage, created_at) WHERE (last_repository_check_at IS NULL); -CREATE INDEX idx_projects_api_created_at_id_for_archived ON projects USING btree (created_at, id) WHERE ((archived = true) AND (pending_delete = false) AND (hidden = false)); - -CREATE INDEX idx_projects_api_created_at_id_for_archived_vis20 ON projects USING btree (created_at, id) WHERE ((archived = true) AND (visibility_level = 20) AND (pending_delete = false) AND (hidden = false)); - -CREATE INDEX idx_projects_api_created_at_id_for_vis10 ON projects USING btree (created_at, id) WHERE ((visibility_level = 10) AND (pending_delete = false) AND (hidden = false)); - CREATE INDEX idx_projects_id_created_at_disable_overriding_approvers_false ON projects USING btree (id, created_at) WHERE ((disable_overriding_approvers_per_merge_request = false) OR (disable_overriding_approvers_per_merge_request IS NULL)); CREATE INDEX idx_projects_id_created_at_disable_overriding_approvers_true ON projects USING btree (id, created_at) WHERE (disable_overriding_approvers_per_merge_request = true); @@ -28026,8 +27747,6 @@ CREATE INDEX idx_security_scans_on_scan_type ON security_scans USING btree (scan CREATE UNIQUE INDEX idx_serverless_domain_cluster_on_clusters_applications_knative ON serverless_domain_cluster USING btree (clusters_applications_knative_id); -CREATE INDEX idx_user_details_on_provisioned_by_group_id_user_id ON user_details USING btree (provisioned_by_group_id, user_id); - CREATE UNIQUE INDEX idx_vuln_signatures_on_occurrences_id_and_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, signature_sha); CREATE UNIQUE INDEX idx_vuln_signatures_uniqueness_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, algorithm_type, signature_sha); @@ -28066,8 +27785,6 @@ CREATE INDEX index_alert_assignees_on_alert_id ON alert_management_alert_assigne CREATE UNIQUE INDEX index_alert_assignees_on_user_id_and_alert_id ON alert_management_alert_assignees USING btree (user_id, alert_id); -CREATE INDEX index_alert_management_alert_metric_images_on_alert_id ON alert_management_alert_metric_images USING btree (alert_id); - CREATE INDEX index_alert_management_alerts_on_domain ON alert_management_alerts USING btree (domain); CREATE INDEX index_alert_management_alerts_on_environment_id ON alert_management_alerts USING btree (environment_id) WHERE (environment_id IS NOT NULL); @@ -28168,9 +27885,7 @@ CREATE UNIQUE INDEX index_approval_rule_name_for_code_owners_rule_type ON approv CREATE UNIQUE INDEX index_approval_rule_name_for_sectional_code_owners_rule_type ON approval_merge_request_rules USING btree (merge_request_id, name, section) WHERE (rule_type = 2); -CREATE INDEX index_approval_rule_on_protected_environment_id ON protected_environment_approval_rules USING btree (protected_environment_id); - -CREATE INDEX index_approval_rules_code_owners_rule_type ON approval_merge_request_rules USING btree (merge_request_id) WHERE (rule_type = 2); +CREATE INDEX index_approval_rules_code_owners_rule_type ON approval_merge_request_rules USING btree (merge_request_id, rule_type) WHERE (rule_type = 2); CREATE INDEX index_approvals_on_merge_request_id ON approvals USING btree (merge_request_id); @@ -28188,8 +27903,6 @@ CREATE INDEX index_approvers_on_user_id ON approvers USING btree (user_id); CREATE UNIQUE INDEX index_atlassian_identities_on_extern_uid ON atlassian_identities USING btree (extern_uid); -CREATE UNIQUE INDEX index_audit_events_external_audit_on_verification_token ON audit_events_external_audit_event_destinations USING btree (verification_token); - CREATE INDEX index_authentication_events_on_provider ON authentication_events USING btree (provider); CREATE INDEX index_authentication_events_on_provider_user_id_created_at ON authentication_events USING btree (provider, user_id, created_at) WHERE (result = 1); @@ -28412,10 +28125,6 @@ CREATE INDEX index_ci_job_artifacts_on_file_store ON ci_job_artifacts USING btre CREATE INDEX index_ci_job_artifacts_on_file_type_for_devops_adoption ON ci_job_artifacts USING btree (file_type, project_id, created_at) WHERE (file_type = ANY (ARRAY[5, 6, 8, 23])); -CREATE INDEX index_ci_job_artifacts_on_id_project_id_and_created_at ON ci_job_artifacts USING btree (project_id, created_at, id); - -CREATE INDEX index_ci_job_artifacts_on_id_project_id_and_file_type ON ci_job_artifacts USING btree (project_id, file_type, id); - CREATE UNIQUE INDEX index_ci_job_artifacts_on_job_id_and_file_type ON ci_job_artifacts USING btree (job_id, file_type); CREATE INDEX index_ci_job_artifacts_on_project_id ON ci_job_artifacts USING btree (project_id); @@ -28522,8 +28231,6 @@ CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_source ON ci_pipel CREATE INDEX index_ci_pipelines_on_user_id_and_id_and_cancelable_status ON ci_pipelines USING btree (user_id, id) WHERE ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('waiting_for_resource'::character varying)::text, ('preparing'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text, ('scheduled'::character varying)::text])); -CREATE INDEX index_ci_pipelines_on_user_id_and_id_desc_and_user_not_verified ON ci_pipelines USING btree (user_id, id DESC) WHERE (failure_reason = 3); - CREATE INDEX index_ci_project_mirrors_on_namespace_id ON ci_project_mirrors USING btree (namespace_id); CREATE UNIQUE INDEX index_ci_project_mirrors_on_project_id ON ci_project_mirrors USING btree (project_id); @@ -28544,18 +28251,14 @@ CREATE UNIQUE INDEX index_ci_runner_namespaces_on_runner_id_and_namespace_id ON CREATE INDEX index_ci_runner_projects_on_project_id ON ci_runner_projects USING btree (project_id); -CREATE INDEX index_ci_runners_on_active ON ci_runners USING btree (active, id); +CREATE INDEX index_ci_runner_projects_on_runner_id ON ci_runner_projects USING btree (runner_id); CREATE INDEX index_ci_runners_on_contacted_at_and_id_desc ON ci_runners USING btree (contacted_at, id DESC); -CREATE INDEX index_ci_runners_on_contacted_at_and_id_where_inactive ON ci_runners USING btree (contacted_at DESC, id DESC) WHERE (active = false); - CREATE INDEX index_ci_runners_on_contacted_at_desc_and_id_desc ON ci_runners USING btree (contacted_at DESC, id DESC); CREATE INDEX index_ci_runners_on_created_at_and_id_desc ON ci_runners USING btree (created_at, id DESC); -CREATE INDEX index_ci_runners_on_created_at_and_id_where_inactive ON ci_runners USING btree (created_at DESC, id DESC) WHERE (active = false); - CREATE INDEX index_ci_runners_on_created_at_desc_and_id_desc ON ci_runners USING btree (created_at DESC, id DESC); CREATE INDEX index_ci_runners_on_description_trigram ON ci_runners USING gin (description gin_trgm_ops); @@ -28568,18 +28271,12 @@ CREATE INDEX index_ci_runners_on_token ON ci_runners USING btree (token); CREATE INDEX index_ci_runners_on_token_encrypted ON ci_runners USING btree (token_encrypted); -CREATE INDEX index_ci_runners_on_token_expires_at_and_id_desc ON ci_runners USING btree (token_expires_at, id DESC); - -CREATE INDEX index_ci_runners_on_token_expires_at_desc_and_id_desc ON ci_runners USING btree (token_expires_at DESC, id DESC); - CREATE UNIQUE INDEX index_ci_running_builds_on_build_id ON ci_running_builds USING btree (build_id); CREATE INDEX index_ci_running_builds_on_project_id ON ci_running_builds USING btree (project_id); CREATE INDEX index_ci_running_builds_on_runner_id ON ci_running_builds USING btree (runner_id); -CREATE INDEX index_ci_secure_files_on_project_id ON ci_secure_files USING btree (project_id); - CREATE INDEX index_ci_sources_pipelines_on_pipeline_id ON ci_sources_pipelines USING btree (pipeline_id); CREATE INDEX index_ci_sources_pipelines_on_project_id ON ci_sources_pipelines USING btree (project_id); @@ -28624,7 +28321,7 @@ CREATE INDEX index_ci_variables_on_key ON ci_variables USING btree (key); CREATE UNIQUE INDEX index_ci_variables_on_project_id_and_key_and_environment_scope ON ci_variables USING btree (project_id, key, environment_scope); -CREATE INDEX index_cluster_agent_tokens_on_agent_id_status_last_used_at ON cluster_agent_tokens USING btree (agent_id, status, last_used_at DESC NULLS LAST); +CREATE INDEX index_cluster_agent_tokens_on_agent_id_and_last_used_at ON cluster_agent_tokens USING btree (agent_id, last_used_at DESC NULLS LAST); CREATE INDEX index_cluster_agent_tokens_on_created_by_user_id ON cluster_agent_tokens USING btree (created_by_user_id); @@ -28680,6 +28377,8 @@ CREATE INDEX index_clusters_integration_elasticstack_enabled ON clusters_integra CREATE INDEX index_clusters_integration_prometheus_enabled ON clusters_integration_prometheus USING btree (enabled, created_at, cluster_id); +CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_id ON clusters_kubernetes_namespaces USING btree (cluster_id); + CREATE INDEX index_clusters_kubernetes_namespaces_on_cluster_project_id ON clusters_kubernetes_namespaces USING btree (cluster_project_id); CREATE INDEX index_clusters_kubernetes_namespaces_on_environment_id ON clusters_kubernetes_namespaces USING btree (environment_id); @@ -28702,10 +28401,6 @@ CREATE INDEX index_composer_cache_files_where_namespace_id_is_null ON packages_c CREATE INDEX index_container_expiration_policies_on_next_run_at_and_enabled ON container_expiration_policies USING btree (next_run_at, enabled); -CREATE INDEX index_container_repositories_on_greatest_done_at ON container_repositories USING btree (GREATEST(migration_pre_import_done_at, migration_import_done_at, migration_aborted_at)) WHERE (migration_state = ANY (ARRAY['import_done'::text, 'pre_import_done'::text, 'import_aborted'::text])); - -CREATE INDEX index_container_repositories_on_migration_state_import_done_at ON container_repositories USING btree (migration_state, migration_import_done_at); - CREATE INDEX index_container_repositories_on_project_id ON container_repositories USING btree (project_id); CREATE INDEX index_container_repositories_on_project_id_and_id ON container_repositories USING btree (project_id, id); @@ -28932,6 +28627,8 @@ CREATE UNIQUE INDEX index_epic_board_list_preferences_on_user_and_list ON boards CREATE UNIQUE INDEX index_epic_board_recent_visits_on_user_group_and_board ON boards_epic_board_recent_visits USING btree (user_id, group_id, epic_board_id); +CREATE INDEX index_epic_issues_on_epic_id ON epic_issues USING btree (epic_id); + CREATE INDEX index_epic_issues_on_epic_id_and_issue_id ON epic_issues USING btree (epic_id, issue_id); CREATE UNIQUE INDEX index_epic_issues_on_issue_id ON epic_issues USING btree (issue_id); @@ -28964,6 +28661,8 @@ CREATE INDEX index_epics_on_iid ON epics USING btree (iid); CREATE INDEX index_epics_on_last_edited_by_id ON epics USING btree (last_edited_by_id); +CREATE INDEX index_epics_on_lock_version ON epics USING btree (lock_version) WHERE (lock_version IS NULL); + CREATE INDEX index_epics_on_parent_id ON epics USING btree (parent_id); CREATE INDEX index_epics_on_start_date ON epics USING btree (start_date); @@ -28994,15 +28693,13 @@ CREATE INDEX index_et_errors_on_project_id_and_status_first_seen_at_id_desc ON e CREATE INDEX index_et_errors_on_project_id_and_status_last_seen_at_id_desc ON error_tracking_errors USING btree (project_id, status, last_seen_at DESC, id DESC); -CREATE INDEX index_events_author_id_project_id_action_target_type_created_at ON events USING btree (author_id, project_id, action, target_type, created_at); - CREATE INDEX index_events_on_action ON events USING btree (action); CREATE INDEX index_events_on_author_id_and_created_at ON events USING btree (author_id, created_at); CREATE INDEX index_events_on_author_id_and_created_at_merge_requests ON events USING btree (author_id, created_at) WHERE ((target_type)::text = 'MergeRequest'::text); -CREATE INDEX index_events_on_author_id_and_id ON events USING btree (author_id, id); +CREATE INDEX index_events_on_author_id_and_project_id ON events USING btree (author_id, project_id); CREATE INDEX index_events_on_created_at_and_id ON events USING btree (created_at, id) WHERE (created_at > '2021-08-27 00:00:00+00'::timestamp with time zone); @@ -29156,8 +28853,6 @@ CREATE INDEX index_grafana_integrations_on_enabled ON grafana_integrations USING CREATE INDEX index_grafana_integrations_on_project_id ON grafana_integrations USING btree (project_id); -CREATE INDEX index_group_crm_settings_on_group_id ON group_crm_settings USING btree (group_id); - CREATE UNIQUE INDEX index_group_custom_attributes_on_group_id_and_key ON group_custom_attributes USING btree (group_id, key); CREATE INDEX index_group_custom_attributes_on_key_and_value ON group_custom_attributes USING btree (key, value); @@ -29266,21 +28961,21 @@ CREATE INDEX index_insights_on_project_id ON insights USING btree (project_id); CREATE INDEX index_integrations_on_inherit_from_id ON integrations USING btree (inherit_from_id); -CREATE INDEX index_integrations_on_project_and_type_new_where_inherit_null ON integrations USING btree (project_id, type_new) WHERE (inherit_from_id IS NULL); +CREATE INDEX index_integrations_on_project_and_type_where_inherit_null ON integrations USING btree (project_id, type) WHERE (inherit_from_id IS NULL); -CREATE UNIQUE INDEX index_integrations_on_project_id_and_type_new_unique ON integrations USING btree (project_id, type_new); +CREATE UNIQUE INDEX index_integrations_on_project_id_and_type_unique ON integrations USING btree (project_id, type); CREATE INDEX index_integrations_on_template ON integrations USING btree (template); -CREATE INDEX index_integrations_on_type_new ON integrations USING btree (type_new); +CREATE INDEX index_integrations_on_type ON integrations USING btree (type); -CREATE INDEX index_integrations_on_type_new_and_instance_partial ON integrations USING btree (type_new, instance) WHERE (instance = true); +CREATE UNIQUE INDEX index_integrations_on_type_and_instance_partial ON integrations USING btree (type, instance) WHERE (instance = true); -CREATE INDEX index_integrations_on_type_new_and_template_partial ON integrations USING btree (type_new, template) WHERE (template = true); +CREATE UNIQUE INDEX index_integrations_on_type_and_template_partial ON integrations USING btree (type, template) WHERE (template = true); -CREATE INDEX index_integrations_on_type_new_id_when_active_and_has_project ON integrations USING btree (type_new, id) WHERE ((active = true) AND (project_id IS NOT NULL)); +CREATE INDEX index_integrations_on_type_id_when_active_and_project_id_not_nu ON integrations USING btree (type, id) WHERE ((active = true) AND (project_id IS NOT NULL)); -CREATE INDEX index_integrations_on_unique_group_id_and_type_new ON integrations USING btree (group_id, type_new); +CREATE UNIQUE INDEX index_integrations_on_unique_group_id_and_type ON integrations USING btree (group_id, type); CREATE INDEX index_internal_ids_on_namespace_id ON internal_ids USING btree (namespace_id); @@ -29318,6 +29013,8 @@ CREATE UNIQUE INDEX index_issue_links_on_source_id_and_target_id ON issue_links CREATE INDEX index_issue_links_on_target_id ON issue_links USING btree (target_id); +CREATE INDEX index_issue_metrics_first_mentioned_in_commit ON issue_metrics USING btree (issue_id) WHERE (date_part('year'::text, first_mentioned_in_commit_at) > (2019)::double precision); + CREATE INDEX index_issue_metrics_on_issue_id_and_timestamps ON issue_metrics USING btree (issue_id, first_mentioned_in_commit_at, first_associated_with_milestone_at, first_added_to_board_at); CREATE INDEX index_issue_on_project_id_state_id_and_blocking_issues_count ON issues USING btree (project_id, state_id, blocking_issues_count); @@ -29338,12 +29035,12 @@ CREATE INDEX index_issues_on_description_trigram ON issues USING gin (descriptio CREATE INDEX index_issues_on_duplicated_to_id ON issues USING btree (duplicated_to_id) WHERE (duplicated_to_id IS NOT NULL); -CREATE INDEX index_issues_on_id_and_weight ON issues USING btree (id, weight); - CREATE INDEX index_issues_on_incident_issue_type ON issues USING btree (issue_type) WHERE (issue_type = 1); CREATE INDEX index_issues_on_last_edited_by_id ON issues USING btree (last_edited_by_id); +CREATE INDEX index_issues_on_lock_version ON issues USING btree (lock_version) WHERE (lock_version IS NULL); + CREATE INDEX index_issues_on_milestone_id ON issues USING btree (milestone_id); CREATE INDEX index_issues_on_moved_to_id ON issues USING btree (moved_to_id) WHERE (moved_to_id IS NOT NULL); @@ -29486,8 +29183,6 @@ CREATE INDEX index_members_on_invite_email ON members USING btree (invite_email) CREATE UNIQUE INDEX index_members_on_invite_token ON members USING btree (invite_token); -CREATE INDEX index_members_on_member_namespace_id ON members USING btree (member_namespace_id); - CREATE INDEX index_members_on_requested_at ON members USING btree (requested_at); CREATE INDEX index_members_on_source_id_and_source_type ON members USING btree (source_id, source_type); @@ -29510,6 +29205,8 @@ CREATE UNIQUE INDEX index_merge_request_cleanup_schedules_on_merge_request_id ON CREATE INDEX index_merge_request_cleanup_schedules_on_status ON merge_request_cleanup_schedules USING btree (status); +CREATE INDEX index_merge_request_context_commits_on_merge_request_id ON merge_request_context_commits USING btree (merge_request_id); + CREATE UNIQUE INDEX index_merge_request_diff_commit_users_on_name_and_email ON merge_request_diff_commit_users USING btree (name, email); CREATE INDEX index_merge_request_diff_commits_on_sha ON merge_request_diff_commits USING btree (sha); @@ -29574,6 +29271,8 @@ CREATE INDEX index_merge_requests_on_head_pipeline_id ON merge_requests USING bt CREATE INDEX index_merge_requests_on_latest_merge_request_diff_id ON merge_requests USING btree (latest_merge_request_diff_id); +CREATE INDEX index_merge_requests_on_lock_version ON merge_requests USING btree (lock_version) WHERE (lock_version IS NULL); + CREATE INDEX index_merge_requests_on_merge_user_id ON merge_requests USING btree (merge_user_id) WHERE (merge_user_id IS NOT NULL); CREATE INDEX index_merge_requests_on_milestone_id ON merge_requests USING btree (milestone_id); @@ -29604,6 +29303,8 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_updated_at_and_id ON CREATE INDEX index_merge_requests_on_target_project_id_iid_jira_description ON merge_requests USING btree (target_project_id, iid) WHERE (description ~ '[A-Z][A-Z_0-9]+-\d+'::text); +CREATE INDEX index_merge_requests_on_title ON merge_requests USING btree (title); + CREATE INDEX index_merge_requests_on_title_trigram ON merge_requests USING gin (title gin_trgm_ops); CREATE INDEX index_merge_requests_on_tp_id_and_merge_commit_sha_and_id ON merge_requests USING btree (target_project_id, merge_commit_sha, id); @@ -29762,18 +29463,8 @@ CREATE INDEX index_on_identities_lower_extern_uid_and_provider ON identities USI CREATE UNIQUE INDEX index_on_instance_statistics_recorded_at_and_identifier ON analytics_usage_trends_measurements USING btree (identifier, recorded_at); -CREATE INDEX index_on_issues_closed_incidents_by_project_id_and_closed_at ON issues USING btree (project_id, closed_at) WHERE ((issue_type = 1) AND (state_id = 2)); - CREATE INDEX index_on_label_links_all_columns ON label_links USING btree (target_id, label_id, target_type); -CREATE INDEX index_on_merge_request_assignees_state ON merge_request_assignees USING btree (state) WHERE (state = 2); - -CREATE INDEX index_on_merge_request_assignees_updated_state_by_user_id ON merge_request_assignees USING btree (updated_state_by_user_id); - -CREATE INDEX index_on_merge_request_reviewers_state ON merge_request_reviewers USING btree (state) WHERE (state = 2); - -CREATE INDEX index_on_merge_request_reviewers_updated_state_by_user_id ON merge_request_reviewers USING btree (updated_state_by_user_id); - CREATE INDEX index_on_merge_requests_for_latest_diffs ON merge_requests USING btree (target_project_id) INCLUDE (id, latest_merge_request_diff_id); COMMENT ON INDEX index_on_merge_requests_for_latest_diffs IS 'Index used to efficiently obtain the oldest merge request for a commit SHA'; @@ -29790,8 +29481,6 @@ CREATE UNIQUE INDEX index_on_project_id_escalation_policy_name_unique ON inciden CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path)::text)); -CREATE INDEX index_on_projects_path ON projects USING btree (path); - CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text)); CREATE INDEX index_on_users_lower_email ON users USING btree (lower((email)::text)); @@ -29834,8 +29523,6 @@ CREATE UNIQUE INDEX index_ops_strategies_user_lists_on_strategy_id_and_user_list CREATE INDEX index_packages_build_infos_on_pipeline_id ON packages_build_infos USING btree (pipeline_id); -CREATE INDEX index_packages_build_infos_package_id_pipeline_id ON packages_build_infos USING btree (package_id, pipeline_id); - CREATE UNIQUE INDEX index_packages_composer_cache_namespace_and_sha ON packages_composer_cache_files USING btree (namespace_id, file_sha256); CREATE UNIQUE INDEX index_packages_composer_metadata_on_package_id_and_target_sha ON packages_composer_metadata USING btree (package_id, target_sha); @@ -29876,6 +29563,12 @@ CREATE INDEX index_packages_maven_metadata_on_path ON packages_maven_metadata US CREATE INDEX index_packages_nuget_dl_metadata_on_dependency_link_id ON packages_nuget_dependency_link_metadata USING btree (dependency_link_id); +CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_generic ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 7); + +CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_golang ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 8); + +CREATE UNIQUE INDEX index_packages_on_project_id_name_version_unique_when_helm ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 11); + CREATE INDEX index_packages_package_file_build_infos_on_package_file_id ON packages_package_file_build_infos USING btree (package_file_id); CREATE INDEX index_packages_package_file_build_infos_on_pipeline_id ON packages_package_file_build_infos USING btree (pipeline_id); @@ -29886,10 +29579,6 @@ CREATE INDEX index_packages_package_files_on_package_id_and_file_name ON package CREATE INDEX index_packages_package_files_on_package_id_id ON packages_package_files USING btree (package_id, id); -CREATE INDEX index_packages_package_files_on_package_id_status_and_id ON packages_package_files USING btree (package_id, status, id); - -CREATE INDEX index_packages_package_files_on_status ON packages_package_files USING btree (status); - CREATE INDEX index_packages_package_files_on_verification_state ON packages_package_files USING btree (verification_state); CREATE INDEX index_packages_packages_on_creator_id ON packages_packages USING btree (creator_id); @@ -29960,6 +29649,8 @@ CREATE UNIQUE INDEX index_partial_am_alerts_on_project_id_and_fingerprint ON ale CREATE INDEX index_partial_ci_builds_on_user_id_name_parser_features ON ci_builds USING btree (user_id, name) WHERE (((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('secret_detection'::character varying)::text]))); +CREATE UNIQUE INDEX index_partitioned_foreign_keys_unique_index ON partitioned_foreign_keys USING btree (to_table, from_table, from_column); + CREATE INDEX index_pat_on_user_id_and_expires_at ON personal_access_tokens USING btree (user_id, expires_at); CREATE INDEX index_path_locks_on_path ON path_locks USING btree (path); @@ -29998,8 +29689,6 @@ CREATE INDEX index_project_aliases_on_project_id ON project_aliases USING btree CREATE UNIQUE INDEX index_project_auto_devops_on_project_id ON project_auto_devops USING btree (project_id); -CREATE UNIQUE INDEX index_project_build_artifacts_size_refreshes_on_project_id ON project_build_artifacts_size_refreshes USING btree (project_id); - CREATE UNIQUE INDEX index_project_ci_cd_settings_on_project_id ON project_ci_cd_settings USING btree (project_id); CREATE UNIQUE INDEX index_project_ci_feature_usages_unique_columns ON project_ci_feature_usages USING btree (project_id, feature, default_branch); @@ -30100,6 +29789,12 @@ CREATE INDEX index_projects_aimed_for_deletion ON projects USING btree (marked_f CREATE INDEX index_projects_api_created_at_id_desc ON projects USING btree (created_at, id DESC); +CREATE INDEX index_projects_api_created_at_id_for_archived ON projects USING btree (created_at, id) WHERE ((archived = true) AND (pending_delete = false)); + +CREATE INDEX index_projects_api_created_at_id_for_archived_vis20 ON projects USING btree (created_at, id) WHERE ((archived = true) AND (visibility_level = 20) AND (pending_delete = false)); + +CREATE INDEX index_projects_api_created_at_id_for_vis10 ON projects USING btree (created_at, id) WHERE ((visibility_level = 10) AND (pending_delete = false)); + CREATE INDEX index_projects_api_last_activity_at_id_desc ON projects USING btree (last_activity_at, id DESC); CREATE INDEX index_projects_api_name_id_desc ON projects USING btree (name, id DESC); @@ -30118,8 +29813,6 @@ CREATE INDEX index_projects_api_vis20_path ON projects USING btree (path, id) WH CREATE INDEX index_projects_api_vis20_updated_at ON projects USING btree (updated_at, id) WHERE (visibility_level = 20); -CREATE INDEX index_projects_not_aimed_for_deletion ON projects USING btree (id) WHERE (marked_for_deletion_at IS NULL); - CREATE INDEX index_projects_on_created_at_and_id ON projects USING btree (created_at, id); CREATE INDEX index_projects_on_creator_id_and_created_at_and_id ON projects USING btree (creator_id, created_at, id); @@ -30224,10 +29917,6 @@ CREATE INDEX index_protected_branch_unprotect_access_levels_on_user_id ON protec CREATE INDEX index_protected_branches_on_project_id ON protected_branches USING btree (project_id); -CREATE INDEX index_protected_environment_approval_rules_on_group_id ON protected_environment_approval_rules USING btree (group_id); - -CREATE INDEX index_protected_environment_approval_rules_on_user_id ON protected_environment_approval_rules USING btree (user_id); - CREATE INDEX index_protected_environment_deploy_access ON protected_environment_deploy_access_levels USING btree (protected_environment_id); CREATE INDEX index_protected_environment_deploy_access_levels_on_group_id ON protected_environment_deploy_access_levels USING btree (group_id); @@ -30262,21 +29951,13 @@ CREATE UNIQUE INDEX index_redirect_routes_on_path_unique_text_pattern_ops ON red CREATE INDEX index_redirect_routes_on_source_type_and_source_id ON redirect_routes USING btree (source_type, source_id); -CREATE INDEX index_related_epic_links_on_source_id ON related_epic_links USING btree (source_id); - -CREATE UNIQUE INDEX index_related_epic_links_on_source_id_and_target_id ON related_epic_links USING btree (source_id, target_id); - -CREATE INDEX index_related_epic_links_on_target_id ON related_epic_links USING btree (target_id); - CREATE UNIQUE INDEX index_release_links_on_release_id_and_name ON release_links USING btree (release_id, name); CREATE UNIQUE INDEX index_release_links_on_release_id_and_url ON release_links USING btree (release_id, url); CREATE INDEX index_releases_on_author_id_id_created_at ON releases USING btree (author_id, id, created_at); -CREATE INDEX index_releases_on_project_id_and_released_at_and_id ON releases USING btree (project_id, released_at, id); - -CREATE UNIQUE INDEX index_releases_on_project_tag_unique ON releases USING btree (project_id, tag); +CREATE INDEX index_releases_on_project_id_and_tag ON releases USING btree (project_id, tag); CREATE INDEX index_releases_on_released_at ON releases USING btree (released_at); @@ -30366,8 +30047,6 @@ CREATE INDEX index_reviews_on_project_id ON reviews USING btree (project_id); CREATE INDEX index_route_on_name_trigram ON routes USING gin (name gin_trgm_ops); -CREATE UNIQUE INDEX index_routes_on_namespace_id ON routes USING btree (namespace_id); - CREATE UNIQUE INDEX index_routes_on_path ON routes USING btree (path); CREATE INDEX index_routes_on_path_text_pattern_ops ON routes USING btree (path varchar_pattern_ops); @@ -30380,8 +30059,6 @@ CREATE UNIQUE INDEX index_saml_group_links_on_group_id_and_saml_group_name ON sa CREATE INDEX index_saml_providers_on_group_id ON saml_providers USING btree (group_id); -CREATE UNIQUE INDEX index_saved_replies_on_name_text_pattern_ops ON saved_replies USING btree (user_id, name text_pattern_ops); - CREATE INDEX index_scim_identities_on_group_id ON scim_identities USING btree (group_id); CREATE UNIQUE INDEX index_scim_identities_on_lower_extern_uid_and_group_id ON scim_identities USING btree (lower((extern_uid)::text), group_id); @@ -30392,7 +30069,7 @@ CREATE UNIQUE INDEX index_scim_oauth_access_tokens_on_group_id_and_token_encrypt CREATE INDEX index_secure_ci_builds_on_user_id_name_created_at ON ci_builds USING btree (user_id, name, created_at) WHERE (((type)::text = 'Ci::Build'::text) AND ((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('license_scanning'::character varying)::text, ('sast'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('apifuzzer_fuzz'::character varying)::text, ('apifuzzer_fuzz_dnd'::character varying)::text, ('secret_detection'::character varying)::text]))); -CREATE INDEX index_security_ci_builds_on_name_and_id_parser_features ON ci_builds USING btree (name, id) WHERE (((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('license_scanning'::character varying)::text, ('apifuzzer_fuzz'::character varying)::text, ('apifuzzer_fuzz_dnd'::character varying)::text])) AND ((type)::text = 'Ci::Build'::text)); +CREATE INDEX index_security_ci_builds_on_name_and_id_parser_features ON ci_builds USING btree (name, id) WHERE (((name)::text = ANY (ARRAY[('container_scanning'::character varying)::text, ('dast'::character varying)::text, ('dependency_scanning'::character varying)::text, ('license_management'::character varying)::text, ('sast'::character varying)::text, ('secret_detection'::character varying)::text, ('coverage_fuzzing'::character varying)::text, ('license_scanning'::character varying)::text])) AND ((type)::text = 'Ci::Build'::text)); CREATE INDEX index_security_findings_on_confidence ON security_findings USING btree (confidence); @@ -30400,7 +30077,7 @@ CREATE INDEX index_security_findings_on_project_fingerprint ON security_findings CREATE INDEX index_security_findings_on_scan_id_and_deduplicated ON security_findings USING btree (scan_id, deduplicated); -CREATE INDEX index_security_findings_on_scan_id_and_id ON security_findings USING btree (scan_id, id); +CREATE UNIQUE INDEX index_security_findings_on_scan_id_and_position ON security_findings USING btree (scan_id, "position"); CREATE INDEX index_security_findings_on_scanner_id ON security_findings USING btree (scanner_id); @@ -30416,14 +30093,6 @@ CREATE INDEX index_security_scans_on_pipeline_id ON security_scans USING btree ( CREATE INDEX index_security_scans_on_project_id ON security_scans USING btree (project_id); -CREATE UNIQUE INDEX index_security_training_providers_on_unique_name ON security_training_providers USING btree (name); - -CREATE INDEX index_security_trainings_on_project_id ON security_trainings USING btree (project_id); - -CREATE INDEX index_security_trainings_on_provider_id ON security_trainings USING btree (provider_id); - -CREATE UNIQUE INDEX index_security_trainings_on_unique_project_id ON security_trainings USING btree (project_id) WHERE (is_primary IS TRUE); - CREATE INDEX index_self_managed_prometheus_alert_events_on_environment_id ON self_managed_prometheus_alert_events USING btree (environment_id); CREATE INDEX index_sent_notifications_on_noteable_type_noteable_id ON sent_notifications USING btree (noteable_id) WHERE ((noteable_type)::text = 'Issue'::text); @@ -30486,8 +30155,6 @@ CREATE INDEX index_snippets_on_id_and_created_at ON snippets USING btree (id, cr CREATE INDEX index_snippets_on_id_and_type ON snippets USING btree (id, type); -CREATE INDEX index_snippets_on_project_id_and_title ON snippets USING btree (project_id, title); - CREATE INDEX index_snippets_on_project_id_and_visibility_level ON snippets USING btree (project_id, visibility_level); CREATE INDEX index_snippets_on_title_trigram ON snippets USING gin (title gin_trgm_ops); @@ -30504,6 +30171,8 @@ CREATE INDEX index_software_licenses_on_spdx_identifier ON software_licenses USI CREATE UNIQUE INDEX index_software_licenses_on_unique_name ON software_licenses USING btree (name); +CREATE UNIQUE INDEX index_sop_configs_on_project_id ON security_orchestration_policy_configurations USING btree (project_id); + CREATE INDEX index_sop_configurations_project_id_policy_project_id ON security_orchestration_policy_configurations USING btree (security_policy_management_project_id, project_id); CREATE INDEX index_sop_schedules_on_sop_configuration_id ON security_orchestration_policy_rule_schedules USING btree (security_orchestration_policy_configuration_id); @@ -30520,8 +30189,12 @@ CREATE INDEX index_sprints_on_due_date ON sprints USING btree (due_date); CREATE INDEX index_sprints_on_group_id ON sprints USING btree (group_id); +CREATE UNIQUE INDEX index_sprints_on_iterations_cadence_id_and_title ON sprints USING btree (iterations_cadence_id, title); + CREATE UNIQUE INDEX index_sprints_on_project_id_and_iid ON sprints USING btree (project_id, iid); +CREATE UNIQUE INDEX index_sprints_on_project_id_and_title ON sprints USING btree (project_id, title) WHERE (project_id IS NOT NULL); + CREATE INDEX index_sprints_on_title ON sprints USING btree (title); CREATE INDEX index_sprints_on_title_trigram ON sprints USING gin (title gin_trgm_ops); @@ -30542,6 +30215,8 @@ CREATE UNIQUE INDEX index_subscriptions_on_subscribable_and_user_id_and_project_ CREATE INDEX index_successful_deployments_on_cluster_id_and_environment_id ON deployments USING btree (cluster_id, environment_id) WHERE (status = 2); +CREATE INDEX index_suggestions_on_note_id ON suggestions USING btree (note_id); + CREATE UNIQUE INDEX index_suggestions_on_note_id_and_relative_order ON suggestions USING btree (note_id, relative_order); CREATE UNIQUE INDEX index_system_note_metadata_on_description_version_id ON system_note_metadata USING btree (description_version_id) WHERE (description_version_id IS NOT NULL); @@ -30604,7 +30279,7 @@ CREATE INDEX index_todos_on_group_id ON todos USING btree (group_id); CREATE INDEX index_todos_on_note_id ON todos USING btree (note_id); -CREATE INDEX index_todos_on_project_id_and_id ON todos USING btree (project_id, id); +CREATE INDEX index_todos_on_project_id ON todos USING btree (project_id); CREATE INDEX index_todos_on_project_id_and_user_id_and_id ON todos USING btree (project_id, user_id, id); @@ -30620,10 +30295,6 @@ CREATE UNIQUE INDEX index_token_with_ivs_on_hashed_plaintext_token ON token_with CREATE UNIQUE INDEX index_token_with_ivs_on_hashed_token ON token_with_ivs USING btree (hashed_token); -CREATE INDEX index_topics_non_private_projects_count ON topics USING btree (non_private_projects_count DESC, id); - -CREATE INDEX index_topics_on_lower_name ON topics USING btree (lower(name)); - CREATE UNIQUE INDEX index_topics_on_name ON topics USING btree (name); CREATE INDEX index_topics_on_name_trigram ON topics USING gin (name gin_trgm_ops); @@ -30638,8 +30309,6 @@ CREATE INDEX index_u2f_registrations_on_user_id ON u2f_registrations USING btree CREATE UNIQUE INDEX index_uniq_im_issuable_escalation_statuses_on_issue_id ON incident_management_issuable_escalation_statuses USING btree (issue_id); -CREATE UNIQUE INDEX index_unique_ci_runner_projects_on_runner_id_and_project_id ON ci_runner_projects USING btree (runner_id, project_id); - CREATE UNIQUE INDEX index_unique_issue_metrics_issue_id ON issue_metrics USING btree (issue_id); CREATE UNIQUE INDEX index_unique_project_authorizations_on_project_id_user_id ON project_authorizations USING btree (project_id, user_id); @@ -30692,6 +30361,8 @@ CREATE UNIQUE INDEX index_user_details_on_phone ON user_details USING btree (pho COMMENT ON INDEX index_user_details_on_phone IS 'JiHu-specific index'; +CREATE INDEX index_user_details_on_provisioned_by_group_id ON user_details USING btree (provisioned_by_group_id); + CREATE UNIQUE INDEX index_user_details_on_user_id ON user_details USING btree (user_id); CREATE INDEX index_user_group_callouts_on_group_id ON user_group_callouts USING btree (group_id); @@ -30772,8 +30443,6 @@ CREATE INDEX index_users_star_projects_on_project_id ON users_star_projects USIN CREATE UNIQUE INDEX index_users_star_projects_on_user_id_and_project_id ON users_star_projects USING btree (user_id, project_id); -CREATE INDEX index_users_with_static_object_token ON users USING btree (id) WHERE ((static_object_token IS NOT NULL) AND (static_object_token_encrypted IS NULL)); - CREATE UNIQUE INDEX index_vuln_historical_statistics_on_project_id_and_date ON vulnerability_historical_statistics USING btree (project_id, date); CREATE INDEX index_vuln_reads_on_project_id_state_severity_and_vuln_id ON vulnerability_reads USING btree (project_id, state, severity, vulnerability_id DESC); @@ -30792,10 +30461,6 @@ CREATE INDEX index_vulnerabilities_on_last_edited_by_id ON vulnerabilities USING CREATE INDEX index_vulnerabilities_on_milestone_id ON vulnerabilities USING btree (milestone_id); -CREATE INDEX index_vulnerabilities_on_project_id_and_id ON vulnerabilities USING btree (project_id, id); - -CREATE INDEX index_vulnerabilities_on_project_id_and_id_active_cis ON vulnerabilities USING btree (project_id, id) WHERE ((report_type = 7) AND (state = ANY (ARRAY[1, 4]))); - CREATE INDEX index_vulnerabilities_on_project_id_and_state_and_severity ON vulnerabilities USING btree (project_id, state, severity); CREATE INDEX index_vulnerabilities_on_resolved_by_id ON vulnerabilities USING btree (resolved_by_id); @@ -30860,11 +30525,9 @@ CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occu CREATE INDEX index_vulnerability_occurrences_for_issue_links_migration ON vulnerability_occurrences USING btree (project_id, report_type, encode(project_fingerprint, 'hex'::text)); -CREATE INDEX index_vulnerability_occurrences_on_location_image ON vulnerability_occurrences USING gin (((location -> 'image'::text))) WHERE (report_type = ANY (ARRAY[2, 7])); - -CREATE INDEX index_vulnerability_occurrences_on_location_k8s_agent_id ON vulnerability_occurrences USING gin ((((location -> 'kubernetes_resource'::text) -> 'agent_id'::text))) WHERE (report_type = 7); +CREATE INDEX index_vulnerability_occurrences_on_location_cluster_id ON vulnerability_occurrences USING gin (((location -> 'cluster_id'::text))) WHERE (report_type = 7); -CREATE INDEX index_vulnerability_occurrences_on_location_k8s_cluster_id ON vulnerability_occurrences USING gin ((((location -> 'kubernetes_resource'::text) -> 'cluster_id'::text))) WHERE (report_type = 7); +CREATE INDEX index_vulnerability_occurrences_on_location_image ON vulnerability_occurrences USING gin (((location -> 'image'::text))) WHERE (report_type = ANY (ARRAY[2, 7])); CREATE INDEX index_vulnerability_occurrences_on_migrated_to_new_structure ON vulnerability_occurrences USING btree (migrated_to_new_structure, id); @@ -30874,12 +30537,12 @@ CREATE INDEX index_vulnerability_occurrences_on_project_fingerprint ON vulnerabi CREATE INDEX index_vulnerability_occurrences_on_scanner_id ON vulnerability_occurrences USING btree (scanner_id); +CREATE UNIQUE INDEX index_vulnerability_occurrences_on_unique_keys ON vulnerability_occurrences USING btree (project_id, primary_identifier_id, location_fingerprint, scanner_id); + CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid ON vulnerability_occurrences USING btree (uuid); CREATE INDEX index_vulnerability_occurrences_on_vulnerability_id ON vulnerability_occurrences USING btree (vulnerability_id); -CREATE INDEX index_vulnerability_reads_on_cluster_agent_id ON vulnerability_reads USING btree (cluster_agent_id) WHERE (report_type = 7); - CREATE INDEX index_vulnerability_reads_on_location_image ON vulnerability_reads USING btree (location_image) WHERE (report_type = ANY (ARRAY[2, 7])); CREATE INDEX index_vulnerability_reads_on_scanner_id ON vulnerability_reads USING btree (scanner_id); @@ -30988,10 +30651,6 @@ CREATE INDEX partial_index_deployments_for_legacy_successful_deployments ON depl CREATE INDEX partial_index_deployments_for_project_id_and_tag ON deployments USING btree (project_id) WHERE (tag IS TRUE); -CREATE UNIQUE INDEX partial_index_sop_configs_on_namespace_id ON security_orchestration_policy_configurations USING btree (namespace_id) WHERE (namespace_id IS NOT NULL); - -CREATE UNIQUE INDEX partial_index_sop_configs_on_project_id ON security_orchestration_policy_configurations USING btree (project_id) WHERE (project_id IS NOT NULL); - CREATE UNIQUE INDEX snippet_user_mentions_on_snippet_id_and_note_id_index ON snippet_user_mentions USING btree (snippet_id, note_id); CREATE UNIQUE INDEX snippet_user_mentions_on_snippet_id_index ON snippet_user_mentions USING btree (snippet_id) WHERE (note_id IS NULL); @@ -31000,19 +30659,9 @@ CREATE UNIQUE INDEX taggings_idx ON taggings USING btree (tag_id, taggable_id, t CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree (user_id, term_id); -CREATE INDEX tmp_gitlab_subscriptions_max_seats_used_migration ON gitlab_subscriptions USING btree (id) WHERE ((start_date >= '2021-08-02'::date) AND (start_date <= '2021-11-20'::date) AND (max_seats_used <> 0) AND (max_seats_used > seats_in_use) AND (max_seats_used > seats)); - -CREATE INDEX tmp_gitlab_subscriptions_max_seats_used_migration_2 ON gitlab_subscriptions USING btree (id) WHERE ((start_date < '2021-08-02'::date) AND (max_seats_used <> 0) AND (max_seats_used > seats_in_use) AND (max_seats_used > seats)); - -CREATE INDEX tmp_index_ci_job_artifacts_on_id_where_trace_and_expire_at ON ci_job_artifacts USING btree (id) WHERE ((file_type = 3) AND (expire_at = ANY (ARRAY['2021-04-22 00:00:00+00'::timestamp with time zone, '2021-05-22 00:00:00+00'::timestamp with time zone, '2021-06-22 00:00:00+00'::timestamp with time zone, '2022-01-22 00:00:00+00'::timestamp with time zone, '2022-02-22 00:00:00+00'::timestamp with time zone, '2022-03-22 00:00:00+00'::timestamp with time zone, '2022-04-22 00:00:00+00'::timestamp with time zone]))); - -CREATE INDEX tmp_index_container_repositories_on_id_migration_state ON container_repositories USING btree (id, migration_state); +CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint, primary_identifier_id, id); -CREATE INDEX tmp_index_for_namespace_id_migration_on_group_members ON members USING btree (id) WHERE ((member_namespace_id IS NULL) AND ((type)::text = 'GroupMember'::text)); - -CREATE INDEX tmp_index_for_namespace_id_migration_on_routes ON routes USING btree (id) WHERE ((namespace_id IS NULL) AND ((source_type)::text = 'Namespace'::text)); - -CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (state = 2); +CREATE INDEX tmp_index_ci_pipelines_lock_version ON ci_pipelines USING btree (id) WHERE (lock_version IS NULL); CREATE INDEX tmp_index_namespaces_empty_traversal_ids_with_child_namespaces ON namespaces USING btree (id) WHERE ((parent_id IS NOT NULL) AND (traversal_ids = '{}'::integer[])); @@ -31022,10 +30671,6 @@ CREATE UNIQUE INDEX tmp_index_on_tmp_project_id_on_namespaces ON namespaces USIN CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2); -CREATE INDEX tmp_index_projects_on_id_and_runners_token ON projects USING btree (id, runners_token) WHERE (runners_token IS NOT NULL); - -CREATE INDEX tmp_index_projects_on_id_and_runners_token_encrypted ON projects USING btree (id, runners_token_encrypted) WHERE (runners_token_encrypted IS NOT NULL); - CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name); CREATE UNIQUE INDEX uniq_pkgs_deb_grp_components_on_distribution_id_and_name ON packages_debian_group_components USING btree (distribution_id, name); @@ -31050,6 +30695,8 @@ CREATE UNIQUE INDEX vulnerability_feedback_unique_idx ON vulnerability_feedback CREATE UNIQUE INDEX vulnerability_occurrence_pipelines_on_unique_keys ON vulnerability_occurrence_pipelines USING btree (occurrence_id, pipeline_id); +CREATE INDEX vulnerability_occurrences_location_temp_index ON vulnerability_occurrences USING btree (id) WHERE (location IS NULL); + CREATE UNIQUE INDEX work_item_types_namespace_id_and_name_unique ON work_item_types USING btree (namespace_id, btrim(lower(name))); ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_created_at_author_id_idx; @@ -31258,8 +30905,6 @@ ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTA ALTER INDEX index_incident_management_pending_issue_escalations_on_issue_id ATTACH PARTITION gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202_issue_id_idx9; -ALTER INDEX index_loose_foreign_keys_deleted_records_for_partitioned_query ATTACH PARTITION gitlab_partitions_dynamic.index_01e3390fac; - ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_1554dc6f11; ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_719c6187cb; @@ -31268,8 +30913,6 @@ ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTIT ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_fdb8d5eeea; -ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1_pkey; - ALTER INDEX verification_codes_pkey ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_000000_pkey; ALTER INDEX index_verification_codes_on_phone_and_visitor_id_code ATTACH PARTITION gitlab_partitions_dynamic.verification_codes_000000_visitor_id_code_phone_created_at_idx; @@ -31490,6 +31133,8 @@ ALTER INDEX index_issue_stage_events_project_duration ATTACH PARTITION gitlab_pa ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_006f943df6; +ALTER INDEX index_loose_foreign_keys_deleted_records_for_partitioned_query ATTACH PARTITION gitlab_partitions_static.index_01e3390fac; + ALTER INDEX index_merge_request_stage_events_project_duration ATTACH PARTITION gitlab_partitions_static.index_02749b504c; ALTER INDEX index_merge_request_stage_events_group_duration ATTACH PARTITION gitlab_partitions_static.index_0287f5ba09; @@ -32382,6 +32027,8 @@ ALTER INDEX issue_search_data_pkey ATTACH PARTITION gitlab_partitions_static.iss ALTER INDEX index_issue_search_data_on_search_vector ATTACH PARTITION gitlab_partitions_static.issue_search_data_63_search_vector_idx; +ALTER INDEX loose_foreign_keys_deleted_records_pkey ATTACH PARTITION gitlab_partitions_static.loose_foreign_keys_deleted_records_1_pkey; + ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx10; ALTER INDEX index_product_analytics_events_experimental_project_and_time ATTACH PARTITION gitlab_partitions_static.product_analytics_events_expe_project_id_collector_tstamp_idx11; @@ -32642,14 +32289,10 @@ CREATE TRIGGER chat_names_loose_fk_trigger AFTER DELETE ON chat_names REFERENCIN CREATE TRIGGER ci_builds_loose_fk_trigger AFTER DELETE ON ci_builds REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); -CREATE TRIGGER ci_job_artifacts_loose_fk_trigger AFTER DELETE ON ci_job_artifacts REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); - CREATE TRIGGER ci_pipelines_loose_fk_trigger AFTER DELETE ON ci_pipelines REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); CREATE TRIGGER ci_runners_loose_fk_trigger AFTER DELETE ON ci_runners REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); -CREATE TRIGGER merge_requests_loose_fk_trigger AFTER DELETE ON merge_requests REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); - CREATE TRIGGER namespaces_loose_fk_trigger AFTER DELETE ON namespaces REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); CREATE TRIGGER projects_loose_fk_trigger AFTER DELETE ON projects REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); @@ -32670,8 +32313,6 @@ CREATE TRIGGER trigger_has_external_wiki_on_type_new_updated AFTER UPDATE OF typ CREATE TRIGGER trigger_has_external_wiki_on_update AFTER UPDATE ON integrations FOR EACH ROW WHEN (((new.type_new = 'Integrations::ExternalWiki'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_wiki(); -CREATE TRIGGER trigger_insert_or_update_vulnerability_reads_from_occurrences AFTER INSERT OR UPDATE ON vulnerability_occurrences FOR EACH ROW EXECUTE FUNCTION insert_or_update_vulnerability_reads(); - CREATE TRIGGER trigger_namespaces_parent_id_on_insert AFTER INSERT ON namespaces FOR EACH ROW EXECUTE FUNCTION insert_namespaces_sync_event(); CREATE TRIGGER trigger_namespaces_parent_id_on_update AFTER UPDATE ON namespaces FOR EACH ROW WHEN ((old.parent_id IS DISTINCT FROM new.parent_id)) EXECUTE FUNCTION insert_namespaces_sync_event(); @@ -32680,15 +32321,7 @@ CREATE TRIGGER trigger_projects_parent_id_on_insert AFTER INSERT ON projects FOR CREATE TRIGGER trigger_projects_parent_id_on_update AFTER UPDATE ON projects FOR EACH ROW WHEN ((old.namespace_id IS DISTINCT FROM new.namespace_id)) EXECUTE FUNCTION insert_projects_sync_event(); -CREATE TRIGGER trigger_update_has_issues_on_vulnerability_issue_links_delete AFTER DELETE ON vulnerability_issue_links FOR EACH ROW EXECUTE FUNCTION unset_has_issues_on_vulnerability_reads(); - -CREATE TRIGGER trigger_update_has_issues_on_vulnerability_issue_links_update AFTER INSERT ON vulnerability_issue_links FOR EACH ROW EXECUTE FUNCTION set_has_issues_on_vulnerability_reads(); - -CREATE TRIGGER trigger_update_location_on_vulnerability_occurrences_update AFTER UPDATE ON vulnerability_occurrences FOR EACH ROW WHEN (((new.report_type = ANY (ARRAY[2, 7])) AND (((old.location ->> 'image'::text) IS DISTINCT FROM (new.location ->> 'image'::text)) OR (((old.location -> 'kubernetes_resource'::text) ->> 'agent_id'::text) IS DISTINCT FROM ((new.location -> 'kubernetes_resource'::text) ->> 'agent_id'::text))))) EXECUTE FUNCTION update_location_from_vulnerability_occurrences(); - -CREATE TRIGGER trigger_update_vulnerability_reads_on_vulnerability_update AFTER UPDATE ON vulnerabilities FOR EACH ROW WHEN (((old.severity IS DISTINCT FROM new.severity) OR (old.state IS DISTINCT FROM new.state) OR (old.resolved_on_default_branch IS DISTINCT FROM new.resolved_on_default_branch))) EXECUTE FUNCTION update_vulnerability_reads_from_vulnerability(); - -CREATE TRIGGER users_loose_fk_trigger AFTER DELETE ON users REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); +CREATE TRIGGER trigger_type_new_on_insert AFTER INSERT ON integrations FOR EACH ROW EXECUTE FUNCTION integrations_set_type_new(); ALTER TABLE ONLY gitlab_partitions_dynamic.incident_management_pending_issue_escalations_202211 ADD CONSTRAINT fk_rails_0470889ee5 FOREIGN KEY (rule_id) REFERENCES incident_management_escalation_rules(id) ON DELETE CASCADE; @@ -32816,6 +32449,9 @@ ALTER TABLE ONLY agent_project_authorizations ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_1d37cddf91 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE SET NULL; +ALTER TABLE ONLY ci_sources_pipelines + ADD CONSTRAINT fk_1e53c97c0a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY epics ADD CONSTRAINT fk_1fbed67632 FOREIGN KEY (start_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -32834,6 +32470,9 @@ ALTER TABLE ONLY users_star_projects ALTER TABLE ONLY alert_management_alerts ADD CONSTRAINT fk_2358b75436 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE SET NULL; +ALTER TABLE ONLY ci_stages + ADD CONSTRAINT fk_2360681d1d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY import_failures ADD CONSTRAINT fk_24b824da43 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -32867,6 +32506,9 @@ ALTER TABLE ONLY agent_group_authorizations ALTER TABLE ONLY deployment_approvals ADD CONSTRAINT fk_2d060dfc73 FOREIGN KEY (deployment_id) REFERENCES deployments(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_freeze_periods + ADD CONSTRAINT fk_2e02bbd1a6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY notes ADD CONSTRAINT fk_2e82291620 FOREIGN KEY (review_id) REFERENCES reviews(id) ON DELETE SET NULL; @@ -32888,6 +32530,9 @@ ALTER TABLE ONLY approvals ALTER TABLE ONLY namespaces ADD CONSTRAINT fk_319256d87a FOREIGN KEY (file_template_project_id) REFERENCES projects(id) ON DELETE SET NULL; +ALTER TABLE ONLY ci_group_variables + ADD CONSTRAINT fk_33ae4d58d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY namespaces ADD CONSTRAINT fk_3448c97865 FOREIGN KEY (push_rule_id) REFERENCES push_rules(id) ON DELETE SET NULL; @@ -32927,9 +32572,6 @@ ALTER TABLE ONLY epics ALTER TABLE ONLY ci_pipelines ADD CONSTRAINT fk_3d34ab2e06 FOREIGN KEY (pipeline_schedule_id) REFERENCES ci_pipeline_schedules(id) ON DELETE SET NULL; -ALTER TABLE ONLY merge_request_reviewers - ADD CONSTRAINT fk_3d674b9f23 FOREIGN KEY (updated_state_by_user_id) REFERENCES users(id) ON DELETE SET NULL; - ALTER TABLE ONLY ci_pipeline_schedule_variables ADD CONSTRAINT fk_41c35fda51 FOREIGN KEY (pipeline_schedule_id) REFERENCES ci_pipeline_schedules(id) ON DELETE CASCADE; @@ -32939,6 +32581,9 @@ ALTER TABLE ONLY geo_event_log ALTER TABLE ONLY incident_management_timeline_events ADD CONSTRAINT fk_4432fc4d78 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_runner_projects + ADD CONSTRAINT fk_4478a6f1e4 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY todos ADD CONSTRAINT fk_45054f9c45 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -32957,6 +32602,9 @@ ALTER TABLE ONLY alert_management_alerts ALTER TABLE ONLY path_locks ADD CONSTRAINT fk_5265c98f24 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY dast_site_profiles_pipelines + ADD CONSTRAINT fk_53849b0ad5 FOREIGN KEY (ci_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + ALTER TABLE ONLY terraform_states ADD CONSTRAINT fk_558901b030 FOREIGN KEY (locked_by_user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -33005,8 +32653,8 @@ ALTER TABLE ONLY merge_requests ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_6661f4f0e8 FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE SET NULL; -ALTER TABLE ONLY routes - ADD CONSTRAINT fk_679ff8213d FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL; +ALTER TABLE ONLY project_pages_metadata + ADD CONSTRAINT fk_69366a119e FOREIGN KEY (artifacts_archive_id) REFERENCES ci_job_artifacts(id) ON DELETE SET NULL; ALTER TABLE ONLY application_settings ADD CONSTRAINT fk_693b8795e4 FOREIGN KEY (push_rule_id) REFERENCES push_rules(id) ON DELETE SET NULL; @@ -33033,7 +32681,7 @@ ALTER TABLE ONLY protected_branch_push_access_levels ADD CONSTRAINT fk_7111b68cdb FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY projects - ADD CONSTRAINT fk_71625606ac FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL; + ADD CONSTRAINT fk_71625606ac FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY integrations ADD CONSTRAINT fk_71cce407f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33053,6 +32701,9 @@ ALTER TABLE ONLY vulnerabilities ALTER TABLE ONLY oauth_openid_requests ADD CONSTRAINT fk_77114b3b09 FOREIGN KEY (access_grant_id) REFERENCES oauth_access_grants(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_resource_groups + ADD CONSTRAINT fk_774722d144 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY users ADD CONSTRAINT fk_789cd90b35 FOREIGN KEY (accepted_term_id) REFERENCES application_setting_terms(id) ON DELETE CASCADE; @@ -33065,6 +32716,9 @@ ALTER TABLE ONLY analytics_devops_adoption_snapshots ALTER TABLE ONLY lists ADD CONSTRAINT fk_7a5553d60f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_unit_tests + ADD CONSTRAINT fk_7a8fabf0a8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY protected_branches ADD CONSTRAINT fk_7a9c6d93e7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33107,6 +32761,9 @@ ALTER TABLE ONLY merge_request_diffs ALTER TABLE ONLY requirements ADD CONSTRAINT fk_85044baef0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_pipelines + ADD CONSTRAINT fk_86635dbd80 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_86c84214ec FOREIGN KEY (repository_renamed_event_id) REFERENCES geo_repository_renamed_events(id) ON DELETE CASCADE; @@ -33140,6 +32797,9 @@ ALTER TABLE ONLY releases ALTER TABLE ONLY protected_tags ADD CONSTRAINT fk_8e4af87648 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_pipeline_schedules + ADD CONSTRAINT fk_8ead60fcc4 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY todos ADD CONSTRAINT fk_91d1f47b13 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; @@ -33194,6 +32854,9 @@ ALTER TABLE ONLY protected_environments ALTER TABLE ONLY alert_management_alerts ADD CONSTRAINT fk_9e49e5c2b7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_pipeline_schedules + ADD CONSTRAINT fk_9ea99f58d2 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY protected_branch_push_access_levels ADD CONSTRAINT fk_9ffc86a3d9 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; @@ -33206,9 +32869,15 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_a2141b1522 FOREIGN KEY (auto_canceled_by_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; +ALTER TABLE ONLY ci_pipelines + ADD CONSTRAINT fk_a23be95014 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + ALTER TABLE ONLY todos ADD CONSTRAINT fk_a27c483435 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY dast_site_profiles_builds + ADD CONSTRAINT fk_a325505e99 FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + ALTER TABLE ONLY jira_connect_subscriptions ADD CONSTRAINT fk_a3c10bcf7d FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -33218,12 +32887,12 @@ ALTER TABLE ONLY bulk_import_entities ALTER TABLE ONLY users ADD CONSTRAINT fk_a4b8fefe3e FOREIGN KEY (managing_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; -ALTER TABLE ONLY security_orchestration_policy_configurations - ADD CONSTRAINT fk_a50430b375 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY lfs_objects_projects ADD CONSTRAINT fk_a56e02279c FOREIGN KEY (lfs_object_id) REFERENCES lfs_objects(id) ON DELETE RESTRICT NOT VALID; +ALTER TABLE ONLY dast_profiles_pipelines + ADD CONSTRAINT fk_a60cad829d FOREIGN KEY (ci_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_a6963e8447 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33233,9 +32902,6 @@ ALTER TABLE ONLY epics ALTER TABLE ONLY dast_profiles ADD CONSTRAINT fk_aa76ef30e9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY members - ADD CONSTRAINT fk_aa82dcc1c6 FOREIGN KEY (member_namespace_id) REFERENCES namespaces(id) ON DELETE SET NULL; - ALTER TABLE ONLY alert_management_alerts ADD CONSTRAINT fk_aad61aedca FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE SET NULL; @@ -33248,18 +32914,21 @@ ALTER TABLE ONLY boards ALTER TABLE ONLY member_tasks ADD CONSTRAINT fk_ab636303dd FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_sources_pipelines + ADD CONSTRAINT fk_acd9737679 FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_ad525e1f87 FOREIGN KEY (merge_user_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY ci_variables + ADD CONSTRAINT fk_ada5eb64b3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_request_metrics ADD CONSTRAINT fk_ae440388cc FOREIGN KEY (latest_closed_by_id) REFERENCES users(id) ON DELETE SET NULL; ALTER TABLE ONLY dast_profile_schedules ADD CONSTRAINT fk_aef03d62e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; -ALTER TABLE ONLY merge_request_assignees - ADD CONSTRAINT fk_af036e3261 FOREIGN KEY (updated_state_by_user_id) REFERENCES users(id) ON DELETE SET NULL; - ALTER TABLE ONLY analytics_cycle_analytics_group_stages ADD CONSTRAINT fk_analytics_cycle_analytics_group_stages_group_value_stream_id FOREIGN KEY (group_value_stream_id) REFERENCES analytics_cycle_analytics_group_value_streams(id) ON DELETE CASCADE; @@ -33323,6 +32992,9 @@ ALTER TABLE ONLY ci_sources_pipelines ALTER TABLE ONLY packages_maven_metadata ADD CONSTRAINT fk_be88aed360 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_builds + ADD CONSTRAINT fk_befce0568a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY design_management_versions ADD CONSTRAINT fk_c1440b4896 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -33455,8 +33127,11 @@ ALTER TABLE ONLY ci_builds_metadata ALTER TABLE ONLY gitlab_subscriptions ADD CONSTRAINT fk_e2595d00a1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY ci_builds - ADD CONSTRAINT fk_e4ef9c2f27 FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE SET NULL NOT VALID; +ALTER TABLE ONLY ci_triggers + ADD CONSTRAINT fk_e3e63f966e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY dast_scanner_profiles_builds + ADD CONSTRAINT fk_e4c49200f8 FOREIGN KEY (ci_build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_e719a85f8a FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -33479,6 +33154,12 @@ ALTER TABLE ONLY sprints ALTER TABLE ONLY application_settings ADD CONSTRAINT fk_e8a145f3a7 FOREIGN KEY (instance_administrators_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; +ALTER TABLE ONLY vulnerability_statistics + ADD CONSTRAINT fk_e8b13c928f FOREIGN KEY (latest_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_triggers + ADD CONSTRAINT fk_e8e10d1964 FOREIGN KEY (owner_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY integrations ADD CONSTRAINT fk_e8fe908a34 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -33551,6 +33232,15 @@ ALTER TABLE ONLY system_note_metadata ALTER TABLE ONLY vulnerability_remediations ADD CONSTRAINT fk_fc61a535a0 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_daily_build_group_report_results + ADD CONSTRAINT fk_fd1858fefd FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_fd82eae0b9 FOREIGN KEY (head_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_pending_builds + ADD CONSTRAINT fk_fdc0137e4a FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_import_data ADD CONSTRAINT fk_ffb9ee3a10 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33605,6 +33295,15 @@ ALTER TABLE ONLY ip_restrictions ALTER TABLE ONLY terraform_state_versions ADD CONSTRAINT fk_rails_04f176e239 FOREIGN KEY (terraform_state_id) REFERENCES terraform_states(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_build_report_results + ADD CONSTRAINT fk_rails_056d298d48 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_daily_build_group_report_results + ADD CONSTRAINT fk_rails_0667f7608c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_subscriptions_projects + ADD CONSTRAINT fk_rails_0818751483 FOREIGN KEY (downstream_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY user_interacted_projects ADD CONSTRAINT fk_rails_0894651f08 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -33623,9 +33322,6 @@ ALTER TABLE ONLY packages_debian_group_distributions ALTER TABLE ONLY packages_conan_file_metadata ADD CONSTRAINT fk_rails_0afabd9328 FOREIGN KEY (package_file_id) REFERENCES packages_package_files(id) ON DELETE CASCADE; -ALTER TABLE ONLY related_epic_links - ADD CONSTRAINT fk_rails_0b72027748 FOREIGN KEY (target_id) REFERENCES epics(id) ON DELETE CASCADE; - ALTER TABLE ONLY ci_build_pending_states ADD CONSTRAINT fk_rails_0bbbfeaf9d FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; @@ -33692,9 +33388,6 @@ ALTER TABLE ONLY bulk_imports ALTER TABLE ONLY diff_note_positions ADD CONSTRAINT fk_rails_13c7212859 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; -ALTER TABLE ONLY analytics_cycle_analytics_aggregations - ADD CONSTRAINT fk_rails_13c8374c7a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY users_security_dashboard_projects ADD CONSTRAINT fk_rails_150cd5682c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33776,6 +33469,9 @@ ALTER TABLE ONLY boards_epic_lists ALTER TABLE ONLY approval_merge_request_rules_groups ADD CONSTRAINT fk_rails_2020a7124a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_feedback + ADD CONSTRAINT fk_rails_20976e6fd9 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + ALTER TABLE ONLY work_item_types ADD CONSTRAINT fk_rails_20f694a960 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -33794,6 +33490,9 @@ ALTER TABLE ONLY service_desk_settings ALTER TABLE ONLY saml_group_links ADD CONSTRAINT fk_rails_22e312c530 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_responses + ADD CONSTRAINT fk_rails_2390a09723 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_profiles ADD CONSTRAINT fk_rails_23cae5abe1 FOREIGN KEY (dast_scanner_profile_id) REFERENCES dast_scanner_profiles(id) ON DELETE CASCADE; @@ -33893,8 +33592,8 @@ ALTER TABLE ONLY container_repositories ALTER TABLE ONLY clusters_applications_jupyter ADD CONSTRAINT fk_rails_331f0aff78 FOREIGN KEY (oauth_application_id) REFERENCES oauth_applications(id) ON DELETE SET NULL; -ALTER TABLE ONLY alert_management_alert_metric_images - ADD CONSTRAINT fk_rails_338e55b408 FOREIGN KEY (alert_id) REFERENCES alert_management_alerts(id) ON DELETE CASCADE; +ALTER TABLE ONLY merge_request_metrics + ADD CONSTRAINT fk_rails_33ae169d48 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; ALTER TABLE ONLY suggestions ADD CONSTRAINT fk_rails_33b03a535c FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; @@ -33905,12 +33604,12 @@ ALTER TABLE ONLY requirements ALTER TABLE ONLY metrics_dashboard_annotations ADD CONSTRAINT fk_rails_345ab51043 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; -ALTER TABLE ONLY group_features - ADD CONSTRAINT fk_rails_356514082b FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY wiki_page_slugs ADD CONSTRAINT fk_rails_358b46be14 FOREIGN KEY (wiki_page_meta_id) REFERENCES wiki_page_meta(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT fk_rails_35f7f506ce FOREIGN KEY (added_by_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY board_labels ADD CONSTRAINT fk_rails_362b0600a3 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; @@ -33986,6 +33685,9 @@ ALTER TABLE ONLY geo_node_namespace_links ALTER TABLE ONLY epic_issues ADD CONSTRAINT fk_rails_4209981af6 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_refs + ADD CONSTRAINT fk_rails_4249db8cc3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_resources ADD CONSTRAINT fk_rails_430336af2d FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE CASCADE; @@ -34031,9 +33733,18 @@ ALTER TABLE ONLY vulnerability_feedback ALTER TABLE ONLY user_custom_attributes ADD CONSTRAINT fk_rails_47b91868a8 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_pending_builds + ADD CONSTRAINT fk_rails_480669c3b3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY upcoming_reconciliations ADD CONSTRAINT fk_rails_497b4938ac FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_pipeline_artifacts + ADD CONSTRAINT fk_rails_4a70390ca6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT fk_rails_4b2ee3290b FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY group_deletion_schedules ADD CONSTRAINT fk_rails_4b8c694a6c FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -34058,9 +33769,6 @@ ALTER TABLE ONLY scim_identities ALTER TABLE ONLY snippet_user_mentions ADD CONSTRAINT fk_rails_4d3f96b2cb FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; -ALTER TABLE ONLY protected_environment_approval_rules - ADD CONSTRAINT fk_rails_4e554f96f5 FOREIGN KEY (protected_environment_id) REFERENCES protected_environments(id) ON DELETE CASCADE; - ALTER TABLE ONLY deployment_clusters ADD CONSTRAINT fk_rails_4e6243e120 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -34070,6 +33778,9 @@ ALTER TABLE ONLY geo_repository_renamed_events ALTER TABLE ONLY aws_roles ADD CONSTRAINT fk_rails_4ed56f4720 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY security_scans + ADD CONSTRAINT fk_rails_4ef1e6b4c6 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + ALTER TABLE ONLY packages_debian_publications ADD CONSTRAINT fk_rails_4fc8ebd03e FOREIGN KEY (distribution_id) REFERENCES packages_debian_project_distributions(id) ON DELETE CASCADE; @@ -34082,6 +33793,9 @@ ALTER TABLE ONLY resource_iteration_events ALTER TABLE ONLY status_page_settings ADD CONSTRAINT fk_rails_506e5ba391 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_project_monthly_usages + ADD CONSTRAINT fk_rails_508bcd4aa6 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_repository_storage_moves ADD CONSTRAINT fk_rails_5106dbd44a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -34193,6 +33907,9 @@ ALTER TABLE ONLY evidences ALTER TABLE ONLY jira_imports ADD CONSTRAINT fk_rails_63cbe52ada FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_occurrence_pipelines + ADD CONSTRAINT fk_rails_6421e35d7d FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + ALTER TABLE ONLY group_deploy_tokens ADD CONSTRAINT fk_rails_6477b01f6b FOREIGN KEY (deploy_token_id) REFERENCES deploy_tokens(id) ON DELETE CASCADE; @@ -34202,6 +33919,9 @@ ALTER TABLE ONLY reviews ALTER TABLE ONLY operations_feature_flags ADD CONSTRAINT fk_rails_648e241be7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_sources_projects + ADD CONSTRAINT fk_rails_64b6855cbc FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY board_group_recent_visits ADD CONSTRAINT fk_rails_64bfc19bc5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -34238,9 +33958,15 @@ ALTER TABLE ONLY vulnerability_findings_remediations ALTER TABLE ONLY resource_iteration_events ADD CONSTRAINT fk_rails_6830c13ac1 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_headers + ADD CONSTRAINT fk_rails_683b8e000c FOREIGN KEY (vulnerability_finding_evidence_response_id) REFERENCES vulnerability_finding_evidence_responses(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_hashed_storage_migrated_events ADD CONSTRAINT fk_rails_687ed7d7c5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT fk_rails_6904b38465 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY plan_limits ADD CONSTRAINT fk_rails_69f8b6184f FOREIGN KEY (plan_id) REFERENCES plans(id) ON DELETE CASCADE; @@ -34256,6 +33982,9 @@ ALTER TABLE ONLY prometheus_alerts ALTER TABLE ONLY term_agreements ADD CONSTRAINT fk_rails_6ea6520e4a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_assets + ADD CONSTRAINT fk_rails_6edbbecba4 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_compliance_framework_settings ADD CONSTRAINT fk_rails_6f5294f16c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -34289,6 +34018,9 @@ ALTER TABLE ONLY dast_scanner_profiles ALTER TABLE ONLY vulnerability_historical_statistics ADD CONSTRAINT fk_rails_72b73ed023 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_requests + ADD CONSTRAINT fk_rails_72c87c8eb6 FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE; + ALTER TABLE ONLY slack_integrations ADD CONSTRAINT fk_rails_73db19721a FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE; @@ -34304,9 +34036,6 @@ ALTER TABLE ONLY dast_site_profiles ALTER TABLE ONLY merge_request_context_commit_diff_files ADD CONSTRAINT fk_rails_74a00a1787 FOREIGN KEY (merge_request_context_commit_id) REFERENCES merge_request_context_commits(id) ON DELETE CASCADE; -ALTER TABLE ONLY group_crm_settings - ADD CONSTRAINT fk_rails_74fdf2f13d FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY clusters_applications_ingress ADD CONSTRAINT fk_rails_753a7b41c1 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -34337,12 +34066,18 @@ ALTER TABLE ONLY boards_epic_user_preferences ALTER TABLE ONLY packages_debian_group_distribution_keys ADD CONSTRAINT fk_rails_779438f163 FOREIGN KEY (distribution_id) REFERENCES packages_debian_group_distributions(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_subscriptions_projects + ADD CONSTRAINT fk_rails_7871f9a97b FOREIGN KEY (upstream_project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY terraform_states ADD CONSTRAINT fk_rails_78f54ca485 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY analytics_cycle_analytics_project_stages ADD CONSTRAINT fk_rails_796a7dbc9c FOREIGN KEY (project_value_stream_id) REFERENCES analytics_cycle_analytics_project_value_streams(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_supporting_messages + ADD CONSTRAINT fk_rails_79e77f6c5c FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE; + ALTER TABLE ONLY software_license_policies ADD CONSTRAINT fk_rails_7a7a2a92de FOREIGN KEY (software_license_id) REFERENCES software_licenses(id) ON DELETE CASCADE; @@ -34376,9 +34111,6 @@ ALTER TABLE ONLY required_code_owners_sections ALTER TABLE ONLY dast_site_profiles ADD CONSTRAINT fk_rails_83e309d69e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY security_trainings - ADD CONSTRAINT fk_rails_84c7951d72 FOREIGN KEY (provider_id) REFERENCES security_training_providers(id) ON DELETE CASCADE; - ALTER TABLE ONLY zentao_tracker_data ADD CONSTRAINT fk_rails_84efda7be0 FOREIGN KEY (integration_id) REFERENCES integrations(id) ON DELETE CASCADE; @@ -34475,12 +34207,12 @@ ALTER TABLE ONLY project_error_tracking_settings ALTER TABLE ONLY list_user_preferences ADD CONSTRAINT fk_rails_916d72cafd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_responses + ADD CONSTRAINT fk_rails_929041a499 FOREIGN KEY (vulnerability_finding_evidence_supporting_message_id) REFERENCES vulnerability_finding_evidence_supporting_messages(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_request_cleanup_schedules ADD CONSTRAINT fk_rails_92dd0e705c FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; -ALTER TABLE ONLY project_build_artifacts_size_refreshes - ADD CONSTRAINT fk_rails_936db5fc44 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; - ALTER TABLE ONLY board_labels ADD CONSTRAINT fk_rails_9374a16edd FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; @@ -34511,6 +34243,9 @@ ALTER TABLE ONLY group_repository_storage_moves ALTER TABLE ONLY resource_label_events ADD CONSTRAINT fk_rails_9851a00031 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_job_artifacts + ADD CONSTRAINT fk_rails_9862d392f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY board_project_recent_visits ADD CONSTRAINT fk_rails_98f8843922 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -34616,9 +34351,6 @@ ALTER TABLE ONLY resource_milestone_events ALTER TABLE ONLY term_agreements ADD CONSTRAINT fk_rails_a88721bcdf FOREIGN KEY (term_id) REFERENCES application_setting_terms(id); -ALTER TABLE ONLY saved_replies - ADD CONSTRAINT fk_rails_a8bf5bf111 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - ALTER TABLE ONLY ci_pipeline_artifacts ADD CONSTRAINT fk_rails_a9e811a466 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; @@ -34724,6 +34456,9 @@ ALTER TABLE ONLY projects_sync_events ALTER TABLE ONLY approval_merge_request_rules_users ADD CONSTRAINT fk_rails_bc8972fa55 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY external_pull_requests + ADD CONSTRAINT fk_rails_bcae9b5c7b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY elasticsearch_indexed_projects ADD CONSTRAINT fk_rails_bd13bbdc3d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -34775,9 +34510,6 @@ ALTER TABLE ONLY group_deploy_keys_groups ALTER TABLE ONLY merge_request_user_mentions ADD CONSTRAINT fk_rails_c440b9ea31 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; -ALTER TABLE ONLY related_epic_links - ADD CONSTRAINT fk_rails_c464534def FOREIGN KEY (source_id) REFERENCES epics(id) ON DELETE CASCADE; - ALTER TABLE ONLY boards_epic_board_recent_visits ADD CONSTRAINT fk_rails_c4dcba4a3e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -34835,12 +34567,18 @@ ALTER TABLE ONLY operations_strategies_user_lists ALTER TABLE ONLY issue_tracker_data ADD CONSTRAINT fk_rails_ccc0840427 FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_headers + ADD CONSTRAINT fk_rails_ce7f121a03 FOREIGN KEY (vulnerability_finding_evidence_request_id) REFERENCES vulnerability_finding_evidence_requests(id) ON DELETE CASCADE; + ALTER TABLE ONLY resource_milestone_events ADD CONSTRAINT fk_rails_cedf8cce4d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; ALTER TABLE ONLY resource_iteration_events ADD CONSTRAINT fk_rails_cee126f66c FOREIGN KEY (iteration_id) REFERENCES sprints(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_requests + ADD CONSTRAINT fk_rails_cf0f278cb0 FOREIGN KEY (vulnerability_finding_evidence_supporting_message_id) REFERENCES vulnerability_finding_evidence_supporting_messages(id) ON DELETE CASCADE; + ALTER TABLE ONLY upload_states ADD CONSTRAINT fk_rails_d00f153613 FOREIGN KEY (upload_id) REFERENCES uploads(id) ON DELETE CASCADE; @@ -34895,6 +34633,9 @@ ALTER TABLE ONLY issues_prometheus_alert_events ALTER TABLE ONLY board_user_preferences ADD CONSTRAINT fk_rails_dbebdaa8fe FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT fk_rails_dc1d0801e8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_occurrence_pipelines ADD CONSTRAINT fk_rails_dc3ae04693 FOREIGN KEY (occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; @@ -34922,6 +34663,9 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_stages ALTER TABLE ONLY bulk_import_export_uploads ADD CONSTRAINT fk_rails_dfbfb45eca FOREIGN KEY (export_id) REFERENCES bulk_import_exports(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_minutes_additional_packs + ADD CONSTRAINT fk_rails_e0e0c4e4b1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY label_priorities ADD CONSTRAINT fk_rails_e161058b0f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; @@ -34961,6 +34705,9 @@ ALTER TABLE ONLY approval_merge_request_rule_sources ALTER TABLE ONLY prometheus_alerts ADD CONSTRAINT fk_rails_e6351447ec FOREIGN KEY (prometheus_metric_id) REFERENCES prometheus_metrics(id) ON DELETE CASCADE; +ALTER TABLE ONLY requirements_management_test_reports + ADD CONSTRAINT fk_rails_e67d085910 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE SET NULL; + ALTER TABLE ONLY merge_request_metrics ADD CONSTRAINT fk_rails_e6d7c24d1b FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; @@ -34988,6 +34735,9 @@ ALTER TABLE ONLY vulnerability_issue_links ALTER TABLE ONLY merge_request_blocks ADD CONSTRAINT fk_rails_e9387863bc FOREIGN KEY (blocking_merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidence_sources + ADD CONSTRAINT fk_rails_e9761bed4c FOREIGN KEY (vulnerability_finding_evidence_id) REFERENCES vulnerability_finding_evidences(id) ON DELETE CASCADE; + ALTER TABLE ONLY protected_branch_unprotect_access_levels ADD CONSTRAINT fk_rails_e9eb8dc025 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; @@ -35075,12 +34825,15 @@ ALTER TABLE ONLY internal_ids ALTER TABLE ONLY issues_self_managed_prometheus_alert_events ADD CONSTRAINT fk_rails_f7db2d72eb FOREIGN KEY (self_managed_prometheus_alert_event_id) REFERENCES self_managed_prometheus_alert_events(id) ON DELETE CASCADE; -ALTER TABLE ONLY security_trainings - ADD CONSTRAINT fk_rails_f80240fae0 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; - ALTER TABLE ONLY merge_requests_closing_issues ADD CONSTRAINT fk_rails_f8540692be FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY merge_trains + ADD CONSTRAINT fk_rails_f90820cb08 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ci_runner_namespaces + ADD CONSTRAINT fk_rails_f9d9ed3308 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY banned_users ADD CONSTRAINT fk_rails_fa5bb598e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -35123,6 +34876,9 @@ ALTER TABLE ONLY resource_label_events ALTER TABLE ONLY pages_deployment_states ADD CONSTRAINT fk_rails_ff6ca551a4 FOREIGN KEY (pages_deployment_id) REFERENCES pages_deployments(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_builds_metadata + ADD CONSTRAINT fk_rails_ffcf702a02 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY security_orchestration_policy_configurations ADD CONSTRAINT fk_security_policy_configurations_management_project_id FOREIGN KEY (security_policy_management_project_id) REFERENCES projects(id) ON DELETE CASCADE; diff --git a/db/migrate/20220314184009_init_schema.rb b/db/migrate/20211202041233_init_schema.rb index 97027f8a9e4..97027f8a9e4 100644 --- a/db/migrate/20220314184009_init_schema.rb +++ b/db/migrate/20211202041233_init_schema.rb diff --git a/db/migrate/20211202094944_move_loose_fk_deleted_records_to_dynamic_schema.rb b/db/migrate/20211202094944_move_loose_fk_deleted_records_to_dynamic_schema.rb new file mode 100644 index 00000000000..84bc551d2b5 --- /dev/null +++ b/db/migrate/20211202094944_move_loose_fk_deleted_records_to_dynamic_schema.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class MoveLooseFkDeletedRecordsToDynamicSchema < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def up + if table_exists?('gitlab_partitions_static.loose_foreign_keys_deleted_records_1') + execute 'ALTER TABLE gitlab_partitions_static.loose_foreign_keys_deleted_records_1 SET SCHEMA gitlab_partitions_dynamic' + end + end + + def down + if table_exists?('gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1') + execute 'ALTER TABLE gitlab_partitions_dynamic.loose_foreign_keys_deleted_records_1 SET SCHEMA gitlab_partitions_static' + end + end +end diff --git a/db/migrate/20211202135508_add_index_on_packages_build_infos_package_id_pipeline_id.rb b/db/migrate/20211202135508_add_index_on_packages_build_infos_package_id_pipeline_id.rb new file mode 100644 index 00000000000..47a155d40fa --- /dev/null +++ b/db/migrate/20211202135508_add_index_on_packages_build_infos_package_id_pipeline_id.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexOnPackagesBuildInfosPackageIdPipelineId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_packages_build_infos_package_id_pipeline_id' + OLD_INDEX_NAME = 'idx_packages_build_infos_on_package_id' + + def up + add_concurrent_index :packages_build_infos, [:package_id, :pipeline_id], name: INDEX_NAME + remove_concurrent_index_by_name :packages_build_infos, OLD_INDEX_NAME + end + + def down + add_concurrent_index :packages_build_infos, :package_id, name: OLD_INDEX_NAME + remove_concurrent_index :packages_build_infos, [:package_id, :pipeline_id], name: INDEX_NAME + end +end diff --git a/db/migrate/20211203160952_add_updated_state_by_user_id_to_merge_request_reviewers.rb b/db/migrate/20211203160952_add_updated_state_by_user_id_to_merge_request_reviewers.rb new file mode 100644 index 00000000000..dafd2108b43 --- /dev/null +++ b/db/migrate/20211203160952_add_updated_state_by_user_id_to_merge_request_reviewers.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddUpdatedStateByUserIdToMergeRequestReviewers < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :merge_request_reviewers, :updated_state_by_user_id, :bigint + end +end diff --git a/db/migrate/20211203161149_add_index_to_merge_request_reviewers_updated_state_by_user_id.rb b/db/migrate/20211203161149_add_index_to_merge_request_reviewers_updated_state_by_user_id.rb new file mode 100644 index 00000000000..6f4ee079015 --- /dev/null +++ b/db/migrate/20211203161149_add_index_to_merge_request_reviewers_updated_state_by_user_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToMergeRequestReviewersUpdatedStateByUserId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_on_merge_request_reviewers_updated_state_by_user_id' + + def up + add_concurrent_index :merge_request_reviewers, :updated_state_by_user_id, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :merge_request_reviewers, INDEX_NAME + end +end diff --git a/db/migrate/20211203161840_add_updated_state_by_user_id_to_merge_request_assignees.rb b/db/migrate/20211203161840_add_updated_state_by_user_id_to_merge_request_assignees.rb new file mode 100644 index 00000000000..1c9e7193630 --- /dev/null +++ b/db/migrate/20211203161840_add_updated_state_by_user_id_to_merge_request_assignees.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddUpdatedStateByUserIdToMergeRequestAssignees < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :merge_request_assignees, :updated_state_by_user_id, :bigint + end +end diff --git a/db/migrate/20211203161942_add_index_to_merge_request_assignees_updated_state_by_user_id.rb b/db/migrate/20211203161942_add_index_to_merge_request_assignees_updated_state_by_user_id.rb new file mode 100644 index 00000000000..d052ffdf4d6 --- /dev/null +++ b/db/migrate/20211203161942_add_index_to_merge_request_assignees_updated_state_by_user_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToMergeRequestAssigneesUpdatedStateByUserId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_on_merge_request_assignees_updated_state_by_user_id' + + def up + add_concurrent_index :merge_request_assignees, :updated_state_by_user_id, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :merge_request_assignees, INDEX_NAME + end +end diff --git a/db/migrate/20211204010826_add_index_snippets_on_project_id_and_title.rb b/db/migrate/20211204010826_add_index_snippets_on_project_id_and_title.rb new file mode 100644 index 00000000000..35a3a98030a --- /dev/null +++ b/db/migrate/20211204010826_add_index_snippets_on_project_id_and_title.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexSnippetsOnProjectIdAndTitle < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_snippets_on_project_id_and_title' + + def up + add_concurrent_index :snippets, [:project_id, :title], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :snippets, name: INDEX_NAME + end +end diff --git a/db/migrate/20211207154413_add_ci_runners_index_on_created_at_where_active_is_false.rb b/db/migrate/20211207154413_add_ci_runners_index_on_created_at_where_active_is_false.rb new file mode 100644 index 00000000000..da391da33ec --- /dev/null +++ b/db/migrate/20211207154413_add_ci_runners_index_on_created_at_where_active_is_false.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddCiRunnersIndexOnCreatedAtWhereActiveIsFalse < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_ci_runners_on_created_at_and_id_where_inactive' + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_runners, [:created_at, :id], where: 'active = FALSE', order: { created_at: :desc, id: :desc }, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_runners, INDEX_NAME + end +end diff --git a/db/migrate/20211207154414_add_ci_runners_index_on_contacted_at_where_active_is_false.rb b/db/migrate/20211207154414_add_ci_runners_index_on_contacted_at_where_active_is_false.rb new file mode 100644 index 00000000000..e25d3c0dffa --- /dev/null +++ b/db/migrate/20211207154414_add_ci_runners_index_on_contacted_at_where_active_is_false.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddCiRunnersIndexOnContactedAtWhereActiveIsFalse < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_ci_runners_on_contacted_at_and_id_where_inactive' + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_runners, [:contacted_at, :id], where: 'active = FALSE', order: { contacted_at: :desc, id: :desc }, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_runners, INDEX_NAME + end +end diff --git a/db/migrate/20211207165508_add_protected_environments_required_approval_count_check_constraint.rb b/db/migrate/20211207165508_add_protected_environments_required_approval_count_check_constraint.rb new file mode 100644 index 00000000000..fb1339cecfa --- /dev/null +++ b/db/migrate/20211207165508_add_protected_environments_required_approval_count_check_constraint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddProtectedEnvironmentsRequiredApprovalCountCheckConstraint < Gitlab::Database::Migration[1.0] + CONSTRAINT_NAME = 'protected_environments_required_approval_count_positive' + + disable_ddl_transaction! + + def up + add_check_constraint :protected_environments, 'required_approval_count >= 0', CONSTRAINT_NAME + end + + def down + remove_check_constraint :protected_environments, CONSTRAINT_NAME + end +end diff --git a/db/migrate/20211208111425_add_executor_type_column_to_ci_runners.rb b/db/migrate/20211208111425_add_executor_type_column_to_ci_runners.rb new file mode 100644 index 00000000000..1e1fdbdb122 --- /dev/null +++ b/db/migrate/20211208111425_add_executor_type_column_to_ci_runners.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddExecutorTypeColumnToCiRunners < Gitlab::Database::Migration[1.0] + def change + add_column :ci_runners, :executor_type, :smallint, null: true + end +end diff --git a/db/migrate/20211209230042_add_status_to_cluster_agent_tokens.rb b/db/migrate/20211209230042_add_status_to_cluster_agent_tokens.rb new file mode 100644 index 00000000000..596c82eb209 --- /dev/null +++ b/db/migrate/20211209230042_add_status_to_cluster_agent_tokens.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddStatusToClusterAgentTokens < Gitlab::Database::Migration[1.0] + def change + add_column :cluster_agent_tokens, :status, :smallint, null: false, default: 0 + end +end diff --git a/db/migrate/20211210025754_alter_constraint_of_phone.rb b/db/migrate/20211210025754_alter_constraint_of_phone.rb new file mode 100644 index 00000000000..1644fbe9000 --- /dev/null +++ b/db/migrate/20211210025754_alter_constraint_of_phone.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AlterConstraintOfPhone < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + constraint_phone = check_constraint_name('verification_codes', 'phone', 'max_length') + remove_check_constraint(:verification_codes, constraint_phone) + add_check_constraint(:verification_codes, 'char_length(phone) <= 50', constraint_phone) + end + + def down + constraint_phone = check_constraint_name('verification_codes', 'phone', 'max_length') + remove_check_constraint(:verification_codes, constraint_phone) + add_check_constraint(:verification_codes, 'char_length(phone) <= 32', constraint_phone) + end +end diff --git a/db/migrate/20211210031721_change_user_details_phone_text_limit.rb b/db/migrate/20211210031721_change_user_details_phone_text_limit.rb new file mode 100644 index 00000000000..5432f6d3d24 --- /dev/null +++ b/db/migrate/20211210031721_change_user_details_phone_text_limit.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ChangeUserDetailsPhoneTextLimit < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + remove_text_limit :user_details, :phone + add_text_limit :user_details, :phone, 50 + end + + def down + remove_text_limit :user_details, :phone + add_text_limit :user_details, :phone, 32 + end +end diff --git a/db/migrate/20211213130324_update_timelogs_spent_at_default.rb b/db/migrate/20211213130324_update_timelogs_spent_at_default.rb new file mode 100644 index 00000000000..f90b19b5f68 --- /dev/null +++ b/db/migrate/20211213130324_update_timelogs_spent_at_default.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class UpdateTimelogsSpentAtDefault < Gitlab::Database::Migration[1.0] + def change + change_column_default(:timelogs, :spent_at, from: nil, to: -> { 'NOW()' }) + end +end diff --git a/db/migrate/20211213142344_add_settings_user_email_lookup_limit.rb b/db/migrate/20211213142344_add_settings_user_email_lookup_limit.rb new file mode 100644 index 00000000000..ac7027bf082 --- /dev/null +++ b/db/migrate/20211213142344_add_settings_user_email_lookup_limit.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddSettingsUserEmailLookupLimit < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_column :application_settings, :user_email_lookup_limit, :integer, null: false, default: 60 + end + + def down + remove_column :application_settings, :user_email_lookup_limit + end +end diff --git a/db/migrate/20211213154259_add_status_to_packages_package_files.rb b/db/migrate/20211213154259_add_status_to_packages_package_files.rb new file mode 100644 index 00000000000..38ea069a30b --- /dev/null +++ b/db/migrate/20211213154259_add_status_to_packages_package_files.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddStatusToPackagesPackageFiles < Gitlab::Database::Migration[1.0] + def change + add_column :packages_package_files, :status, :smallint, default: 0, null: false + end +end diff --git a/db/migrate/20211213154704_add_status_index_to_packages_package_files.rb b/db/migrate/20211213154704_add_status_index_to_packages_package_files.rb new file mode 100644 index 00000000000..7067e3efa6c --- /dev/null +++ b/db/migrate/20211213154704_add_status_index_to_packages_package_files.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddStatusIndexToPackagesPackageFiles < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_packages_package_files_on_package_id_status_and_id' + + def up + add_concurrent_index :packages_package_files, [:package_id, :status, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :packages_package_files, name: INDEX_NAME + end +end diff --git a/db/migrate/20211214110307_remove_temp_index_from_vulnerability_occurrences.rb b/db/migrate/20211214110307_remove_temp_index_from_vulnerability_occurrences.rb new file mode 100644 index 00000000000..99f985d528c --- /dev/null +++ b/db/migrate/20211214110307_remove_temp_index_from_vulnerability_occurrences.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveTempIndexFromVulnerabilityOccurrences < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'vulnerability_occurrences_location_temp_index' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :vulnerability_occurrences, name: INDEX_NAME + end + + def down + add_concurrent_index :vulnerability_occurrences, :id, where: 'location IS NULL', name: INDEX_NAME + end +end diff --git a/db/migrate/20211215182006_update_application_settings_protected_paths.rb b/db/migrate/20211215182006_update_application_settings_protected_paths.rb new file mode 100644 index 00000000000..f1c1dde55e0 --- /dev/null +++ b/db/migrate/20211215182006_update_application_settings_protected_paths.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +class UpdateApplicationSettingsProtectedPaths < Gitlab::Database::Migration[1.0] + REMOVE_PROTECTED_PATHS = [ + '/oauth/authorize', + '/oauth/token' + ].freeze + + NEW_DEFAULT_PROTECTED_PATHS = [ + '/users/password', + '/users/sign_in', + '/api/v3/session.json', + '/api/v3/session', + '/api/v4/session.json', + '/api/v4/session', + '/users', + '/users/confirmation', + '/unsubscribes/', + '/import/github/personal_access_token', + '/admin/session' + ].freeze + + OLD_DEFAULT_PROTECTED_PATHS = (NEW_DEFAULT_PROTECTED_PATHS + REMOVE_PROTECTED_PATHS).freeze + + class ApplicationSetting < ActiveRecord::Base + self.table_name = 'application_settings' + end + + def up + change_column_default(:application_settings, :protected_paths, NEW_DEFAULT_PROTECTED_PATHS) + + ApplicationSetting.reset_column_information + + ApplicationSetting.where.not(protected_paths: nil).each do |application_setting| + paths_to_remove = application_setting.protected_paths & REMOVE_PROTECTED_PATHS + + next if paths_to_remove.empty? + + updated_protected_paths = application_setting.protected_paths - paths_to_remove + application_setting.update!(protected_paths: updated_protected_paths) + end + end + + def down + change_column_default(:application_settings, :protected_paths, OLD_DEFAULT_PROTECTED_PATHS) + + ApplicationSetting.reset_column_information + + ApplicationSetting.where.not(protected_paths: nil).each do |application_setting| + paths_to_add = REMOVE_PROTECTED_PATHS - application_setting.protected_paths + + next if paths_to_add.empty? + + updated_protected_paths = application_setting.protected_paths + paths_to_add + application_setting.update!(protected_paths: updated_protected_paths) + end + end +end diff --git a/db/migrate/20211216133107_add_cluster_agent_id_to_vulnerability_reads.rb b/db/migrate/20211216133107_add_cluster_agent_id_to_vulnerability_reads.rb new file mode 100644 index 00000000000..0bbd5c25df4 --- /dev/null +++ b/db/migrate/20211216133107_add_cluster_agent_id_to_vulnerability_reads.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddClusterAgentIdToVulnerabilityReads < Gitlab::Database::Migration[1.0] + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb + def change + add_column :vulnerability_reads, :cluster_agent_id, :text + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb b/db/migrate/20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb new file mode 100644 index 00000000000..f4776ff10a4 --- /dev/null +++ b/db/migrate/20211216134134_add_text_limit_to_vulnerability_reads_cluster_agent_id.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToVulnerabilityReadsClusterAgentId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :vulnerability_reads, :cluster_agent_id, 10 + end + + def down + remove_text_limit :vulnerability_reads, :cluster_agent_id + end +end diff --git a/db/migrate/20211216135651_add_index_to_cluster_agent_id.rb b/db/migrate/20211216135651_add_index_to_cluster_agent_id.rb new file mode 100644 index 00000000000..05928083823 --- /dev/null +++ b/db/migrate/20211216135651_add_index_to_cluster_agent_id.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexToClusterAgentId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = "index_vulnerability_reads_on_cluster_agent_id" + CLUSTER_IMAGE_SCANNING_REPORT_TYPE = 7 + + def up + add_concurrent_index :vulnerability_reads, :cluster_agent_id, where: "report_type = #{CLUSTER_IMAGE_SCANNING_REPORT_TYPE}", name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_reads, INDEX_NAME + end +end diff --git a/db/migrate/20211216220939_add_group_crm_settings.rb b/db/migrate/20211216220939_add_group_crm_settings.rb new file mode 100644 index 00000000000..e931aa3709b --- /dev/null +++ b/db/migrate/20211216220939_add_group_crm_settings.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddGroupCrmSettings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + create_table :group_crm_settings, id: false do |t| + t.references :group, primary_key: true, foreign_key: { to_table: :namespaces, on_delete: :cascade } + t.timestamps_with_timezone + t.boolean :enabled, null: false, default: false + end + end +end diff --git a/db/migrate/20211217050753_remove_artifacts_archive_id_foreign_key_from_project_pages_metadata.rb b/db/migrate/20211217050753_remove_artifacts_archive_id_foreign_key_from_project_pages_metadata.rb new file mode 100644 index 00000000000..fa81fa512ae --- /dev/null +++ b/db/migrate/20211217050753_remove_artifacts_archive_id_foreign_key_from_project_pages_metadata.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveArtifactsArchiveIdForeignKeyFromProjectPagesMetadata < Gitlab::Database::Migration[1.0] + CONSTRAINT_NAME = 'fk_69366a119e' + + disable_ddl_transaction! + + def up + with_lock_retries do + execute('lock table ci_job_artifacts, project_pages_metadata in access exclusive mode') + + remove_foreign_key :project_pages_metadata, to_table: :ci_job_artifacts, column: :artifacts_archive_id, on_delete: :nullify, name: CONSTRAINT_NAME + end + end + + def down + add_concurrent_foreign_key :project_pages_metadata, :ci_job_artifacts, column: :artifacts_archive_id, on_delete: :nullify, name: CONSTRAINT_NAME + end +end diff --git a/db/migrate/20211220174504_add_secure_scanning_actions_to_onboarding_progresses.rb b/db/migrate/20211220174504_add_secure_scanning_actions_to_onboarding_progresses.rb new file mode 100644 index 00000000000..cf9f2511176 --- /dev/null +++ b/db/migrate/20211220174504_add_secure_scanning_actions_to_onboarding_progresses.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddSecureScanningActionsToOnboardingProgresses < Gitlab::Database::Migration[1.0] + def change + change_table(:onboarding_progresses, bulk: true) do |t| + t.column :secure_dependency_scanning_run_at, :datetime_with_timezone + t.column :secure_container_scanning_run_at, :datetime_with_timezone + t.column :secure_dast_run_at, :datetime_with_timezone + t.column :secure_secret_detection_run_at, :datetime_with_timezone + t.column :secure_coverage_fuzzing_run_at, :datetime_with_timezone + t.column :secure_cluster_image_scanning_run_at, :datetime_with_timezone + t.column :secure_api_fuzzing_run_at, :datetime_with_timezone + end + end +end diff --git a/db/migrate/20211223125921_add_temp_index_to_members_state.rb b/db/migrate/20211223125921_add_temp_index_to_members_state.rb new file mode 100644 index 00000000000..7dd2ec1a8aa --- /dev/null +++ b/db/migrate/20211223125921_add_temp_index_to_members_state.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddTempIndexToMembersState < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'tmp_index_members_on_state' + + def up + # Temporary index to be removed in 14.9 https://gitlab.com/gitlab-org/gitlab/-/issues/349960 + add_concurrent_index :members, :state, name: INDEX_NAME, where: 'state = 2' + end + + def down + remove_concurrent_index_by_name :members, INDEX_NAME + end +end diff --git a/db/migrate/20211224112937_add_packages_cleanup_package_file_worker_capacity_to_application_settings.rb b/db/migrate/20211224112937_add_packages_cleanup_package_file_worker_capacity_to_application_settings.rb new file mode 100644 index 00000000000..cb58033361f --- /dev/null +++ b/db/migrate/20211224112937_add_packages_cleanup_package_file_worker_capacity_to_application_settings.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddPackagesCleanupPackageFileWorkerCapacityToApplicationSettings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :application_settings, + :packages_cleanup_package_file_worker_capacity, + :smallint, + default: 2, + null: false + end +end diff --git a/db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb b/db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb new file mode 100644 index 00000000000..3a40540a1e1 --- /dev/null +++ b/db/migrate/20211224114539_add_packages_cleanup_package_file_worker_capacity_check_constraint_to_app_settings.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddPackagesCleanupPackageFileWorkerCapacityCheckConstraintToAppSettings < Gitlab::Database::Migration[1.0] + CONSTRAINT_NAME = 'app_settings_p_cleanup_package_file_worker_capacity_positive' + + disable_ddl_transaction! + + def up + add_check_constraint :application_settings, 'packages_cleanup_package_file_worker_capacity >= 0', CONSTRAINT_NAME + end + + def down + remove_check_constraint :application_settings, CONSTRAINT_NAME + end +end diff --git a/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb b/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb new file mode 100644 index 00000000000..2cef570966b --- /dev/null +++ b/db/migrate/20220104174445_add_ci_runners_index_on_active_state.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddCiRunnersIndexOnActiveState < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_ci_runners_on_active' + + def up + add_concurrent_index :ci_runners, [:active, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_runners, INDEX_NAME + end +end diff --git a/db/migrate/20220105082217_add_verification_token_to_external_ae_destinations.rb b/db/migrate/20220105082217_add_verification_token_to_external_ae_destinations.rb new file mode 100644 index 00000000000..046a628b8ae --- /dev/null +++ b/db/migrate/20220105082217_add_verification_token_to_external_ae_destinations.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddVerificationTokenToExternalAeDestinations < Gitlab::Database::Migration[1.0] + def up + # rubocop:disable Migration/AddLimitToTextColumns + add_column :audit_events_external_audit_event_destinations, :verification_token, :text + # rubocop:enable Migration/AddLimitToTextColumns + end + + def down + remove_column :audit_events_external_audit_event_destinations, :verification_token + end +end diff --git a/db/migrate/20220105121325_add_route_namespace_reference.rb b/db/migrate/20220105121325_add_route_namespace_reference.rb new file mode 100644 index 00000000000..77bd0530b8a --- /dev/null +++ b/db/migrate/20220105121325_add_route_namespace_reference.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddRouteNamespaceReference < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def up + add_column :routes, :namespace_id, :bigint unless column_exists?(:routes, :namespace_id) + end + + def down + remove_column :routes, :namespace_id if column_exists?(:routes, :namespace_id) + end +end diff --git a/db/migrate/20220105152547_add_foreign_key_to_updated_state_by_user_id_to_merge_request_assignees.rb b/db/migrate/20220105152547_add_foreign_key_to_updated_state_by_user_id_to_merge_request_assignees.rb new file mode 100644 index 00000000000..58411c1dc0f --- /dev/null +++ b/db/migrate/20220105152547_add_foreign_key_to_updated_state_by_user_id_to_merge_request_assignees.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddForeignKeyToUpdatedStateByUserIdToMergeRequestAssignees < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :merge_request_assignees, :users, column: :updated_state_by_user_id, on_delete: :nullify + end + + def down + with_lock_retries do + remove_foreign_key :merge_request_assignees, column: :updated_state_by_user_id + end + end +end diff --git a/db/migrate/20220105153149_add_foreign_key_to_updated_state_by_user_id_to_merge_request_reviewers.rb b/db/migrate/20220105153149_add_foreign_key_to_updated_state_by_user_id_to_merge_request_reviewers.rb new file mode 100644 index 00000000000..13e375a5b97 --- /dev/null +++ b/db/migrate/20220105153149_add_foreign_key_to_updated_state_by_user_id_to_merge_request_reviewers.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddForeignKeyToUpdatedStateByUserIdToMergeRequestReviewers < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :merge_request_reviewers, :users, column: :updated_state_by_user_id, on_delete: :nullify + end + + def down + with_lock_retries do + remove_foreign_key :merge_request_reviewers, column: :updated_state_by_user_id + end + end +end diff --git a/db/migrate/20220106111958_add_insert_or_update_vulnerability_reads_trigger.rb b/db/migrate/20220106111958_add_insert_or_update_vulnerability_reads_trigger.rb new file mode 100644 index 00000000000..0049f4e00a2 --- /dev/null +++ b/db/migrate/20220106111958_add_insert_or_update_vulnerability_reads_trigger.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +class AddInsertOrUpdateVulnerabilityReadsTrigger < Gitlab::Database::Migration[1.0] + include Gitlab::Database::SchemaHelpers + + FUNCTION_NAME = 'insert_or_update_vulnerability_reads' + TRIGGER_NAME = 'trigger_insert_or_update_vulnerability_reads_from_occurrences' + + def up + execute(<<~SQL) + CREATE OR REPLACE FUNCTION #{FUNCTION_NAME}() + RETURNS TRIGGER + LANGUAGE plpgsql + AS $$ + DECLARE + severity smallint; + state smallint; + report_type smallint; + resolved_on_default_branch boolean; + BEGIN + IF (NEW.vulnerability_id IS NULL AND (TG_OP = 'INSERT' OR TG_OP = 'UPDATE')) THEN + RETURN NULL; + END IF; + + IF (TG_OP = 'UPDATE' AND OLD.vulnerability_id IS NOT NULL AND NEW.vulnerability_id IS NOT NULL) THEN + RETURN NULL; + END IF; + + SELECT + vulnerabilities.severity, vulnerabilities.state, vulnerabilities.report_type, vulnerabilities.resolved_on_default_branch + INTO + severity, state, report_type, resolved_on_default_branch + FROM + vulnerabilities + WHERE + vulnerabilities.id = NEW.vulnerability_id; + + INSERT INTO vulnerability_reads (vulnerability_id, project_id, scanner_id, report_type, severity, state, resolved_on_default_branch, uuid, location_image, cluster_agent_id) + VALUES (NEW.vulnerability_id, NEW.project_id, NEW.scanner_id, report_type, severity, state, resolved_on_default_branch, NEW.uuid::uuid, NEW.location->>'image', NEW.location->'kubernetes_resource'->>'agent_id') + ON CONFLICT(vulnerability_id) DO NOTHING; + RETURN NULL; + END + $$; + SQL + + execute(<<~SQL) + CREATE TRIGGER #{TRIGGER_NAME} + AFTER INSERT OR UPDATE ON vulnerability_occurrences + FOR EACH ROW + EXECUTE PROCEDURE #{FUNCTION_NAME}(); + SQL + end + + def down + drop_trigger(:vulnerability_occurrences, TRIGGER_NAME) + drop_function(FUNCTION_NAME) + end +end diff --git a/db/migrate/20220106112043_add_update_vulnerability_reads_trigger.rb b/db/migrate/20220106112043_add_update_vulnerability_reads_trigger.rb new file mode 100644 index 00000000000..940ec638924 --- /dev/null +++ b/db/migrate/20220106112043_add_update_vulnerability_reads_trigger.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +class AddUpdateVulnerabilityReadsTrigger < Gitlab::Database::Migration[1.0] + include Gitlab::Database::SchemaHelpers + + TRIGGER_NAME = 'trigger_update_vulnerability_reads_on_vulnerability_update' + FUNCTION_NAME = 'update_vulnerability_reads_from_vulnerability' + + def up + create_trigger_function(FUNCTION_NAME, replace: true) do + <<~SQL + UPDATE + vulnerability_reads + SET + severity = NEW.severity, + state = NEW.state, + resolved_on_default_branch = NEW.resolved_on_default_branch + WHERE vulnerability_id = NEW.id; + RETURN NULL; + SQL + end + + execute(<<~SQL) + CREATE TRIGGER #{TRIGGER_NAME} + AFTER UPDATE ON vulnerabilities + FOR EACH ROW + WHEN ( + OLD.severity IS DISTINCT FROM NEW.severity OR + OLD.state IS DISTINCT FROM NEW.state OR + OLD.resolved_on_default_branch IS DISTINCT FROM NEW.resolved_on_default_branch + ) + EXECUTE PROCEDURE #{FUNCTION_NAME}(); + SQL + end + + def down + drop_trigger(:vulnerabilities, TRIGGER_NAME) + drop_function(FUNCTION_NAME) + end +end diff --git a/db/migrate/20220106112085_add_update_vulnerability_reads_location_trigger.rb b/db/migrate/20220106112085_add_update_vulnerability_reads_location_trigger.rb new file mode 100644 index 00000000000..a863fe8b7b8 --- /dev/null +++ b/db/migrate/20220106112085_add_update_vulnerability_reads_location_trigger.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +class AddUpdateVulnerabilityReadsLocationTrigger < Gitlab::Database::Migration[1.0] + include Gitlab::Database::SchemaHelpers + + TRIGGER_NAME = 'trigger_update_location_on_vulnerability_occurrences_update' + FUNCTION_NAME = 'update_location_from_vulnerability_occurrences' + + def up + create_trigger_function(FUNCTION_NAME, replace: true) do + <<~SQL + UPDATE + vulnerability_reads + SET + location_image = NEW.location->>'image', + cluster_agent_id = NEW.location->'kubernetes_resource'->>'agent_id' + WHERE + vulnerability_id = NEW.vulnerability_id; + RETURN NULL; + SQL + end + + execute(<<~SQL) + CREATE TRIGGER #{TRIGGER_NAME} + AFTER UPDATE ON vulnerability_occurrences + FOR EACH ROW + WHEN ( + NEW.report_type IN (2, 7) AND ( + OLD.location->>'image' IS DISTINCT FROM NEW.location->>'image' OR + OLD.location->'kubernetes_resource'->>'agent_id' IS DISTINCT FROM NEW.location->'kubernetes_resource'->>'agent_id' + ) + ) + EXECUTE PROCEDURE #{FUNCTION_NAME}(); + SQL + end + + def down + drop_trigger(:vulnerability_occurrences, TRIGGER_NAME) + drop_function(FUNCTION_NAME) + end +end diff --git a/db/migrate/20220106141756_remove_lock_version_indexes.rb b/db/migrate/20220106141756_remove_lock_version_indexes.rb new file mode 100644 index 00000000000..382f20dfc73 --- /dev/null +++ b/db/migrate/20220106141756_remove_lock_version_indexes.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class RemoveLockVersionIndexes < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEXES = { + issues: 'index_issues_on_lock_version', + merge_requests: 'index_merge_requests_on_lock_version', + epics: 'index_epics_on_lock_version' + } + + def up + INDEXES.each do |table, index_name| + remove_concurrent_index_by_name table, index_name + end + end + + def down + INDEXES.each do |table, index_name| + add_concurrent_index table, :lock_version, where: "lock_version IS NULL", name: index_name + end + end +end diff --git a/db/migrate/20220106163326_add_has_issues_on_vulnerability_reads_trigger.rb b/db/migrate/20220106163326_add_has_issues_on_vulnerability_reads_trigger.rb new file mode 100644 index 00000000000..b3023a1f915 --- /dev/null +++ b/db/migrate/20220106163326_add_has_issues_on_vulnerability_reads_trigger.rb @@ -0,0 +1,79 @@ +# frozen_string_literal: true + +class AddHasIssuesOnVulnerabilityReadsTrigger < Gitlab::Database::Migration[1.0] + include Gitlab::Database::SchemaHelpers + + TRIGGER_ON_INSERT = 'trigger_update_has_issues_on_vulnerability_issue_links_update' + INSERT_FUNCTION_NAME = 'set_has_issues_on_vulnerability_reads' + + TRIGGER_ON_DELETE = 'trigger_update_has_issues_on_vulnerability_issue_links_delete' + DELETE_FUNCTION_NAME = 'unset_has_issues_on_vulnerability_reads' + + def up + create_trigger_function(INSERT_FUNCTION_NAME, replace: true) do + <<~SQL + UPDATE + vulnerability_reads + SET + has_issues = true + WHERE + vulnerability_id = NEW.vulnerability_id AND has_issues IS FALSE; + RETURN NULL; + SQL + end + + execute(<<~SQL) + CREATE OR REPLACE FUNCTION #{DELETE_FUNCTION_NAME}() + RETURNS TRIGGER + LANGUAGE plpgsql + AS $$ + DECLARE + has_issue_links integer; + BEGIN + PERFORM 1 + FROM + vulnerability_reads + WHERE + vulnerability_id = OLD.vulnerability_id + FOR UPDATE; + + SELECT 1 INTO has_issue_links FROM vulnerability_issue_links WHERE vulnerability_id = OLD.vulnerability_id LIMIT 1; + + IF (has_issue_links = 1) THEN + RETURN NULL; + END IF; + + UPDATE + vulnerability_reads + SET + has_issues = false + WHERE + vulnerability_id = OLD.vulnerability_id; + + RETURN NULL; + END + $$; + SQL + + execute(<<~SQL) + CREATE TRIGGER #{TRIGGER_ON_INSERT} + AFTER INSERT ON vulnerability_issue_links + FOR EACH ROW + EXECUTE FUNCTION #{INSERT_FUNCTION_NAME}(); + SQL + + execute(<<~SQL) + CREATE TRIGGER #{TRIGGER_ON_DELETE} + AFTER DELETE ON vulnerability_issue_links + FOR EACH ROW + EXECUTE FUNCTION #{DELETE_FUNCTION_NAME}(); + SQL + end + + def down + drop_trigger(:vulnerability_issue_links, TRIGGER_ON_INSERT) + drop_function(INSERT_FUNCTION_NAME) + drop_trigger(:vulnerability_issue_links, TRIGGER_ON_DELETE) + drop_function(DELETE_FUNCTION_NAME) + end +end diff --git a/db/migrate/20220106230629_add_registry_migration_application_settings.rb b/db/migrate/20220106230629_add_registry_migration_application_settings.rb new file mode 100644 index 00000000000..191443de6eb --- /dev/null +++ b/db/migrate/20220106230629_add_registry_migration_application_settings.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddRegistryMigrationApplicationSettings < Gitlab::Database::Migration[1.0] + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20220118141950_add_text_limit_to_container_registry_import_target_plan.rb + def change + add_column :application_settings, :container_registry_import_max_tags_count, :integer, default: 100, null: false + add_column :application_settings, :container_registry_import_max_retries, :integer, default: 3, null: false + add_column :application_settings, :container_registry_import_start_max_retries, :integer, default: 50, null: false + add_column :application_settings, :container_registry_import_max_step_duration, :integer, default: 5.minutes, null: false + add_column :application_settings, :container_registry_import_target_plan, :text, default: 'free', null: false + add_column :application_settings, :container_registry_import_created_before, :datetime_with_timezone, default: '2022-01-23 00:00:00', null: false + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20220106230712_add_migration_columns_to_container_repositories.rb b/db/migrate/20220106230712_add_migration_columns_to_container_repositories.rb new file mode 100644 index 00000000000..76dccbe785f --- /dev/null +++ b/db/migrate/20220106230712_add_migration_columns_to_container_repositories.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddMigrationColumnsToContainerRepositories < Gitlab::Database::Migration[1.0] + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20220117225936_add_text_limits_to_container_repositories_migration_columns.rb + def change + add_column :container_repositories, :migration_pre_import_started_at, :datetime_with_timezone + add_column :container_repositories, :migration_pre_import_done_at, :datetime_with_timezone + add_column :container_repositories, :migration_import_started_at, :datetime_with_timezone + add_column :container_repositories, :migration_import_done_at, :datetime_with_timezone + add_column :container_repositories, :migration_aborted_at, :datetime_with_timezone + add_column :container_repositories, :migration_skipped_at, :datetime_with_timezone + add_column :container_repositories, :migration_retries_count, :integer, default: 0, null: false + add_column :container_repositories, :migration_skipped_reason, :smallint + add_column :container_repositories, :migration_state, :text, default: 'default', null: false + add_column :container_repositories, :migration_aborted_in_state, :text + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20220107091629_add_route_namespace_index.rb b/db/migrate/20220107091629_add_route_namespace_index.rb new file mode 100644 index 00000000000..bc1044a24da --- /dev/null +++ b/db/migrate/20220107091629_add_route_namespace_index.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddRouteNamespaceIndex < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + INDEX_NAME = 'index_routes_on_namespace_id' + + def up + add_concurrent_index :routes, :namespace_id, unique: true, name: INDEX_NAME + add_concurrent_foreign_key :routes, :namespaces, column: :namespace_id, on_delete: :nullify, reverse_lock_order: true + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :routes, column: :namespace_id + end + + remove_concurrent_index_by_name :routes, INDEX_NAME + end +end diff --git a/db/migrate/20220107165036_remove_note_id_index.rb b/db/migrate/20220107165036_remove_note_id_index.rb new file mode 100644 index 00000000000..15b4a3caf78 --- /dev/null +++ b/db/migrate/20220107165036_remove_note_id_index.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveNoteIdIndex < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + TABLE = :suggestions + INDEX_NAME = 'index_suggestions_on_note_id' + + def up + remove_concurrent_index_by_name TABLE, INDEX_NAME + end + + def down + add_concurrent_index TABLE, :note_id, name: INDEX_NAME + end +end diff --git a/db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb b/db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb new file mode 100644 index 00000000000..abbd54ff19b --- /dev/null +++ b/db/migrate/20220109133006_remove_ci_pipelines_lock_version_index.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveCiPipelinesLockVersionIndex < Gitlab::Database::Migration[1.0] + TABLE = :ci_pipelines + INDEX_NAME = 'tmp_index_ci_pipelines_lock_version' + COLUMN = :id + + disable_ddl_transaction! + + def up + remove_concurrent_index TABLE, COLUMN, where: "lock_version IS NULL", name: INDEX_NAME + end + + def down + add_concurrent_index TABLE, COLUMN, where: "lock_version IS NULL", name: INDEX_NAME + end +end diff --git a/db/migrate/20220110170953_create_ci_secure_files.rb b/db/migrate/20220110170953_create_ci_secure_files.rb new file mode 100644 index 00000000000..1498a2d0212 --- /dev/null +++ b/db/migrate/20220110170953_create_ci_secure_files.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class CreateCiSecureFiles < Gitlab::Database::Migration[1.0] + def up + create_table :ci_secure_files do |t| + t.bigint :project_id, index: true, null: false + t.timestamps_with_timezone null: false + t.integer :file_store, limit: 2, null: false, default: 1 + t.integer :permissions, null: false, default: 0, limit: 2 + t.text :name, null: false, limit: 255 + t.text :file, null: false, limit: 255 + t.binary :checksum, null: false + end + end + + def down + drop_table :ci_secure_files, if_exists: true + end +end diff --git a/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb b/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb new file mode 100644 index 00000000000..969774983c4 --- /dev/null +++ b/db/migrate/20220111095006_add_maintainer_note_to_ci_runners.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class AddMaintainerNoteToCiRunners < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb + add_column :ci_runners, :maintainer_note, :text + # rubocop:enable Migration/AddLimitToTextColumns + end +end diff --git a/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb b/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb new file mode 100644 index 00000000000..0a0a4171306 --- /dev/null +++ b/db/migrate/20220111095007_add_text_limit_to_ci_runners_maintainer_note.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToCiRunnersMaintainerNote < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :ci_runners, :maintainer_note, 255 + end + + def down + remove_text_limit :ci_runners, :maintainer_note + end +end diff --git a/db/migrate/20220111154950_add_token_expires_at_to_ci_runners.rb b/db/migrate/20220111154950_add_token_expires_at_to_ci_runners.rb new file mode 100644 index 00000000000..b4d7c63d24b --- /dev/null +++ b/db/migrate/20220111154950_add_token_expires_at_to_ci_runners.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddTokenExpiresAtToCiRunners < Gitlab::Database::Migration[1.0] + def change + add_column :ci_runners, :token_expires_at, :datetime_with_timezone + end +end diff --git a/db/migrate/20220111154951_add_index_to_ci_runners_token_expires_at.rb b/db/migrate/20220111154951_add_index_to_ci_runners_token_expires_at.rb new file mode 100644 index 00000000000..53623198f51 --- /dev/null +++ b/db/migrate/20220111154951_add_index_to_ci_runners_token_expires_at.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToCiRunnersTokenExpiresAt < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_concurrent_index :ci_runners, [:token_expires_at, :id], order: { token_expires_at: :asc, id: :desc }, name: 'index_ci_runners_on_token_expires_at_and_id_desc' + add_concurrent_index :ci_runners, [:token_expires_at, :id], order: { token_expires_at: :desc, id: :desc }, name: 'index_ci_runners_on_token_expires_at_desc_and_id_desc' + end + + def down + remove_concurrent_index_by_name :ci_runners, 'index_ci_runners_on_token_expires_at_desc_and_id_desc' + remove_concurrent_index_by_name :ci_runners, 'index_ci_runners_on_token_expires_at_and_id_desc' + end +end diff --git a/db/migrate/20220111200254_remove_index_from_merge_requests.rb b/db/migrate/20220111200254_remove_index_from_merge_requests.rb new file mode 100644 index 00000000000..0ac6019ad5e --- /dev/null +++ b/db/migrate/20220111200254_remove_index_from_merge_requests.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveIndexFromMergeRequests < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_merge_requests_on_title' + + def up + remove_concurrent_index :merge_requests, :title, name: INDEX_NAME + end + + def down + add_concurrent_index :merge_requests, :title, name: INDEX_NAME + end +end diff --git a/db/migrate/20220112115413_add_requires_verification_to_user_details.rb b/db/migrate/20220112115413_add_requires_verification_to_user_details.rb new file mode 100644 index 00000000000..01fe4f1d5cf --- /dev/null +++ b/db/migrate/20220112115413_add_requires_verification_to_user_details.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddRequiresVerificationToUserDetails < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :user_details, :requires_credit_card_verification, :boolean, null: false, default: false + end +end diff --git a/db/migrate/20220112205111_create_security_training_providers.rb b/db/migrate/20220112205111_create_security_training_providers.rb new file mode 100644 index 00000000000..afddec6a134 --- /dev/null +++ b/db/migrate/20220112205111_create_security_training_providers.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class CreateSecurityTrainingProviders < Gitlab::Database::Migration[1.0] + def change + create_table :security_training_providers do |t| + t.text :name, limit: 256, null: false + t.text :description, limit: 512 + t.text :url, limit: 512, null: false + t.text :logo_url, limit: 512 + + t.timestamps_with_timezone null: false + end + end +end diff --git a/db/migrate/20220112232037_add_member_namespace_reference.rb b/db/migrate/20220112232037_add_member_namespace_reference.rb new file mode 100644 index 00000000000..d67ea09a78c --- /dev/null +++ b/db/migrate/20220112232037_add_member_namespace_reference.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddMemberNamespaceReference < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def up + add_column :members, :member_namespace_id, :bigint unless column_exists?(:members, :member_namespace_id) + end + + def down + remove_column :members, :member_namespace_id if column_exists?(:members, :member_namespace_id) + end +end diff --git a/db/migrate/20220112232605_add_member_namespace_index.rb b/db/migrate/20220112232605_add_member_namespace_index.rb new file mode 100644 index 00000000000..ba32df53ae7 --- /dev/null +++ b/db/migrate/20220112232605_add_member_namespace_index.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddMemberNamespaceIndex < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + INDEX_NAME = 'index_members_on_member_namespace_id' + + def up + add_concurrent_index :members, :member_namespace_id, unique: false, name: INDEX_NAME + add_concurrent_foreign_key :members, :namespaces, column: :member_namespace_id, on_delete: :nullify, reverse_lock_order: true + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :members, column: :member_namespace_id + end + + remove_concurrent_index_by_name :members, INDEX_NAME + end +end diff --git a/db/migrate/20220113125401_create_security_trainings.rb b/db/migrate/20220113125401_create_security_trainings.rb new file mode 100644 index 00000000000..6924c7bd189 --- /dev/null +++ b/db/migrate/20220113125401_create_security_trainings.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateSecurityTrainings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + create_table :security_trainings do |t| + t.references :project, null: false, foreign_key: { on_delete: :cascade } + t.references :provider, null: false, foreign_key: { to_table: :security_training_providers, on_delete: :cascade } + t.boolean :is_primary, default: false, null: false + + t.timestamps_with_timezone null: false + + # Guarantee that there will be only one primary per project + t.index :project_id, name: 'index_security_trainings_on_unique_project_id', unique: true, where: 'is_primary IS TRUE' + end + end +end diff --git a/db/migrate/20220113135449_add_package_files_limit_to_application_settings.rb b/db/migrate/20220113135449_add_package_files_limit_to_application_settings.rb new file mode 100644 index 00000000000..6d3deacdda3 --- /dev/null +++ b/db/migrate/20220113135449_add_package_files_limit_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddPackageFilesLimitToApplicationSettings < Gitlab::Database::Migration[1.0] + def change + add_column :application_settings, :max_package_files_for_package_destruction, :smallint, default: 100, null: false + end +end diff --git a/db/migrate/20220113135924_add_application_settings_package_files_limit_constraints.rb b/db/migrate/20220113135924_add_application_settings_package_files_limit_constraints.rb new file mode 100644 index 00000000000..65fbccbd1ae --- /dev/null +++ b/db/migrate/20220113135924_add_application_settings_package_files_limit_constraints.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddApplicationSettingsPackageFilesLimitConstraints < Gitlab::Database::Migration[1.0] + CONSTRAINT_NAME = 'app_settings_max_package_files_for_package_destruction_positive' + + disable_ddl_transaction! + + def up + add_check_constraint :application_settings, 'max_package_files_for_package_destruction > 0', CONSTRAINT_NAME + end + + def down + remove_check_constraint :application_settings, CONSTRAINT_NAME + end +end diff --git a/db/migrate/20220113164801_add_diffs_colors_to_user_preferences.rb b/db/migrate/20220113164801_add_diffs_colors_to_user_preferences.rb new file mode 100644 index 00000000000..00e8e574722 --- /dev/null +++ b/db/migrate/20220113164801_add_diffs_colors_to_user_preferences.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddDiffsColorsToUserPreferences < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20220113164901_add_text_limit_to_user_preferences_diffs_colors.rb + def change + add_column :user_preferences, :diffs_deletion_color, :text + add_column :user_preferences, :diffs_addition_color, :text + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20220113164901_add_text_limit_to_user_preferences_diffs_colors.rb b/db/migrate/20220113164901_add_text_limit_to_user_preferences_diffs_colors.rb new file mode 100644 index 00000000000..9ae1c875194 --- /dev/null +++ b/db/migrate/20220113164901_add_text_limit_to_user_preferences_diffs_colors.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTextLimitToUserPreferencesDiffsColors < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :user_preferences, :diffs_deletion_color, 7 + add_text_limit :user_preferences, :diffs_addition_color, 7 + end + + def down + remove_text_limit :user_preferences, :diffs_addition_color + remove_text_limit :user_preferences, :diffs_deletion_color + end +end diff --git a/db/migrate/20220114131950_add_status_only_index_to_packages_package_files.rb b/db/migrate/20220114131950_add_status_only_index_to_packages_package_files.rb new file mode 100644 index 00000000000..948edea1138 --- /dev/null +++ b/db/migrate/20220114131950_add_status_only_index_to_packages_package_files.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddStatusOnlyIndexToPackagesPackageFiles < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_packages_package_files_on_status' + + def up + add_concurrent_index :packages_package_files, :status, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :packages_package_files, name: INDEX_NAME + end +end diff --git a/db/migrate/20220117082611_add_text_limit_to_exad_verification_tokens.rb b/db/migrate/20220117082611_add_text_limit_to_exad_verification_tokens.rb new file mode 100644 index 00000000000..9978e87a1e3 --- /dev/null +++ b/db/migrate/20220117082611_add_text_limit_to_exad_verification_tokens.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToExadVerificationTokens < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :audit_events_external_audit_event_destinations, :verification_token, 24 + end + + def down + remove_text_limit :audit_events_external_audit_event_destinations, :verification_token + end +end diff --git a/db/migrate/20220117225936_add_text_limits_to_container_repositories_migration_columns.rb b/db/migrate/20220117225936_add_text_limits_to_container_repositories_migration_columns.rb new file mode 100644 index 00000000000..91c0612716b --- /dev/null +++ b/db/migrate/20220117225936_add_text_limits_to_container_repositories_migration_columns.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTextLimitsToContainerRepositoriesMigrationColumns < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :container_repositories, :migration_state, 255 + add_text_limit :container_repositories, :migration_aborted_in_state, 255 + end + + def down + remove_text_limit :container_repositories, :migration_state + remove_text_limit :container_repositories, :migration_aborted_in_state + end +end diff --git a/db/migrate/20220118015633_add_url_text_to_issuable_metric_images.rb b/db/migrate/20220118015633_add_url_text_to_issuable_metric_images.rb new file mode 100644 index 00000000000..55d820c1256 --- /dev/null +++ b/db/migrate/20220118015633_add_url_text_to_issuable_metric_images.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddUrlTextToIssuableMetricImages < Gitlab::Database::Migration[1.0] + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20220118020026_add_url_text_limit_to_issuable_metric_images + def change + add_column :issuable_metric_images, :url_text, :text + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20220118020026_add_url_text_limit_to_issuable_metric_images.rb b/db/migrate/20220118020026_add_url_text_limit_to_issuable_metric_images.rb new file mode 100644 index 00000000000..2f0f27681cd --- /dev/null +++ b/db/migrate/20220118020026_add_url_text_limit_to_issuable_metric_images.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddUrlTextLimitToIssuableMetricImages < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :issuable_metric_images, :url_text, 128 + end + + def down + remove_text_limit :issuable_metric_images, :url_text + end +end diff --git a/db/migrate/20220118141950_add_text_limit_to_container_registry_import_target_plan.rb b/db/migrate/20220118141950_add_text_limit_to_container_registry_import_target_plan.rb new file mode 100644 index 00000000000..c7247d03423 --- /dev/null +++ b/db/migrate/20220118141950_add_text_limit_to_container_registry_import_target_plan.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToContainerRegistryImportTargetPlan < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :application_settings, :container_registry_import_target_plan, 255 + end + + def down + remove_text_limit :application_settings, :container_registry_import_target_plan + end +end diff --git a/db/migrate/20220118155846_add_runner_token_expiration_interval_settings_to_application_settings.rb b/db/migrate/20220118155846_add_runner_token_expiration_interval_settings_to_application_settings.rb new file mode 100644 index 00000000000..32ca8a5fb12 --- /dev/null +++ b/db/migrate/20220118155846_add_runner_token_expiration_interval_settings_to_application_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddRunnerTokenExpirationIntervalSettingsToApplicationSettings < Gitlab::Database::Migration[1.0] + def change + [:runner_token_expiration_interval, :group_runner_token_expiration_interval, :project_runner_token_expiration_interval].each do |field| + add_column :application_settings, field, :integer + end + end +end diff --git a/db/migrate/20220118155847_add_runner_token_expiration_interval_settings_to_namespace_settings.rb b/db/migrate/20220118155847_add_runner_token_expiration_interval_settings_to_namespace_settings.rb new file mode 100644 index 00000000000..7b83cb2dd55 --- /dev/null +++ b/db/migrate/20220118155847_add_runner_token_expiration_interval_settings_to_namespace_settings.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddRunnerTokenExpirationIntervalSettingsToNamespaceSettings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + [:runner_token_expiration_interval, :subgroup_runner_token_expiration_interval, :project_runner_token_expiration_interval].each do |field| + add_column :namespace_settings, field, :integer + end + end +end diff --git a/db/migrate/20220118155848_add_runner_token_expiration_interval_settings_to_project_settings.rb b/db/migrate/20220118155848_add_runner_token_expiration_interval_settings_to_project_settings.rb new file mode 100644 index 00000000000..ef959171828 --- /dev/null +++ b/db/migrate/20220118155848_add_runner_token_expiration_interval_settings_to_project_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddRunnerTokenExpirationIntervalSettingsToProjectSettings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :project_ci_cd_settings, :runner_token_expiration_interval, :integer + end +end diff --git a/db/migrate/20220119094023_add_unique_index_to_aed_verification_token.rb b/db/migrate/20220119094023_add_unique_index_to_aed_verification_token.rb new file mode 100644 index 00000000000..bd40fe2203e --- /dev/null +++ b/db/migrate/20220119094023_add_unique_index_to_aed_verification_token.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddUniqueIndexToAedVerificationToken < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_audit_events_external_audit_on_verification_token' + + def up + add_concurrent_index :audit_events_external_audit_event_destinations, :verification_token, unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :audit_events_external_audit_event_destinations, INDEX_NAME + end +end diff --git a/db/migrate/20220119141407_add_dependency_proxy_size_to_namespace_statistics.rb b/db/migrate/20220119141407_add_dependency_proxy_size_to_namespace_statistics.rb new file mode 100644 index 00000000000..d8107ad8e21 --- /dev/null +++ b/db/migrate/20220119141407_add_dependency_proxy_size_to_namespace_statistics.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddDependencyProxySizeToNamespaceStatistics < Gitlab::Database::Migration[1.0] + def change + add_column :namespace_statistics, :dependency_proxy_size, :bigint, default: 0, null: false + end +end diff --git a/db/migrate/20220119144253_add_dependency_proxy_size_to_namespace_root_storage_statistics.rb b/db/migrate/20220119144253_add_dependency_proxy_size_to_namespace_root_storage_statistics.rb new file mode 100644 index 00000000000..8218f869ce6 --- /dev/null +++ b/db/migrate/20220119144253_add_dependency_proxy_size_to_namespace_root_storage_statistics.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddDependencyProxySizeToNamespaceRootStorageStatistics < Gitlab::Database::Migration[1.0] + def change + add_column :namespace_root_storage_statistics, :dependency_proxy_size, :bigint, default: 0, null: false + end +end diff --git a/db/migrate/20220119170426_remove_temporary_vulnerability_occurrences_deduplication_index.rb b/db/migrate/20220119170426_remove_temporary_vulnerability_occurrences_deduplication_index.rb new file mode 100644 index 00000000000..26859beb671 --- /dev/null +++ b/db/migrate/20220119170426_remove_temporary_vulnerability_occurrences_deduplication_index.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveTemporaryVulnerabilityOccurrencesDeduplicationIndex < Gitlab::Database::Migration[1.0] + MIGRATION = 'RecalculateVulnerabilitiesOccurrencesUuid' + INDEX_NAME = 'tmp_idx_deduplicate_vulnerability_occurrences' + + disable_ddl_transaction! + + def up + finalize_background_migration(MIGRATION) + + remove_concurrent_index_by_name(:vulnerability_occurrences, INDEX_NAME) + end + + def down + add_concurrent_index :vulnerability_occurrences, + %i[project_id report_type location_fingerprint primary_identifier_id id], + name: INDEX_NAME + end +end diff --git a/db/migrate/20220119220620_add_scan_method_to_dast_site_profile.rb b/db/migrate/20220119220620_add_scan_method_to_dast_site_profile.rb new file mode 100644 index 00000000000..f7b7580d673 --- /dev/null +++ b/db/migrate/20220119220620_add_scan_method_to_dast_site_profile.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddScanMethodToDastSiteProfile < Gitlab::Database::Migration[1.0] + def up + add_column :dast_site_profiles, :scan_method, :integer, limit: 2, default: 0, null: false + end + + def down + remove_column :dast_site_profiles, :scan_method + end +end diff --git a/db/migrate/20220120033115_create_alert_management_alert_metric_images.rb b/db/migrate/20220120033115_create_alert_management_alert_metric_images.rb new file mode 100644 index 00000000000..e98392190f4 --- /dev/null +++ b/db/migrate/20220120033115_create_alert_management_alert_metric_images.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateAlertManagementAlertMetricImages < Gitlab::Database::Migration[1.0] + def up + create_table :alert_management_alert_metric_images do |t| + t.references :alert, null: false, index: true, foreign_key: { to_table: :alert_management_alerts, on_delete: :cascade } + t.timestamps_with_timezone + t.integer :file_store, limit: 2 + t.text :file, limit: 255, null: false + t.text :url, limit: 255 + t.text :url_text, limit: 128 + end + end + + def down + drop_table :alert_management_alert_metric_images, if_exists: true + end +end diff --git a/db/migrate/20220120085655_add_ci_runner_project_index_to_runner_id_and_project_id.rb b/db/migrate/20220120085655_add_ci_runner_project_index_to_runner_id_and_project_id.rb new file mode 100644 index 00000000000..bcf32d2abd0 --- /dev/null +++ b/db/migrate/20220120085655_add_ci_runner_project_index_to_runner_id_and_project_id.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddCiRunnerProjectIndexToRunnerIdAndProjectId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + OLD_INDEX_NAME = 'index_ci_runner_projects_on_runner_id' + NEW_INDEX_NAME = 'index_ci_runner_projects_on_runner_id_and_project_id' + TABLE_NAME = :ci_runner_projects + + def up + add_concurrent_index(TABLE_NAME, [:runner_id, :project_id], name: NEW_INDEX_NAME) + remove_concurrent_index_by_name(TABLE_NAME, OLD_INDEX_NAME) + end + + def down + add_concurrent_index(TABLE_NAME, :runner_id, name: OLD_INDEX_NAME) + remove_concurrent_index_by_name(TABLE_NAME, NEW_INDEX_NAME) + end +end diff --git a/db/migrate/20220120160625_remove_temp_index_on_id_from_vulnerability_occurrences.rb b/db/migrate/20220120160625_remove_temp_index_on_id_from_vulnerability_occurrences.rb new file mode 100644 index 00000000000..747cabcd865 --- /dev/null +++ b/db/migrate/20220120160625_remove_temp_index_on_id_from_vulnerability_occurrences.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveTempIndexOnIdFromVulnerabilityOccurrences < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :vulnerability_occurrences, name: INDEX_NAME + end + + def down + add_concurrent_index :vulnerability_occurrences, :id, where: 'report_type IN (7, 99)', name: INDEX_NAME + end +end diff --git a/db/migrate/20220120211831_temp_index_for_group_namespace_member_backfill.rb b/db/migrate/20220120211831_temp_index_for_group_namespace_member_backfill.rb new file mode 100644 index 00000000000..527d8783a0f --- /dev/null +++ b/db/migrate/20220120211831_temp_index_for_group_namespace_member_backfill.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class TempIndexForGroupNamespaceMemberBackfill < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'tmp_index_for_namespace_id_migration_on_group_members' + + disable_ddl_transaction! + + def up + # Temporary index to be removed in 14.10 + # https://gitlab.com/gitlab-org/gitlab/-/issues/353538 + add_concurrent_index :members, :id, where: "members.member_namespace_id IS NULL and members.type = 'GroupMember'", name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :members, INDEX_NAME + end +end diff --git a/db/migrate/20220124200927_add_index_to_issues.rb b/db/migrate/20220124200927_add_index_to_issues.rb new file mode 100644 index 00000000000..03cdc3ade2c --- /dev/null +++ b/db/migrate/20220124200927_add_index_to_issues.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToIssues < Gitlab::Database::Migration[1.0] + DOWNTIME = false + + disable_ddl_transaction! + + INDEX_NAME = 'index_issues_on_id_and_weight' + + def up + add_concurrent_index :issues, [:id, :weight], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :issues, INDEX_NAME + end +end diff --git a/db/migrate/20220125084127_add_cleanup_attempts_to_loose_foreign_keys_deleted_records.rb b/db/migrate/20220125084127_add_cleanup_attempts_to_loose_foreign_keys_deleted_records.rb new file mode 100644 index 00000000000..e0c80ad79e5 --- /dev/null +++ b/db/migrate/20220125084127_add_cleanup_attempts_to_loose_foreign_keys_deleted_records.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddCleanupAttemptsToLooseForeignKeysDeletedRecords < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def up + add_column :loose_foreign_keys_deleted_records, :cleanup_attempts, :smallint, default: 0 + end + + def down + remove_column :loose_foreign_keys_deleted_records, :cleanup_attempts + end +end diff --git a/db/migrate/20220125122228_add_topics_non_private_projects_count.rb b/db/migrate/20220125122228_add_topics_non_private_projects_count.rb new file mode 100644 index 00000000000..8c7b750d5ff --- /dev/null +++ b/db/migrate/20220125122228_add_topics_non_private_projects_count.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddTopicsNonPrivateProjectsCount < Gitlab::Database::Migration[1.0] + def up + add_column :topics, :non_private_projects_count, :bigint, null: false, default: 0 + end + + def down + remove_column :topics, :non_private_projects_count + end +end diff --git a/db/migrate/20220125122725_add_topics_non_private_projects_count_index.rb b/db/migrate/20220125122725_add_topics_non_private_projects_count_index.rb new file mode 100644 index 00000000000..46b4d298a2e --- /dev/null +++ b/db/migrate/20220125122725_add_topics_non_private_projects_count_index.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTopicsNonPrivateProjectsCountIndex < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_topics_non_private_projects_count' + + disable_ddl_transaction! + + def up + add_concurrent_index :topics, [:non_private_projects_count, :id], order: { non_private_projects_count: :desc }, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :topics, INDEX_NAME + end +end diff --git a/db/migrate/20220125230538_add_compound_index_on_project_id_and_id_for_vulnerabilities.rb b/db/migrate/20220125230538_add_compound_index_on_project_id_and_id_for_vulnerabilities.rb new file mode 100644 index 00000000000..c745fa51328 --- /dev/null +++ b/db/migrate/20220125230538_add_compound_index_on_project_id_and_id_for_vulnerabilities.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddCompoundIndexOnProjectIdAndIdForVulnerabilities < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_vulnerabilities_on_project_id_and_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME + end +end diff --git a/db/migrate/20220126191624_add_scan_file_path_to_dast_site_profile.rb b/db/migrate/20220126191624_add_scan_file_path_to_dast_site_profile.rb new file mode 100644 index 00000000000..eab02663e26 --- /dev/null +++ b/db/migrate/20220126191624_add_scan_file_path_to_dast_site_profile.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class AddScanFilePathToDastSiteProfile < Gitlab::Database::Migration[2.0] + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20221012135524_add_scan_file_path_limit_for_dast_site_profile + def up + add_column :dast_site_profiles, :scan_file_path, :text + end + # rubocop:enable Migration/AddLimitToTextColumns + + def down + remove_column :dast_site_profiles, :scan_file_path, :text + end +end diff --git a/db/migrate/20220128093756_add_ecdsa_sk_and_ed25519_sk_key_restrictions_to_application_settings.rb b/db/migrate/20220128093756_add_ecdsa_sk_and_ed25519_sk_key_restrictions_to_application_settings.rb new file mode 100644 index 00000000000..1acd9599da4 --- /dev/null +++ b/db/migrate/20220128093756_add_ecdsa_sk_and_ed25519_sk_key_restrictions_to_application_settings.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddEcdsaSkAndEd25519SkKeyRestrictionsToApplicationSettings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :application_settings, :ecdsa_sk_key_restriction, :integer, default: 0, null: false + add_column :application_settings, :ed25519_sk_key_restriction, :integer, default: 0, null: false + end +end diff --git a/db/migrate/20220128194722_add_index_on_migration_state_and_import_done_at_to_container_repositories.rb b/db/migrate/20220128194722_add_index_on_migration_state_and_import_done_at_to_container_repositories.rb new file mode 100644 index 00000000000..6c9fb20bbbd --- /dev/null +++ b/db/migrate/20220128194722_add_index_on_migration_state_and_import_done_at_to_container_repositories.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class AddIndexOnMigrationStateAndImportDoneAtToContainerRepositories < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_container_repositories_on_migration_state_import_done_at' + disable_ddl_transaction! + + def up + add_concurrent_index :container_repositories, [:migration_state, :migration_import_done_at], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :container_repositories, INDEX_NAME + end +end diff --git a/db/migrate/20220131135725_add_severity_level_to_merge_requests_compliance_violations.rb b/db/migrate/20220131135725_add_severity_level_to_merge_requests_compliance_violations.rb new file mode 100644 index 00000000000..50aa0121055 --- /dev/null +++ b/db/migrate/20220131135725_add_severity_level_to_merge_requests_compliance_violations.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddSeverityLevelToMergeRequestsComplianceViolations < Gitlab::Database::Migration[1.0] + def change + add_column :merge_requests_compliance_violations, :severity_level, :integer, limit: 2, null: false, default: 0 + end +end diff --git a/db/migrate/20220131192643_add_show_diff_preview_in_email_to_project_settings.rb b/db/migrate/20220131192643_add_show_diff_preview_in_email_to_project_settings.rb new file mode 100644 index 00000000000..1811bf04ee4 --- /dev/null +++ b/db/migrate/20220131192643_add_show_diff_preview_in_email_to_project_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddShowDiffPreviewInEmailToProjectSettings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :project_settings, :show_diff_preview_in_email, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20220201205300_remove_index_for_vulnerability_occurrences.rb b/db/migrate/20220201205300_remove_index_for_vulnerability_occurrences.rb new file mode 100644 index 00000000000..89591d14aae --- /dev/null +++ b/db/migrate/20220201205300_remove_index_for_vulnerability_occurrences.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveIndexForVulnerabilityOccurrences < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_vulnerability_occurrences_on_unique_keys' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME + end + + def down + # no-op + + # The index is UNIQUE so we cannot add it back again + end +end diff --git a/db/migrate/20220202034409_add_tmp_index_on_id_and_migration_state_to_container_repositories.rb b/db/migrate/20220202034409_add_tmp_index_on_id_and_migration_state_to_container_repositories.rb new file mode 100644 index 00000000000..b999c871a3e --- /dev/null +++ b/db/migrate/20220202034409_add_tmp_index_on_id_and_migration_state_to_container_repositories.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddTmpIndexOnIdAndMigrationStateToContainerRepositories < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'tmp_index_container_repositories_on_id_migration_state' + + disable_ddl_transaction! + + # Temporary index to be removed https://gitlab.com/gitlab-org/gitlab/-/issues/351783 + def up + add_concurrent_index :container_repositories, [:id, :migration_state], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :container_repositories, INDEX_NAME + end +end diff --git a/db/migrate/20220202115350_add_migration_indexes_to_container_repositories.rb b/db/migrate/20220202115350_add_migration_indexes_to_container_repositories.rb new file mode 100644 index 00000000000..673d066e3c0 --- /dev/null +++ b/db/migrate/20220202115350_add_migration_indexes_to_container_repositories.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddMigrationIndexesToContainerRepositories < Gitlab::Database::Migration[1.0] + PRE_IMPORTING_INDEX = 'idx_container_repos_on_pre_import_started_at_when_pre_importing' + PRE_IMPORT_DONE_INDEX = 'idx_container_repos_on_pre_import_done_at_when_pre_import_done' + IMPORTING_INDEX = 'idx_container_repos_on_import_started_at_when_importing' + + disable_ddl_transaction! + + def up + add_concurrent_index :container_repositories, :migration_pre_import_started_at, name: PRE_IMPORTING_INDEX, where: "migration_state = 'pre_importing'" + add_concurrent_index :container_repositories, :migration_pre_import_done_at, name: PRE_IMPORT_DONE_INDEX, where: "migration_state = 'pre_import_done'" + add_concurrent_index :container_repositories, :migration_import_started_at, name: IMPORTING_INDEX, where: "migration_state = 'importing'" + end + + def down + remove_concurrent_index_by_name :container_repositories, IMPORTING_INDEX + remove_concurrent_index_by_name :container_repositories, PRE_IMPORT_DONE_INDEX + remove_concurrent_index_by_name :container_repositories, PRE_IMPORTING_INDEX + end +end diff --git a/db/migrate/20220203074916_add_topics_lower_name_index.rb b/db/migrate/20220203074916_add_topics_lower_name_index.rb new file mode 100644 index 00000000000..721abf66c67 --- /dev/null +++ b/db/migrate/20220203074916_add_topics_lower_name_index.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTopicsLowerNameIndex < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_topics_on_lower_name' + + disable_ddl_transaction! + + def up + add_concurrent_index :topics, 'lower(name)', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :topics, INDEX_NAME + end +end diff --git a/db/migrate/20220203091304_fix_unique_packages_index_excluding_pending_destruction_status.rb b/db/migrate/20220203091304_fix_unique_packages_index_excluding_pending_destruction_status.rb new file mode 100644 index 00000000000..c30d8de23db --- /dev/null +++ b/db/migrate/20220203091304_fix_unique_packages_index_excluding_pending_destruction_status.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class FixUniquePackagesIndexExcludingPendingDestructionStatus < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + GO_UNIQUE_INDEX_NAME = 'index_packages_on_project_id_name_version_unique_when_golang' + GENERIC_UNIQUE_INDEX_NAME = 'index_packages_on_project_id_name_version_unique_when_generic' + HELM_UNIQUE_INDEX_NAME = 'index_packages_on_project_id_name_version_unique_when_helm' + + NEW_GO_UNIQUE_INDEX_NAME = 'idx_packages_on_project_id_name_version_unique_when_golang' + NEW_GENERIC_UNIQUE_INDEX_NAME = 'idx_packages_on_project_id_name_version_unique_when_generic' + NEW_HELM_UNIQUE_INDEX_NAME = 'idx_packages_on_project_id_name_version_unique_when_helm' + + def up + add_concurrent_index :packages_packages, [:project_id, :name, :version], unique: true, name: NEW_GO_UNIQUE_INDEX_NAME, where: 'package_type = 8 AND status != 4' + add_concurrent_index :packages_packages, [:project_id, :name, :version], unique: true, name: NEW_GENERIC_UNIQUE_INDEX_NAME, where: 'package_type = 7 AND status != 4' + add_concurrent_index :packages_packages, [:project_id, :name, :version], unique: true, name: NEW_HELM_UNIQUE_INDEX_NAME, where: 'package_type = 11 AND status != 4' + + remove_concurrent_index_by_name :packages_packages, GO_UNIQUE_INDEX_NAME + remove_concurrent_index_by_name :packages_packages, GENERIC_UNIQUE_INDEX_NAME + remove_concurrent_index_by_name :packages_packages, HELM_UNIQUE_INDEX_NAME + end + + def down + # no-op + # We can't guarantee that the old index can be recreated since it targets a set larger that the new index. + end +end diff --git a/db/migrate/20220203123333_add_batched_migration_max_batch.rb b/db/migrate/20220203123333_add_batched_migration_max_batch.rb new file mode 100644 index 00000000000..d16c6dd4110 --- /dev/null +++ b/db/migrate/20220203123333_add_batched_migration_max_batch.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddBatchedMigrationMaxBatch < Gitlab::Database::Migration[1.0] + def change + add_column :batched_background_migrations, :max_batch_size, :integer + end +end diff --git a/db/migrate/20220203133652_add_legacy_open_source_license_available_to_project_settings.rb b/db/migrate/20220203133652_add_legacy_open_source_license_available_to_project_settings.rb new file mode 100644 index 00000000000..47f92fae496 --- /dev/null +++ b/db/migrate/20220203133652_add_legacy_open_source_license_available_to_project_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddLegacyOpenSourceLicenseAvailableToProjectSettings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + add_column :project_settings, :legacy_open_source_license_available, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20220203134942_add_hidden_to_projects.rb b/db/migrate/20220203134942_add_hidden_to_projects.rb new file mode 100644 index 00000000000..7046d641289 --- /dev/null +++ b/db/migrate/20220203134942_add_hidden_to_projects.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddHiddenToProjects < Gitlab::Database::Migration[1.0] + DOWNTIME = false + + enable_lock_retries! + + def change + add_column :projects, :hidden, :boolean, default: false, null: false # rubocop: disable Migration/AddColumnsToWideTables + end +end diff --git a/db/migrate/20220204093120_create_analytics_cycle_analytics_aggregations.rb b/db/migrate/20220204093120_create_analytics_cycle_analytics_aggregations.rb new file mode 100644 index 00000000000..0339e16a85b --- /dev/null +++ b/db/migrate/20220204093120_create_analytics_cycle_analytics_aggregations.rb @@ -0,0 +1,43 @@ +# frozen_string_literal: true +class CreateAnalyticsCycleAnalyticsAggregations < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def up + create_table :analytics_cycle_analytics_aggregations, id: false do |t| + t.references :group, index: false, null: false, foreign_key: { to_table: :namespaces, on_delete: :cascade } + t.integer :incremental_runtimes_in_seconds, array: true, default: [], null: false + t.integer :incremental_processed_records, array: true, default: [], null: false + t.integer :last_full_run_runtimes_in_seconds, array: true, default: [], null: false + t.integer :last_full_run_processed_records, array: true, default: [], null: false + t.integer :last_incremental_issues_id + t.integer :last_incremental_merge_requests_id + t.integer :last_full_run_issues_id + t.integer :last_full_run_merge_requests_id + + t.datetime_with_timezone :last_incremental_run_at + t.datetime_with_timezone :last_incremental_issues_updated_at + t.datetime_with_timezone :last_incremental_merge_requests_updated_at + t.datetime_with_timezone :last_full_run_at + t.datetime_with_timezone :last_full_run_issues_updated_at + t.datetime_with_timezone :last_full_run_mrs_updated_at + t.datetime_with_timezone :last_consistency_check_updated_at + + t.boolean :enabled, default: true, null: false + + t.index :last_incremental_run_at, where: 'enabled IS TRUE', name: 'ca_aggregations_last_incremental_run_at', order: { last_incremental_run_at: 'ASC NULLS FIRST' } + t.index :last_full_run_at, where: 'enabled IS TRUE', name: 'ca_aggregations_last_full_run_at', order: { last_full_run_at: 'ASC NULLS FIRST' } + t.index :last_consistency_check_updated_at, where: 'enabled IS TRUE', name: 'ca_aggregations_last_consistency_check_updated_at', order: { last_consistency_check_updated_at: 'ASC NULLS FIRST' } + + t.check_constraint 'CARDINALITY(incremental_runtimes_in_seconds) <= 10' + t.check_constraint 'CARDINALITY(incremental_processed_records) <= 10' + t.check_constraint 'CARDINALITY(last_full_run_runtimes_in_seconds) <= 10' + t.check_constraint 'CARDINALITY(last_full_run_processed_records) <= 10' + end + + execute("ALTER TABLE analytics_cycle_analytics_aggregations ADD PRIMARY KEY (group_id)") + end + + def down + drop_table :analytics_cycle_analytics_aggregations + end +end diff --git a/db/migrate/20220204154220_add_index_on_greatest_done_at_to_container_repositories.rb b/db/migrate/20220204154220_add_index_on_greatest_done_at_to_container_repositories.rb new file mode 100644 index 00000000000..455a8478cc4 --- /dev/null +++ b/db/migrate/20220204154220_add_index_on_greatest_done_at_to_container_repositories.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexOnGreatestDoneAtToContainerRepositories < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_container_repositories_on_greatest_done_at' + disable_ddl_transaction! + + def up + add_concurrent_index :container_repositories, + 'GREATEST(migration_pre_import_done_at, migration_import_done_at, migration_aborted_at)', + where: "migration_state IN ('import_done', 'pre_import_done', 'import_aborted')", + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :container_repositories, INDEX_NAME + end +end diff --git a/db/migrate/20220204193000_add_integrations_encrypted_properties.rb b/db/migrate/20220204193000_add_integrations_encrypted_properties.rb new file mode 100644 index 00000000000..7df88b68657 --- /dev/null +++ b/db/migrate/20220204193000_add_integrations_encrypted_properties.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class AddIntegrationsEncryptedProperties < Gitlab::Database::Migration[1.0] + def change + add_column :integrations, :encrypted_properties, :binary + add_column :integrations, :encrypted_properties_iv, :binary + end +end diff --git a/db/migrate/20220207083129_add_users_get_by_id_limit_to_application_setting.rb b/db/migrate/20220207083129_add_users_get_by_id_limit_to_application_setting.rb new file mode 100644 index 00000000000..cdf2aced213 --- /dev/null +++ b/db/migrate/20220207083129_add_users_get_by_id_limit_to_application_setting.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddUsersGetByIdLimitToApplicationSetting < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def up + add_column :application_settings, :users_get_by_id_limit, :integer, null: false, default: 300 + add_column :application_settings, :users_get_by_id_limit_allowlist, :text, array: true, limit: 255, null: false, default: [] + end + + def down + remove_column :application_settings, :users_get_by_id_limit + remove_column :application_settings, :users_get_by_id_limit_allowlist + end +end diff --git a/db/migrate/20220208170445_add_not_valid_foreign_key_to_ci_builds_runner_id.rb b/db/migrate/20220208170445_add_not_valid_foreign_key_to_ci_builds_runner_id.rb new file mode 100644 index 00000000000..9b2ba17e068 --- /dev/null +++ b/db/migrate/20220208170445_add_not_valid_foreign_key_to_ci_builds_runner_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddNotValidForeignKeyToCiBuildsRunnerId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :ci_builds, :ci_runners, column: :runner_id, on_delete: :nullify, validate: false + end + + def down + with_lock_retries do + remove_foreign_key_if_exists :ci_builds, column: :runner_id + end + end +end diff --git a/db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb b/db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb new file mode 100644 index 00000000000..b01dbe642e2 --- /dev/null +++ b/db/migrate/20220208171826_update_default_scan_method_of_dast_site_profile.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class UpdateDefaultScanMethodOfDastSiteProfile < Gitlab::Database::Migration[1.0] + BATCH_SIZE = 500 + + disable_ddl_transaction! + + def up + each_batch_range('dast_site_profiles', scope: ->(table) { table.where(target_type: 1) }, of: BATCH_SIZE) do |min, max| + execute <<~SQL + UPDATE dast_site_profiles + SET scan_method = 1 + WHERE id BETWEEN #{min} AND #{max} + SQL + end + end + + def down + # noop + end +end diff --git a/db/migrate/20220211090920_cleanup_populate_topics_non_private_projects_count.rb b/db/migrate/20220211090920_cleanup_populate_topics_non_private_projects_count.rb new file mode 100644 index 00000000000..5ab8feb2195 --- /dev/null +++ b/db/migrate/20220211090920_cleanup_populate_topics_non_private_projects_count.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CleanupPopulateTopicsNonPrivateProjectsCount < Gitlab::Database::Migration[1.0] + MIGRATION = 'PopulateTopicsNonPrivateProjectsCount' + + disable_ddl_transaction! + + def up + finalize_background_migration(MIGRATION) + end + + def down + # no-op + end +end diff --git a/db/migrate/20220211125954_create_related_epic_links.rb b/db/migrate/20220211125954_create_related_epic_links.rb new file mode 100644 index 00000000000..c06a68a9dd2 --- /dev/null +++ b/db/migrate/20220211125954_create_related_epic_links.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateRelatedEpicLinks < Gitlab::Database::Migration[1.0] + def up + create_table :related_epic_links do |t| + t.references :source, index: true, foreign_key: { to_table: :epics, on_delete: :cascade }, null: false + t.references :target, index: true, foreign_key: { to_table: :epics, on_delete: :cascade }, null: false + t.timestamps_with_timezone null: false + t.integer :link_type, null: false, default: 0, limit: 2 + + t.index [:source_id, :target_id], unique: true + end + end + + def down + drop_table :related_epic_links + end +end diff --git a/db/migrate/20220211214605_update_integrations_trigger_type_new_on_insert_null_safe.rb b/db/migrate/20220211214605_update_integrations_trigger_type_new_on_insert_null_safe.rb new file mode 100644 index 00000000000..7a60ea48f40 --- /dev/null +++ b/db/migrate/20220211214605_update_integrations_trigger_type_new_on_insert_null_safe.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class UpdateIntegrationsTriggerTypeNewOnInsertNullSafe < Gitlab::Database::Migration[1.0] + include Gitlab::Database::SchemaHelpers + + FUNCTION_NAME = 'integrations_set_type_new' + + def up + # Update `type_new` dynamically based on `type`, if `type_new` is null + # and `type` dynamically based on `type_new`, if `type` is null. + # + # The old class names are in the format `AbcService`, and the new ones `Integrations::Abc`. + create_trigger_function(FUNCTION_NAME, replace: true) do + <<~SQL.squish + UPDATE integrations + SET type_new = COALESCE(NEW.type_new, regexp_replace(NEW.type, '\\A(.+)Service\\Z', 'Integrations::\\1')) + , type = COALESCE(NEW.type, regexp_replace(NEW.type_new, '\\AIntegrations::(.+)\\Z', '\\1Service')) + WHERE integrations.id = NEW.id; + RETURN NULL; + SQL + end + end + + def down + # Update `type_new` dynamically based on `type`. + # + # The old class names are in the format `AbcService`, and the new ones `Integrations::Abc`. + create_trigger_function(FUNCTION_NAME, replace: true) do + <<~SQL + UPDATE integrations SET type_new = regexp_replace(NEW.type, '\\A(.+)Service\\Z', 'Integrations::\\1') + WHERE integrations.id = NEW.id; + RETURN NULL; + SQL + end + end +end diff --git a/db/migrate/20220213100000_remove_integration_type_triggers.rb b/db/migrate/20220213100000_remove_integration_type_triggers.rb new file mode 100644 index 00000000000..137e5648125 --- /dev/null +++ b/db/migrate/20220213100000_remove_integration_type_triggers.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +class RemoveIntegrationTypeTriggers < Gitlab::Database::Migration[1.0] + include Gitlab::Database::SchemaHelpers + + FUNCTION_NAME = 'integrations_set_type_new' + TRIGGER_ON_INSERT_NAME = 'trigger_type_new_on_insert' + + def up + drop_trigger(:integrations, TRIGGER_ON_INSERT_NAME) + drop_function(FUNCTION_NAME) + end + + def down + create_trigger_function(FUNCTION_NAME, replace: true) do + <<~SQL.squish + UPDATE integrations + SET type_new = COALESCE(NEW.type_new, regexp_replace(NEW.type, '\\A(.+)Service\\Z', 'Integrations::\\1')) + , type = COALESCE(NEW.type, regexp_replace(NEW.type_new, '\\AIntegrations::(.+)\\Z', '\\1Service')) + WHERE integrations.id = NEW.id; + RETURN NULL; + SQL + end + + execute(<<~SQL) + CREATE TRIGGER #{TRIGGER_ON_INSERT_NAME} + AFTER INSERT ON integrations + FOR EACH ROW + EXECUTE FUNCTION #{FUNCTION_NAME}(); + SQL + end +end diff --git a/db/migrate/20220215164709_update_application_settings_container_registry_exp_pol_worker_capacity_default.rb b/db/migrate/20220215164709_update_application_settings_container_registry_exp_pol_worker_capacity_default.rb new file mode 100644 index 00000000000..4b743f84c4d --- /dev/null +++ b/db/migrate/20220215164709_update_application_settings_container_registry_exp_pol_worker_capacity_default.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true +class UpdateApplicationSettingsContainerRegistryExpPolWorkerCapacityDefault < Gitlab::Database::Migration[1.0] + class Settings < ActiveRecord::Base + self.table_name = 'application_settings' + end + + def up + change_column_default(:application_settings, :container_registry_expiration_policies_worker_capacity, from: 0, to: 4) + + current_settings = Settings.first + + if current_settings&.container_registry_expiration_policies_worker_capacity == 0 + current_settings.update!(container_registry_expiration_policies_worker_capacity: 4) + end + end + + def down + change_column_default(:application_settings, :container_registry_expiration_policies_worker_capacity, from: 4, to: 0) + end +end diff --git a/db/migrate/20220216110023_create_saved_replies.rb b/db/migrate/20220216110023_create_saved_replies.rb new file mode 100644 index 00000000000..e4b6c039dee --- /dev/null +++ b/db/migrate/20220216110023_create_saved_replies.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class CreateSavedReplies < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def up + create_table :saved_replies do |t| + t.references :user, index: false, null: false, foreign_key: { on_delete: :cascade } + t.timestamps_with_timezone null: false + t.text :name, null: false, limit: 255 + t.text :content, null: false, limit: 10000 + + t.index [:user_id, :name], name: 'index_saved_replies_on_name_text_pattern_ops', unique: true, opclass: { name: :text_pattern_ops } + end + end + + def down + drop_table :saved_replies, if_exists: true + end +end diff --git a/db/migrate/20220217100008_add_container_registry_expiration_policies_caching_to_application_settings.rb b/db/migrate/20220217100008_add_container_registry_expiration_policies_caching_to_application_settings.rb new file mode 100644 index 00000000000..bd5b13ffa1c --- /dev/null +++ b/db/migrate/20220217100008_add_container_registry_expiration_policies_caching_to_application_settings.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddContainerRegistryExpirationPoliciesCachingToApplicationSettings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def up + add_column :application_settings, :container_registry_expiration_policies_caching, :boolean, null: false, default: true + end + + def down + remove_column :application_settings, :container_registry_expiration_policies_caching + end +end diff --git a/db/migrate/20220217113058_add_status_to_status_check_responses.rb b/db/migrate/20220217113058_add_status_to_status_check_responses.rb new file mode 100644 index 00000000000..2f118677883 --- /dev/null +++ b/db/migrate/20220217113058_add_status_to_status_check_responses.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddStatusToStatusCheckResponses < Gitlab::Database::Migration[1.0] + def change + add_column :status_check_responses, :status, :integer, default: 0, null: false, limit: 2 + end +end diff --git a/db/migrate/20220221102333_change_maintainer_note_limit_in_ci_runner.rb b/db/migrate/20220221102333_change_maintainer_note_limit_in_ci_runner.rb new file mode 100644 index 00000000000..a3d71a060b8 --- /dev/null +++ b/db/migrate/20220221102333_change_maintainer_note_limit_in_ci_runner.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class ChangeMaintainerNoteLimitInCiRunner < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit( + :ci_runners, + :maintainer_note, + 1024, + constraint_name: check_constraint_name(:ci_runners, :maintainer_note, 'max_length_1MB') + ) + + remove_text_limit( + :ci_runners, + :maintainer_note, + constraint_name: check_constraint_name(:ci_runners, :maintainer_note, 'max_length') + ) + end + + def down + # no-op: Danger of failing if there are records with length(maintainer_note) > 255 + end +end diff --git a/db/migrate/20220222072536_add_target_access_levels_to_broadcast_messages.rb b/db/migrate/20220222072536_add_target_access_levels_to_broadcast_messages.rb new file mode 100644 index 00000000000..fd353843878 --- /dev/null +++ b/db/migrate/20220222072536_add_target_access_levels_to_broadcast_messages.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddTargetAccessLevelsToBroadcastMessages < Gitlab::Database::Migration[1.0] + def up + add_column :broadcast_messages, :target_access_levels, :integer, if_not_exists: true, array: true, null: false, default: [] + end + + def down + remove_column :broadcast_messages, :target_access_levels, if_exists: true + end +end diff --git a/db/migrate/20220301002101_add_security_orchestration_policy_configuration_namespace_reference.rb b/db/migrate/20220301002101_add_security_orchestration_policy_configuration_namespace_reference.rb new file mode 100644 index 00000000000..42828086310 --- /dev/null +++ b/db/migrate/20220301002101_add_security_orchestration_policy_configuration_namespace_reference.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddSecurityOrchestrationPolicyConfigurationNamespaceReference < Gitlab::Database::Migration[1.0] + def up + add_column :security_orchestration_policy_configurations, :namespace_id, :bigint + end + + def down + remove_column :security_orchestration_policy_configurations, :namespace_id + end +end diff --git a/db/migrate/20220301003502_add_security_orchestration_policy_configuration_namespace_index.rb b/db/migrate/20220301003502_add_security_orchestration_policy_configuration_namespace_index.rb new file mode 100644 index 00000000000..de6b36faa65 --- /dev/null +++ b/db/migrate/20220301003502_add_security_orchestration_policy_configuration_namespace_index.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class AddSecurityOrchestrationPolicyConfigurationNamespaceIndex < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + INDEX_NAME = 'partial_index_sop_configs_on_namespace_id' + + def up + add_concurrent_index :security_orchestration_policy_configurations, :namespace_id, unique: true, name: INDEX_NAME, where: 'namespace_id IS NOT NULL' + add_concurrent_foreign_key :security_orchestration_policy_configurations, :namespaces, column: :namespace_id, on_delete: :cascade, reverse_lock_order: true + + add_check_constraint :security_orchestration_policy_configurations, + "((project_id IS NULL) != (namespace_id IS NULL))", + :cop_configs_project_or_namespace_existence + end + + def down + exec_query 'DELETE FROM security_orchestration_policy_configurations WHERE namespace_id IS NOT NULL' + + remove_check_constraint :security_orchestration_policy_configurations, :cop_configs_project_or_namespace_existence + + with_lock_retries do + remove_foreign_key_if_exists :security_orchestration_policy_configurations, column: :namespace_id + end + + remove_concurrent_index_by_name :security_orchestration_policy_configurations, INDEX_NAME + end +end diff --git a/db/migrate/20220301091503_add_not_null_constraint_to_security_policy_configurations.rb b/db/migrate/20220301091503_add_not_null_constraint_to_security_policy_configurations.rb new file mode 100644 index 00000000000..79ffcb2cbb3 --- /dev/null +++ b/db/migrate/20220301091503_add_not_null_constraint_to_security_policy_configurations.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class AddNotNullConstraintToSecurityPolicyConfigurations < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + change_column_null :security_orchestration_policy_configurations, :project_id, true + end + + def down + exec_query 'DELETE FROM security_orchestration_policy_configurations WHERE project_id IS NULL' + change_column_null :security_orchestration_policy_configurations, :project_id, false + end +end diff --git a/db/migrate/20220301175104_change_security_orchestration_policy_configuration_project_index.rb b/db/migrate/20220301175104_change_security_orchestration_policy_configuration_project_index.rb new file mode 100644 index 00000000000..53706d46979 --- /dev/null +++ b/db/migrate/20220301175104_change_security_orchestration_policy_configuration_project_index.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class ChangeSecurityOrchestrationPolicyConfigurationProjectIndex < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + OLD_INDEX_NAME = 'index_sop_configs_on_project_id' + NEW_INDEX_NAME = 'partial_index_sop_configs_on_project_id' + + def up + add_concurrent_index :security_orchestration_policy_configurations, :project_id, unique: true, name: NEW_INDEX_NAME, where: 'project_id IS NOT NULL' + remove_concurrent_index_by_name :security_orchestration_policy_configurations, OLD_INDEX_NAME + end + + def down + add_concurrent_index :security_orchestration_policy_configurations, :project_id, unique: true, name: OLD_INDEX_NAME + remove_concurrent_index_by_name :security_orchestration_policy_configurations, NEW_INDEX_NAME + end +end diff --git a/db/migrate/20220301175426_create_project_build_artifacts_size_refresh.rb b/db/migrate/20220301175426_create_project_build_artifacts_size_refresh.rb new file mode 100644 index 00000000000..fd01437d045 --- /dev/null +++ b/db/migrate/20220301175426_create_project_build_artifacts_size_refresh.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class CreateProjectBuildArtifactsSizeRefresh < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + CREATED_STATE = 1 + + def change + create_table :project_build_artifacts_size_refreshes do |t| + t.references :project, index: { unique: true }, foreign_key: { on_delete: :cascade }, null: false + t.bigint :last_job_artifact_id, null: true + t.integer :state, null: false, default: CREATED_STATE, limit: 1 + t.datetime_with_timezone :refresh_started_at, null: true + t.timestamps_with_timezone null: false + + # We will use this index for 2 purposes: + # - for finding rows with state = :waiting + # - for finding rows with state = :running and updated_at < x.days.ago + # which we can use to find jobs that were not able to complete and considered + # stale so we can retry + t.index [:state, :updated_at], name: 'idx_build_artifacts_size_refreshes_state_updated_at' + end + end +end diff --git a/db/migrate/20220302110724_add_group_features_table.rb b/db/migrate/20220302110724_add_group_features_table.rb new file mode 100644 index 00000000000..9d9204afec2 --- /dev/null +++ b/db/migrate/20220302110724_add_group_features_table.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddGroupFeaturesTable < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def up + create_table :group_features, id: false do |t| + t.references :group, index: false, foreign_key: { to_table: :namespaces, on_delete: :cascade }, null: false + t.timestamps_with_timezone null: false + t.integer :wiki_access_level, default: Featurable::ENABLED, null: false, limit: 2 + end + + execute('ALTER TABLE group_features ADD PRIMARY KEY (group_id)') + end + + def down + drop_table :group_features + end +end diff --git a/db/migrate/20220303190555_add_comment_to_deployment_approvals.rb b/db/migrate/20220303190555_add_comment_to_deployment_approvals.rb new file mode 100644 index 00000000000..56b873c009a --- /dev/null +++ b/db/migrate/20220303190555_add_comment_to_deployment_approvals.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddCommentToDeploymentApprovals < Gitlab::Database::Migration[1.0] + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20220303191047_add_text_limit_to_deployment_approvals_comment + def change + add_column :deployment_approvals, :comment, :text + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20220303191047_add_text_limit_to_deployment_approvals_comment.rb b/db/migrate/20220303191047_add_text_limit_to_deployment_approvals_comment.rb new file mode 100644 index 00000000000..70c7f5f3a7b --- /dev/null +++ b/db/migrate/20220303191047_add_text_limit_to_deployment_approvals_comment.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToDeploymentApprovalsComment < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :deployment_approvals, :comment, 255 + end + + def down + remove_text_limit :deployment_approvals, :comment + end +end diff --git a/db/migrate/20220304052335_remove_not_null_contraint_on_title_from_sprints.rb b/db/migrate/20220304052335_remove_not_null_contraint_on_title_from_sprints.rb new file mode 100644 index 00000000000..f429303ab83 --- /dev/null +++ b/db/migrate/20220304052335_remove_not_null_contraint_on_title_from_sprints.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveNotNullContraintOnTitleFromSprints < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def up + change_column_null :sprints, :title, true + end + + def down + execute <<~SQL + UPDATE sprints SET title = id WHERE title IS NULL + SQL + + change_column_null :sprints, :title, false + end +end diff --git a/db/migrate/20220304061631_remove_unique_index_for_sprints_on_iterations_cadence_id_and_title.rb b/db/migrate/20220304061631_remove_unique_index_for_sprints_on_iterations_cadence_id_and_title.rb new file mode 100644 index 00000000000..8c223bbce01 --- /dev/null +++ b/db/migrate/20220304061631_remove_unique_index_for_sprints_on_iterations_cadence_id_and_title.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveUniqueIndexForSprintsOnIterationsCadenceIdAndTitle < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_sprints_on_iterations_cadence_id_and_title' + + def up + remove_concurrent_index_by_name :sprints, INDEX_NAME + end + + def down + add_concurrent_index :sprints, [:iterations_cadence_id, :title], name: INDEX_NAME, unique: true + end +end diff --git a/db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb b/db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb new file mode 100644 index 00000000000..34a357bdc5c --- /dev/null +++ b/db/migrate/20220304062107_remove_unique_index_for_sprints_on_project_id_and_title.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveUniqueIndexForSprintsOnProjectIdAndTitle < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_sprints_on_project_id_and_title' + + def up + remove_concurrent_index_by_name :sprints, INDEX_NAME + end + + def down + add_concurrent_index :sprints, [:project_id, :title], where: "project_id IS NOT NULL", name: INDEX_NAME, unique: true + end +end diff --git a/db/migrate/20220304152729_add_default_to_required_python_on_packages_pypi_metadata.rb b/db/migrate/20220304152729_add_default_to_required_python_on_packages_pypi_metadata.rb new file mode 100644 index 00000000000..56297565cb4 --- /dev/null +++ b/db/migrate/20220304152729_add_default_to_required_python_on_packages_pypi_metadata.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddDefaultToRequiredPythonOnPackagesPypiMetadata < Gitlab::Database::Migration[1.0] + def up + change_column_default(:packages_pypi_metadata, :required_python, '') + end + + def down + change_column_default(:packages_pypi_metadata, :required_python, nil) + end +end diff --git a/db/migrate/20220307203458_rename_user_email_lookup_limit_setting_to_search_settings.rb b/db/migrate/20220307203458_rename_user_email_lookup_limit_setting_to_search_settings.rb new file mode 100644 index 00000000000..62fe55b22f2 --- /dev/null +++ b/db/migrate/20220307203458_rename_user_email_lookup_limit_setting_to_search_settings.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RenameUserEmailLookupLimitSettingToSearchSettings < Gitlab::Database::Migration[1.0] + def up + add_column :application_settings, :search_rate_limit, :integer, null: false, default: 30 + add_column :application_settings, :search_rate_limit_unauthenticated, :integer, null: false, default: 10 + end + + def down + remove_column :application_settings, :search_rate_limit + remove_column :application_settings, :search_rate_limit_unauthenticated + end +end diff --git a/db/migrate/20220309100648_add_time_to_restore_service_dora_metric.rb b/db/migrate/20220309100648_add_time_to_restore_service_dora_metric.rb new file mode 100644 index 00000000000..5cb49a9899a --- /dev/null +++ b/db/migrate/20220309100648_add_time_to_restore_service_dora_metric.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddTimeToRestoreServiceDoraMetric < Gitlab::Database::Migration[1.0] + def change + add_column :dora_daily_metrics, :time_to_restore_service_in_seconds, :integer + end +end diff --git a/db/migrate/20220310011530_add_database_grafana_config_to_application_settings.rb b/db/migrate/20220310011530_add_database_grafana_config_to_application_settings.rb new file mode 100644 index 00000000000..7752fbba12f --- /dev/null +++ b/db/migrate/20220310011530_add_database_grafana_config_to_application_settings.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddDatabaseGrafanaConfigToApplicationSettings < Gitlab::Database::Migration[1.0] + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20220307002607_add_text_limit_to_db_reindexing_grafana_application_settings + def change + add_column :application_settings, :encrypted_database_grafana_api_key, :binary + add_column :application_settings, :encrypted_database_grafana_api_key_iv, :binary + add_column :application_settings, :database_grafana_api_url, :text + add_column :application_settings, :database_grafana_tag, :text + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20220310011613_add_text_limit_to_database_grafana_application_settings.rb b/db/migrate/20220310011613_add_text_limit_to_database_grafana_application_settings.rb new file mode 100644 index 00000000000..72bcf493d6e --- /dev/null +++ b/db/migrate/20220310011613_add_text_limit_to_database_grafana_application_settings.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTextLimitToDatabaseGrafanaApplicationSettings < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :application_settings, :database_grafana_api_url, 255 + add_text_limit :application_settings, :database_grafana_tag, 255 + end + + def down + remove_text_limit :application_settings, :database_grafana_tag + remove_text_limit :application_settings, :database_grafana_api_url + end +end diff --git a/db/migrate/20220310101118_update_holder_name_limit.rb b/db/migrate/20220310101118_update_holder_name_limit.rb new file mode 100644 index 00000000000..55eb8f75d70 --- /dev/null +++ b/db/migrate/20220310101118_update_holder_name_limit.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class UpdateHolderNameLimit < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_text_limit :user_credit_card_validations, :holder_name, 50, constraint_name: new_constraint_name + remove_text_limit :user_credit_card_validations, :holder_name, constraint_name: old_constraint_name + end + + def down + add_text_limit :user_credit_card_validations, :holder_name, 26, validate: false, constraint_name: old_constraint_name + remove_text_limit :user_credit_card_validations, :holder_name, constraint_name: new_constraint_name + end + + private + + def old_constraint_name + check_constraint_name(:user_credit_card_validations, :holder_name, 'max_length') + end + + def new_constraint_name + check_constraint_name(:user_credit_card_validations, :holder_name, 'max_length_50') + end +end diff --git a/db/migrate/20220314094841_add_package_registry_access_level_into_project_features.rb b/db/migrate/20220314094841_add_package_registry_access_level_into_project_features.rb new file mode 100644 index 00000000000..4effdfa6a5e --- /dev/null +++ b/db/migrate/20220314094841_add_package_registry_access_level_into_project_features.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddPackageRegistryAccessLevelIntoProjectFeatures < Gitlab::Database::Migration[1.0] + DISABLED = 0 # ProjectFeature::DISABLED + + def up + add_column :project_features, :package_registry_access_level, :integer, default: DISABLED, null: false + end + + def down + remove_column :project_features, :package_registry_access_level + end +end diff --git a/db/migrate/20220314184009_create_protected_environment_approval_rules.rb b/db/migrate/20220314184009_create_protected_environment_approval_rules.rb new file mode 100644 index 00000000000..f0db2c004ed --- /dev/null +++ b/db/migrate/20220314184009_create_protected_environment_approval_rules.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class CreateProtectedEnvironmentApprovalRules < Gitlab::Database::Migration[1.0] + def up + create_table :protected_environment_approval_rules do |t| + t.references :protected_environment, + index: { name: :index_approval_rule_on_protected_environment_id }, + foreign_key: { to_table: :protected_environments, on_delete: :cascade }, + null: false + + t.bigint :user_id + t.bigint :group_id + t.timestamps_with_timezone null: false + t.integer :access_level, limit: 2 + t.integer :required_approvals, null: false, limit: 2 + + t.index :user_id + t.index :group_id + + t.check_constraint "((access_level IS NOT NULL) AND (group_id IS NULL) AND (user_id IS NULL)) OR " \ + "((user_id IS NOT NULL) AND (access_level IS NULL) AND (group_id IS NULL)) OR " \ + "((group_id IS NOT NULL) AND (user_id IS NULL) AND (access_level IS NULL))" + t.check_constraint "required_approvals > 0" + end + end + + def down + drop_table :protected_environment_approval_rules + end +end diff --git a/db/post_migrate/20211202145237_add_todos_project_and_id_index.rb b/db/post_migrate/20211202145237_add_todos_project_and_id_index.rb new file mode 100644 index 00000000000..69f7822c057 --- /dev/null +++ b/db/post_migrate/20211202145237_add_todos_project_and_id_index.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddTodosProjectAndIdIndex < Gitlab::Database::Migration[1.0] + # When using the methods "add_concurrent_index" or "remove_concurrent_index" + # you must disable the use of transactions + # as these methods can not run in an existing transaction. + # When using "add_concurrent_index" or "remove_concurrent_index" methods make sure + # that either of them is the _only_ method called in the migration, + # any other changes should go in a separate migration. + # This ensures that upon failure _only_ the index creation or removing fails + # and can be retried or reverted easily. + # + # To disable transactions uncomment the following line and remove these + # comments: + disable_ddl_transaction! + + NEW_INDEX_NAME = 'index_todos_on_project_id_and_id' + OLD_INDEX_NAME = 'index_todos_on_project_id' + + def up + add_concurrent_index :todos, [:project_id, :id], name: NEW_INDEX_NAME + remove_concurrent_index_by_name :todos, OLD_INDEX_NAME + end + + def down + add_concurrent_index :todos, :project_id, name: OLD_INDEX_NAME + remove_concurrent_index_by_name :todos, NEW_INDEX_NAME + end +end diff --git a/db/post_migrate/20211203091642_add_index_to_projects_on_marked_for_deletion_at.rb b/db/post_migrate/20211203091642_add_index_to_projects_on_marked_for_deletion_at.rb new file mode 100644 index 00000000000..56b0df1f393 --- /dev/null +++ b/db/post_migrate/20211203091642_add_index_to_projects_on_marked_for_deletion_at.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToProjectsOnMarkedForDeletionAt < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_projects_not_aimed_for_deletion' + + def up + add_concurrent_index :projects, :id, where: 'marked_for_deletion_at IS NULL', name: INDEX_NAME + end + + def down + remove_concurrent_index :projects, :id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20211206073851_create_calendar_events_index_synchronously.rb b/db/post_migrate/20211206073851_create_calendar_events_index_synchronously.rb new file mode 100644 index 00000000000..020dceac004 --- /dev/null +++ b/db/post_migrate/20211206073851_create_calendar_events_index_synchronously.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CreateCalendarEventsIndexSynchronously < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_events_author_id_project_id_action_target_type_created_at' + + def up + add_concurrent_index :events, [:author_id, :project_id, :action, :target_type, :created_at], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :events, INDEX_NAME + end +end diff --git a/db/post_migrate/20211206074547_remove_old_calendar_events_index.rb b/db/post_migrate/20211206074547_remove_old_calendar_events_index.rb new file mode 100644 index 00000000000..51460a9dc95 --- /dev/null +++ b/db/post_migrate/20211206074547_remove_old_calendar_events_index.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class RemoveOldCalendarEventsIndex < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + OLD_INDEX_NAME = 'index_events_on_author_id_and_project_id' + + def up + remove_concurrent_index_by_name :events, OLD_INDEX_NAME + end + + def down + add_concurrent_index :events, [:author_id, :project_id], name: OLD_INDEX_NAME + end +end diff --git a/db/post_migrate/20211206161271_add_indexes_for_primary_email_cleanup_migration.rb b/db/post_migrate/20211206161271_add_indexes_for_primary_email_cleanup_migration.rb new file mode 100644 index 00000000000..0e370dfc5f8 --- /dev/null +++ b/db/post_migrate/20211206161271_add_indexes_for_primary_email_cleanup_migration.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class AddIndexesForPrimaryEmailCleanupMigration < Gitlab::Database::Migration[1.0] + USERS_INDEX = :index_users_on_id_for_primary_email_migration + EMAIL_INDEX = :index_emails_on_email_user_id + + disable_ddl_transaction! + + def up + unless index_exists_by_name?(:users, USERS_INDEX) + + disable_statement_timeout do + execute <<~SQL + CREATE INDEX CONCURRENTLY #{USERS_INDEX} + ON users (id) INCLUDE (email, confirmed_at) + WHERE confirmed_at IS NOT NULL + SQL + end + end + + add_concurrent_index :emails, [:email, :user_id], name: EMAIL_INDEX + end + + def down + remove_concurrent_index_by_name :users, USERS_INDEX + remove_concurrent_index_by_name :emails, EMAIL_INDEX + end +end diff --git a/db/post_migrate/20211207081708_add_index_ci_job_artifacts_project_id_file_type.rb b/db/post_migrate/20211207081708_add_index_ci_job_artifacts_project_id_file_type.rb new file mode 100644 index 00000000000..959bf61a6cc --- /dev/null +++ b/db/post_migrate/20211207081708_add_index_ci_job_artifacts_project_id_file_type.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexCiJobArtifactsProjectIdFileType < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_ci_job_artifacts_on_id_project_id_and_file_type' + + def up + add_concurrent_index :ci_job_artifacts, [:project_id, :file_type, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME + end +end diff --git a/db/post_migrate/20211207090503_cleanup_first_mentioned_in_commit_jobs.rb b/db/post_migrate/20211207090503_cleanup_first_mentioned_in_commit_jobs.rb new file mode 100644 index 00000000000..3788a680fb6 --- /dev/null +++ b/db/post_migrate/20211207090503_cleanup_first_mentioned_in_commit_jobs.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class CleanupFirstMentionedInCommitJobs < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + MIGRATION = 'FixFirstMentionedInCommitAt' + INDEX_NAME = 'index_issue_metrics_first_mentioned_in_commit' + + def up + finalize_background_migration(MIGRATION) + + remove_concurrent_index_by_name :issue_metrics, name: INDEX_NAME + end + + def down + # Handles reported schema inconsistencies (column with or without timezone) + # We did the same in db/post_migrate/20211004110500_add_temporary_index_to_issue_metrics.rb + condition = Gitlab::BackgroundMigration::FixFirstMentionedInCommitAt::TmpIssueMetrics + .first_mentioned_in_commit_at_condition + add_concurrent_index :issue_metrics, :issue_id, where: condition, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20211207125331_remove_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb b/db/post_migrate/20211207125331_remove_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb new file mode 100644 index 00000000000..cc37f2dc65d --- /dev/null +++ b/db/post_migrate/20211207125331_remove_jobs_for_recalculate_vulnerabilities_occurrences_uuid.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveJobsForRecalculateVulnerabilitiesOccurrencesUuid < Gitlab::Database::Migration[1.0] + MIGRATION_NAME = 'RecalculateVulnerabilitiesOccurrencesUuid' + + def up + delete_job_tracking( + MIGRATION_NAME, + status: %w[pending succeeded] + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211207135331_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb b/db/post_migrate/20211207135331_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb new file mode 100644 index 00000000000..13abf8b5540 --- /dev/null +++ b/db/post_migrate/20211207135331_schedule_recalculate_uuid_on_vulnerabilities_occurrences4.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class ScheduleRecalculateUuidOnVulnerabilitiesOccurrences4 < Gitlab::Database::Migration[1.0] + MIGRATION = 'RecalculateVulnerabilitiesOccurrencesUuid' + DELAY_INTERVAL = 2.minutes.to_i + BATCH_SIZE = 2_500 + + disable_ddl_transaction! + + def up + # Make sure the migration removing Findings with attributes for which UUID would be identical + # has finished + # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/74008 + Gitlab::BackgroundMigration.steal('RemoveOccurrencePipelinesAndDuplicateVulnerabilitiesFindings') + + queue_background_migration_jobs_by_range_at_intervals( + define_batchable_model('vulnerability_occurrences'), + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb b/db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb new file mode 100644 index 00000000000..eaf07abe29d --- /dev/null +++ b/db/post_migrate/20211207173510_remove_extra_finding_evidence_tables_foreign_keys.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +class RemoveExtraFindingEvidenceTablesForeignKeys < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key :vulnerability_finding_evidence_assets, :vulnerability_finding_evidences + remove_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_requests + remove_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_responses + remove_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidences + remove_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_supporting_messages + remove_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidences + remove_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_supporting_messages + remove_foreign_key :vulnerability_finding_evidence_sources, :vulnerability_finding_evidences + remove_foreign_key :vulnerability_finding_evidence_supporting_messages, :vulnerability_finding_evidences + end + end + + def down + with_lock_retries do + add_foreign_key :vulnerability_finding_evidence_assets, :vulnerability_finding_evidences, on_delete: :cascade + end + + with_lock_retries do + add_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_requests, on_delete: :cascade + end + + with_lock_retries do + add_foreign_key :vulnerability_finding_evidence_headers, :vulnerability_finding_evidence_responses, on_delete: :cascade + end + + with_lock_retries do + add_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidences, on_delete: :cascade + end + + with_lock_retries do + add_foreign_key :vulnerability_finding_evidence_requests, :vulnerability_finding_evidence_supporting_messages, on_delete: :cascade + end + + with_lock_retries do + add_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidences, on_delete: :cascade + end + + with_lock_retries do + add_foreign_key :vulnerability_finding_evidence_responses, :vulnerability_finding_evidence_supporting_messages, on_delete: :cascade + end + + with_lock_retries do + add_foreign_key :vulnerability_finding_evidence_sources, :vulnerability_finding_evidences, on_delete: :cascade + end + + with_lock_retries do + add_foreign_key :vulnerability_finding_evidence_supporting_messages, :vulnerability_finding_evidences, on_delete: :cascade + end + end +end diff --git a/db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb b/db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb new file mode 100644 index 00000000000..9a246a8c707 --- /dev/null +++ b/db/post_migrate/20211207173511_remove_extra_finding_evidence_tables.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +class RemoveExtraFindingEvidenceTables < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + drop_table :vulnerability_finding_evidence_assets, if_exists: true + drop_table :vulnerability_finding_evidence_headers, if_exists: true + drop_table :vulnerability_finding_evidence_requests, if_exists: true + drop_table :vulnerability_finding_evidence_responses, if_exists: true + drop_table :vulnerability_finding_evidence_sources, if_exists: true + drop_table :vulnerability_finding_evidence_supporting_messages, if_exists: true + end + end + + def down + create_table :vulnerability_finding_evidence_assets, if_not_exists: true do |t| + t.timestamps_with_timezone null: false + + t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_assets_on_finding_evidence_id' }, null: false + t.text :type, limit: 2048 + t.text :name, limit: 2048 + t.text :url, limit: 2048 + end + + create_table :vulnerability_finding_evidence_sources, if_not_exists: true do |t| + t.timestamps_with_timezone null: false + + t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_sources_on_finding_evidence_id' }, null: false + t.text :name, limit: 2048 + t.text :url, limit: 2048 + end + + create_table :vulnerability_finding_evidence_supporting_messages, if_not_exists: true do |t| + t.timestamps_with_timezone null: false + + t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_supporting_messages_on_finding_evidence_id' }, null: false + t.text :name, limit: 2048 + end + + create_table :vulnerability_finding_evidence_requests, if_not_exists: true do |t| + t.timestamps_with_timezone null: false + + t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_requests_on_finding_evidence_id' }, null: true + t.text :method, limit: 32 + t.text :url, limit: 2048 + t.text :body, limit: 2048 + t.references :vulnerability_finding_evidence_supporting_message, index: { name: 'finding_evidence_requests_on_supporting_evidence_id' }, null: true + end + + create_table :vulnerability_finding_evidence_responses, if_not_exists: true do |t| + t.timestamps_with_timezone null: false + + t.references :vulnerability_finding_evidence, index: { name: 'finding_evidence_responses_on_finding_evidences_id' }, null: true + t.integer :status_code + t.text :reason_phrase, limit: 2048 + t.text :body, limit: 2048 + t.references :vulnerability_finding_evidence_supporting_message, index: { name: 'finding_evidence_responses_on_supporting_evidence_id' }, null: true + end + + create_table :vulnerability_finding_evidence_headers, if_not_exists: true do |t| + t.timestamps_with_timezone null: false + + t.references :vulnerability_finding_evidence_request, index: { name: 'finding_evidence_header_on_finding_evidence_request_id' }, null: true + t.references :vulnerability_finding_evidence_response, index: { name: 'finding_evidence_header_on_finding_evidence_response_id' }, null: true + t.text :name, null: false, limit: 255 + t.text :value, null: false, limit: 8192 + end + end +end diff --git a/db/post_migrate/20211208122200_schedule_backfill_ci_namespace_mirrors.rb b/db/post_migrate/20211208122200_schedule_backfill_ci_namespace_mirrors.rb new file mode 100644 index 00000000000..e42b74748d7 --- /dev/null +++ b/db/post_migrate/20211208122200_schedule_backfill_ci_namespace_mirrors.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class ScheduleBackfillCiNamespaceMirrors < Gitlab::Database::Migration[1.0] + def up + # no-op + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211208122201_schedule_backfill_ci_project_mirrors.rb b/db/post_migrate/20211208122201_schedule_backfill_ci_project_mirrors.rb new file mode 100644 index 00000000000..2a58eda040e --- /dev/null +++ b/db/post_migrate/20211208122201_schedule_backfill_ci_project_mirrors.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class ScheduleBackfillCiProjectMirrors < Gitlab::Database::Migration[1.0] + def up + # no-op + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211208171402_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb b/db/post_migrate/20211208171402_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb new file mode 100644 index 00000000000..8eee082809b --- /dev/null +++ b/db/post_migrate/20211208171402_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class RescheduleRecalculateVulnerabilityFindingSignaturesForFindings < Gitlab::Database::Migration[1.0] + MIGRATION = 'RecalculateVulnerabilityFindingSignaturesForFindings' + BATCH_SIZE = 1_000 + DELAY_INTERVAL = 2.minutes + + disable_ddl_transaction! + + # Due to production incident previous migration was orphaned and must be rescheduled, + # See https://gitlab.com/gitlab-org/gitlab/-/merge_requests/72919#note_741188600 + def up + return unless Gitlab.ee? + + delete_queued_jobs(MIGRATION) + + requeue_background_migration_jobs_by_range_at_intervals( + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211209093636_track_ci_job_artifacts_deletes.rb b/db/post_migrate/20211209093636_track_ci_job_artifacts_deletes.rb new file mode 100644 index 00000000000..8c95c76d1fe --- /dev/null +++ b/db/post_migrate/20211209093636_track_ci_job_artifacts_deletes.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class TrackCiJobArtifactsDeletes < Gitlab::Database::Migration[1.0] + include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers + + enable_lock_retries! + + def up + track_record_deletions(:ci_job_artifacts) + end + + def down + untrack_record_deletions(:ci_job_artifacts) + end +end diff --git a/db/post_migrate/20211209093828_track_users_deletes.rb b/db/post_migrate/20211209093828_track_users_deletes.rb new file mode 100644 index 00000000000..e25a8a36cb2 --- /dev/null +++ b/db/post_migrate/20211209093828_track_users_deletes.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class TrackUsersDeletes < Gitlab::Database::Migration[1.0] + include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers + + enable_lock_retries! + + def up + track_record_deletions(:users) + end + + def down + untrack_record_deletions(:users) + end +end diff --git a/db/post_migrate/20211209093923_track_external_pull_requests_deletes.rb b/db/post_migrate/20211209093923_track_external_pull_requests_deletes.rb new file mode 100644 index 00000000000..cd8a6baf407 --- /dev/null +++ b/db/post_migrate/20211209093923_track_external_pull_requests_deletes.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class TrackExternalPullRequestsDeletes < Gitlab::Database::Migration[1.0] + include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers + + enable_lock_retries! + + def up + track_record_deletions(:external_pull_requests) + end + + def down + untrack_record_deletions(:external_pull_requests) + end +end diff --git a/db/post_migrate/20211209094222_track_merge_requests_deletes.rb b/db/post_migrate/20211209094222_track_merge_requests_deletes.rb new file mode 100644 index 00000000000..51007082e9e --- /dev/null +++ b/db/post_migrate/20211209094222_track_merge_requests_deletes.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class TrackMergeRequestsDeletes < Gitlab::Database::Migration[1.0] + include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers + + enable_lock_retries! + + def up + track_record_deletions(:merge_requests) + end + + def down + untrack_record_deletions(:merge_requests) + end +end diff --git a/db/post_migrate/20211209103048_backfill_project_namespaces_for_group.rb b/db/post_migrate/20211209103048_backfill_project_namespaces_for_group.rb new file mode 100644 index 00000000000..44dffc798d3 --- /dev/null +++ b/db/post_migrate/20211209103048_backfill_project_namespaces_for_group.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +class BackfillProjectNamespacesForGroup < Gitlab::Database::Migration[1.0] + MIGRATION = 'ProjectNamespaces::BackfillProjectNamespaces' + DELAY_INTERVAL = 2.minutes + GROUP_ID = 9970 # picking gitlab-org group. + + disable_ddl_transaction! + + def up + return unless Gitlab.com? || Gitlab.staging? + + projects_table = ::Gitlab::BackgroundMigration::ProjectNamespaces::Models::Project.arel_table + hierarchy_cte_sql = Arel.sql(::Gitlab::BackgroundMigration::ProjectNamespaces::BackfillProjectNamespaces.hierarchy_cte(GROUP_ID)) + group_projects = ::Gitlab::BackgroundMigration::ProjectNamespaces::Models::Project.where(projects_table[:namespace_id].in(hierarchy_cte_sql)) + + min_id = group_projects.minimum(:id) + max_id = group_projects.maximum(:id) + + return if min_id.blank? || max_id.blank? + + queue_batched_background_migration( + MIGRATION, + :projects, + :id, + GROUP_ID, + 'up', + job_interval: DELAY_INTERVAL, + batch_min_value: min_id, + batch_max_value: max_id, + sub_batch_size: 25, + batch_class_name: 'BackfillProjectNamespacePerGroupBatchingStrategy' + ) + end + + def down + return unless Gitlab.com? || Gitlab.staging? + + delete_batched_background_migration(MIGRATION, :projects, :id, [GROUP_ID, 'up']) + end +end diff --git a/db/post_migrate/20211209203820_add_tmp_index_on_report_type.rb b/db/post_migrate/20211209203820_add_tmp_index_on_report_type.rb new file mode 100644 index 00000000000..07a2c079511 --- /dev/null +++ b/db/post_migrate/20211209203820_add_tmp_index_on_report_type.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true +class AddTmpIndexOnReportType < Gitlab::Database::Migration[1.0] + # Temporary index to perform migration fixing invalid vulnerability_occurrences.raw_metadata rows + # Will be removed with https://gitlab.com/gitlab-org/gitlab/-/issues/349605 + INDEX_NAME = 'tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99' + + disable_ddl_transaction! + + def up + add_concurrent_index :vulnerability_occurrences, :id, where: 'report_type IN (7, 99)', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME + end +end diff --git a/db/post_migrate/20211209203821_convert_stringified_raw_metadata_hash_to_json.rb b/db/post_migrate/20211209203821_convert_stringified_raw_metadata_hash_to_json.rb new file mode 100644 index 00000000000..757cbf60d4d --- /dev/null +++ b/db/post_migrate/20211209203821_convert_stringified_raw_metadata_hash_to_json.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true +class ConvertStringifiedRawMetadataHashToJson < Gitlab::Database::Migration[1.0] + MIGRATION_CLASS = Gitlab::BackgroundMigration::FixVulnerabilityOccurrencesWithHashesAsRawMetadata + MODEL_CLASS = MIGRATION_CLASS::Finding + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 500 + + disable_ddl_transaction! + + def up + queue_background_migration_jobs_by_range_at_intervals( + MODEL_CLASS.by_api_report_types, + MIGRATION_CLASS, + DELAY_INTERVAL, + batch_size: BATCH_SIZE + ) + end + + def down + # no-op + + # up fixes invalid data by updating columns in-place. + # It is a backwards-compatible change, and reversing it in a downgrade would not be desirable. + end +end diff --git a/db/post_migrate/20211210140000_add_temporary_static_object_token_index.rb b/db/post_migrate/20211210140000_add_temporary_static_object_token_index.rb new file mode 100644 index 00000000000..54997dc4cc4 --- /dev/null +++ b/db/post_migrate/20211210140000_add_temporary_static_object_token_index.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddTemporaryStaticObjectTokenIndex < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_users_with_static_object_token' + + def up + add_concurrent_index :users, :id, where: "static_object_token IS NOT NULL AND static_object_token_encrypted IS NULL", name: INDEX_NAME + end + + def down + remove_concurrent_index :users, :id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20211210140629_encrypt_static_object_token.rb b/db/post_migrate/20211210140629_encrypt_static_object_token.rb new file mode 100644 index 00000000000..fe4db9fc14c --- /dev/null +++ b/db/post_migrate/20211210140629_encrypt_static_object_token.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class EncryptStaticObjectToken < Gitlab::Database::Migration[1.0] + BATCH_SIZE = 10_000 + MIGRATION = 'EncryptStaticObjectToken' + + disable_ddl_transaction! + + def up + queue_background_migration_jobs_by_range_at_intervals( + define_batchable_model('users').where.not(static_object_token: nil).where(static_object_token_encrypted: nil), + MIGRATION, + 2.minutes, + batch_size: BATCH_SIZE, + track_jobs: true + ) + end + + def down + # no ops + end +end diff --git a/db/post_migrate/20211210173137_remove_vulnerability_finding_links_again.rb b/db/post_migrate/20211210173137_remove_vulnerability_finding_links_again.rb new file mode 100644 index 00000000000..ffe8bf0d794 --- /dev/null +++ b/db/post_migrate/20211210173137_remove_vulnerability_finding_links_again.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class RemoveVulnerabilityFindingLinksAgain < Gitlab::Database::Migration[1.0] + # This migration has been moved to a TRUNCATE in db/post_migrate/20220201193033_add_unique_index_to_vulnerability_finding_links_with_truncate.rb + # Previously, this was causing an bug where there was a conflict between the table cleanup and the index creation. + + def up + # no op + end + + def down + # no op + end +end diff --git a/db/post_migrate/20211213064821_add_agent_id_location_index_to_vulnerability_occurrences.rb b/db/post_migrate/20211213064821_add_agent_id_location_index_to_vulnerability_occurrences.rb new file mode 100644 index 00000000000..92b5a1b085c --- /dev/null +++ b/db/post_migrate/20211213064821_add_agent_id_location_index_to_vulnerability_occurrences.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddAgentIdLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_vulnerability_occurrences_on_location_agent_id' + + def up + add_concurrent_index :vulnerability_occurrences, "(location -> 'agent_id')", + using: 'GIN', + where: 'report_type = 7', + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_occurrences, INDEX_NAME + end +end diff --git a/db/post_migrate/20211213102111_drop_ci_pipelines_mr_metrics_fk.rb b/db/post_migrate/20211213102111_drop_ci_pipelines_mr_metrics_fk.rb new file mode 100644 index 00000000000..49f498c911d --- /dev/null +++ b/db/post_migrate/20211213102111_drop_ci_pipelines_mr_metrics_fk.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class DropCiPipelinesMrMetricsFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:merge_request_metrics, :ci_pipelines, name: "fk_rails_33ae169d48") + end + end + + def down + add_concurrent_foreign_key(:merge_request_metrics, :ci_pipelines, name: "fk_rails_33ae169d48", column: :pipeline_id, target_column: :id, on_delete: "cascade") + end +end diff --git a/db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb b/db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb new file mode 100644 index 00000000000..f8239b6e0cd --- /dev/null +++ b/db/post_migrate/20211214012507_backfill_incident_issue_escalation_statuses.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class BackfillIncidentIssueEscalationStatuses < Gitlab::Database::Migration[1.0] + # Removed in favor of creating records for existing incidents + # as-needed. See db/migrate/20220321234317_remove_all_issuable_escalation_statuses.rb. + def change + # no-op + end +end diff --git a/db/post_migrate/20211215090620_schedule_update_timelogs_null_spent_at.rb b/db/post_migrate/20211215090620_schedule_update_timelogs_null_spent_at.rb new file mode 100644 index 00000000000..5876d3f8a9a --- /dev/null +++ b/db/post_migrate/20211215090620_schedule_update_timelogs_null_spent_at.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class ScheduleUpdateTimelogsNullSpentAt < Gitlab::Database::Migration[1.0] + DOWNTIME = false + BATCH_SIZE = 5_000 + DELAY_INTERVAL = 2.minutes + MIGRATION = 'UpdateTimelogsNullSpentAt' + + disable_ddl_transaction! + + def up + queue_background_migration_jobs_by_range_at_intervals( + define_batchable_model('timelogs').where(spent_at: nil), + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211217120000_modify_kubernetes_resource_location_index_to_vulnerability_occurrences.rb b/db/post_migrate/20211217120000_modify_kubernetes_resource_location_index_to_vulnerability_occurrences.rb new file mode 100644 index 00000000000..310a49a667e --- /dev/null +++ b/db/post_migrate/20211217120000_modify_kubernetes_resource_location_index_to_vulnerability_occurrences.rb @@ -0,0 +1,41 @@ +# frozen_string_literal: true + +class ModifyKubernetesResourceLocationIndexToVulnerabilityOccurrences < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + OLD_CLUSTER_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_cluster_id' + OLD_AGENT_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_agent_id' + + NEW_CLUSTER_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_k8s_cluster_id' + NEW_AGENT_ID_INDEX_NAME = 'index_vulnerability_occurrences_on_location_k8s_agent_id' + + def up + add_concurrent_index :vulnerability_occurrences, "(location -> 'kubernetes_resource' -> 'cluster_id')", + using: 'GIN', + where: 'report_type = 7', + name: NEW_CLUSTER_ID_INDEX_NAME + + add_concurrent_index :vulnerability_occurrences, "(location -> 'kubernetes_resource' -> 'agent_id')", + using: 'GIN', + where: 'report_type = 7', + name: NEW_AGENT_ID_INDEX_NAME + + remove_concurrent_index_by_name :vulnerability_occurrences, OLD_CLUSTER_ID_INDEX_NAME + remove_concurrent_index_by_name :vulnerability_occurrences, OLD_AGENT_ID_INDEX_NAME + end + + def down + add_concurrent_index :vulnerability_occurrences, "(location -> 'cluster_id')", + using: 'GIN', + where: 'report_type = 7', + name: OLD_CLUSTER_ID_INDEX_NAME + + add_concurrent_index :vulnerability_occurrences, "(location -> 'agent_id')", + using: 'GIN', + where: 'report_type = 7', + name: OLD_AGENT_ID_INDEX_NAME + + remove_concurrent_index_by_name :vulnerability_occurrences, NEW_CLUSTER_ID_INDEX_NAME + remove_concurrent_index_by_name :vulnerability_occurrences, NEW_AGENT_ID_INDEX_NAME + end +end diff --git a/db/post_migrate/20211217145923_add_index_to_events_on_author_id_and_action_and_id.rb b/db/post_migrate/20211217145923_add_index_to_events_on_author_id_and_action_and_id.rb new file mode 100644 index 00000000000..a05d68279c3 --- /dev/null +++ b/db/post_migrate/20211217145923_add_index_to_events_on_author_id_and_action_and_id.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class AddIndexToEventsOnAuthorIdAndActionAndId < Gitlab::Database::Migration[1.0] + # no-op + # see: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/77436 + + def up + # no-op + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211217174331_mark_recalculate_finding_signatures_as_completed.rb b/db/post_migrate/20211217174331_mark_recalculate_finding_signatures_as_completed.rb new file mode 100644 index 00000000000..316209ae1f4 --- /dev/null +++ b/db/post_migrate/20211217174331_mark_recalculate_finding_signatures_as_completed.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class MarkRecalculateFindingSignaturesAsCompleted < Gitlab::Database::Migration[1.0] + MIGRATION = 'RecalculateVulnerabilitiesOccurrencesUuid' + + def up + # Only run migration for Gitlab.com + return unless ::Gitlab.com? + + # In previous migration marking jobs as successful was missed + Gitlab::Database::BackgroundMigrationJob + .for_migration_class(MIGRATION) + .pending + .update_all(status: :succeeded) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20211220064757_drop_temporary_indexes_for_primary_email_migration.rb b/db/post_migrate/20211220064757_drop_temporary_indexes_for_primary_email_migration.rb new file mode 100644 index 00000000000..1d61aec401e --- /dev/null +++ b/db/post_migrate/20211220064757_drop_temporary_indexes_for_primary_email_migration.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class DropTemporaryIndexesForPrimaryEmailMigration < Gitlab::Database::Migration[1.0] + USERS_INDEX = :index_users_on_id_for_primary_email_migration + EMAIL_INDEX = :index_emails_on_email_user_id + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :users, USERS_INDEX + remove_concurrent_index_by_name :emails, EMAIL_INDEX + end + + def down + unless index_exists_by_name?(:users, USERS_INDEX) + + disable_statement_timeout do + execute <<~SQL + CREATE INDEX CONCURRENTLY #{USERS_INDEX} + ON users (id) INCLUDE (email, confirmed_at) + WHERE confirmed_at IS NOT NULL + SQL + end + end + + add_concurrent_index :emails, [:email, :user_id], name: EMAIL_INDEX + end +end diff --git a/db/post_migrate/20211220120402_add_index_on_ci_pipelines_user_id_id_failure_reason.rb b/db/post_migrate/20211220120402_add_index_on_ci_pipelines_user_id_id_failure_reason.rb new file mode 100644 index 00000000000..c98d3d05f2f --- /dev/null +++ b/db/post_migrate/20211220120402_add_index_on_ci_pipelines_user_id_id_failure_reason.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnCiPipelinesUserIdIdFailureReason < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_ci_pipelines_on_user_id_and_id_desc_and_user_not_verified' + + def up + add_concurrent_index :ci_pipelines, [:user_id, :id], order: { id: :desc }, where: 'failure_reason = 3', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_pipelines, INDEX_NAME + end +end diff --git a/db/post_migrate/20211220123956_update_invalid_member_states.rb b/db/post_migrate/20211220123956_update_invalid_member_states.rb new file mode 100644 index 00000000000..5da100f0ec2 --- /dev/null +++ b/db/post_migrate/20211220123956_update_invalid_member_states.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class UpdateInvalidMemberStates < Gitlab::Database::Migration[1.0] + class Member < ActiveRecord::Base + include EachBatch + + self.table_name = 'members' + + scope :in_invalid_state, -> { where(state: 2) } + end + + def up + Member.in_invalid_state.each_batch do |relation| + relation.update_all(state: 0) + end + end + + def down + # no-op as we don't need to revert any changed records + end +end diff --git a/db/post_migrate/20211229023654_add_async_index_ci_job_artifacts_project_id_file_type.rb b/db/post_migrate/20211229023654_add_async_index_ci_job_artifacts_project_id_file_type.rb new file mode 100644 index 00000000000..5338cab3871 --- /dev/null +++ b/db/post_migrate/20211229023654_add_async_index_ci_job_artifacts_project_id_file_type.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddAsyncIndexCiJobArtifactsProjectIdFileType < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_ci_job_artifacts_on_id_project_id_and_file_type' + + def up + prepare_async_index :ci_job_artifacts, [:project_id, :file_type, :id], name: INDEX_NAME + end + + def down + unprepare_async_index_by_name :ci_job_artifacts, INDEX_NAME + end +end diff --git a/db/post_migrate/20211230112517_remove_index_events_on_author_id_and_action_and_id.rb b/db/post_migrate/20211230112517_remove_index_events_on_author_id_and_action_and_id.rb new file mode 100644 index 00000000000..2215a49e286 --- /dev/null +++ b/db/post_migrate/20211230112517_remove_index_events_on_author_id_and_action_and_id.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveIndexEventsOnAuthorIdAndActionAndId < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_events_on_author_id_and_action_and_id' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :events, name: INDEX_NAME + end + + def down + # no-op + # The index had been added in the same milestone. + # Adding back the index takes a long time and should not be needed. + end +end diff --git a/db/post_migrate/20211230113031_add_index_to_events_on_author_id_and_id.rb b/db/post_migrate/20211230113031_add_index_to_events_on_author_id_and_id.rb new file mode 100644 index 00000000000..e4cdc9add39 --- /dev/null +++ b/db/post_migrate/20211230113031_add_index_to_events_on_author_id_and_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToEventsOnAuthorIdAndId < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_events_on_author_id_and_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :events, [:author_id, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :events, INDEX_NAME + end +end diff --git a/db/post_migrate/20220104060049_remove_foreign_key_ci_group_variables_group_id.rb b/db/post_migrate/20220104060049_remove_foreign_key_ci_group_variables_group_id.rb new file mode 100644 index 00000000000..9be81e00b50 --- /dev/null +++ b/db/post_migrate/20220104060049_remove_foreign_key_ci_group_variables_group_id.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveForeignKeyCiGroupVariablesGroupId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + CONSTRAINT_NAME = 'fk_33ae4d58d8' + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_group_variables, :namespaces, name: CONSTRAINT_NAME) + end + end + + def down + add_concurrent_foreign_key :ci_group_variables, :namespaces, column: :group_id, on_delete: :cascade, name: CONSTRAINT_NAME + end +end diff --git a/db/post_migrate/20220105020514_remove_ci_minutes_additional_packs_namespace_id_foreign_key_constraint.rb b/db/post_migrate/20220105020514_remove_ci_minutes_additional_packs_namespace_id_foreign_key_constraint.rb new file mode 100644 index 00000000000..b072d5616f5 --- /dev/null +++ b/db/post_migrate/20220105020514_remove_ci_minutes_additional_packs_namespace_id_foreign_key_constraint.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveCiMinutesAdditionalPacksNamespaceIdForeignKeyConstraint < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + CONSTRAINT_NAME = 'fk_rails_e0e0c4e4b1' + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_minutes_additional_packs, :namespaces, name: CONSTRAINT_NAME) + end + end + + def down + add_concurrent_foreign_key :ci_minutes_additional_packs, :namespaces, column: :namespace_id, on_delete: :cascade, name: CONSTRAINT_NAME + end +end diff --git a/db/post_migrate/20220106185033_remove_finding_evidence_summary.rb b/db/post_migrate/20220106185033_remove_finding_evidence_summary.rb new file mode 100644 index 00000000000..d28e8bb81f6 --- /dev/null +++ b/db/post_migrate/20220106185033_remove_finding_evidence_summary.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveFindingEvidenceSummary < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + remove_column :vulnerability_finding_evidences, :summary, :text + end + + def down + add_column :vulnerability_finding_evidences, :summary, :text + + add_text_limit :vulnerability_finding_evidences, :summary, 8_000_000 + end +end diff --git a/db/post_migrate/20220106231518_remove_foreign_key_ci_daily_build_group_report_results_group_id.rb b/db/post_migrate/20220106231518_remove_foreign_key_ci_daily_build_group_report_results_group_id.rb new file mode 100644 index 00000000000..ece20f8095d --- /dev/null +++ b/db/post_migrate/20220106231518_remove_foreign_key_ci_daily_build_group_report_results_group_id.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveForeignKeyCiDailyBuildGroupReportResultsGroupId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + CONSTRAINT_NAME = 'fk_fd1858fefd' + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_daily_build_group_report_results, :namespaces, name: CONSTRAINT_NAME) + end + end + + def down + add_concurrent_foreign_key :ci_daily_build_group_report_results, :namespaces, column: :group_id, on_delete: :cascade, name: CONSTRAINT_NAME + end +end diff --git a/db/post_migrate/20220106233459_remove_foreign_key_ci_pending_builds_namespace_id.rb b/db/post_migrate/20220106233459_remove_foreign_key_ci_pending_builds_namespace_id.rb new file mode 100644 index 00000000000..1304f19708e --- /dev/null +++ b/db/post_migrate/20220106233459_remove_foreign_key_ci_pending_builds_namespace_id.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveForeignKeyCiPendingBuildsNamespaceId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + CONSTRAINT_NAME = 'fk_fdc0137e4a' + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_pending_builds, :namespaces, name: CONSTRAINT_NAME) + end + end + + def down + add_concurrent_foreign_key :ci_pending_builds, :namespaces, column: :namespace_id, on_delete: :cascade, name: CONSTRAINT_NAME + end +end diff --git a/db/post_migrate/20220106235626_remove_foreign_key_ci_runner_namespaces_namespace_id.rb b/db/post_migrate/20220106235626_remove_foreign_key_ci_runner_namespaces_namespace_id.rb new file mode 100644 index 00000000000..61ca066401e --- /dev/null +++ b/db/post_migrate/20220106235626_remove_foreign_key_ci_runner_namespaces_namespace_id.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveForeignKeyCiRunnerNamespacesNamespaceId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + CONSTRAINT_NAME = 'fk_rails_f9d9ed3308' + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_runner_namespaces, :namespaces, name: CONSTRAINT_NAME) + end + end + + def down + add_concurrent_foreign_key :ci_runner_namespaces, :namespaces, column: :namespace_id, on_delete: :cascade, name: CONSTRAINT_NAME + end +end diff --git a/db/post_migrate/20220107064845_populate_vulnerability_reads.rb b/db/post_migrate/20220107064845_populate_vulnerability_reads.rb new file mode 100644 index 00000000000..58826c5f929 --- /dev/null +++ b/db/post_migrate/20220107064845_populate_vulnerability_reads.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class PopulateVulnerabilityReads < Gitlab::Database::Migration[1.0] + BATCH_SIZE = 10_000 + DELAY_INTERVAL = 2.minutes + MIGRATION_NAME = 'PopulateVulnerabilityReads' + SUB_BATCH_SIZE = 1_000 + + disable_ddl_transaction! + + def up + queue_background_migration_jobs_by_range_at_intervals( + define_batchable_model('vulnerabilities'), + MIGRATION_NAME, + DELAY_INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true, + other_job_arguments: [SUB_BATCH_SIZE] + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220109134455_add_idx_vulnerability_occurrences_dedup_again.rb b/db/post_migrate/20220109134455_add_idx_vulnerability_occurrences_dedup_again.rb new file mode 100644 index 00000000000..06be8edd707 --- /dev/null +++ b/db/post_migrate/20220109134455_add_idx_vulnerability_occurrences_dedup_again.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIdxVulnerabilityOccurrencesDedupAgain < Gitlab::Database::Migration[1.0] + TABLE = :vulnerability_occurrences + INDEX_NAME = 'index_vulnerability_occurrences_deduplication' + COLUMNS = %i[project_id report_type project_fingerprint] + + disable_ddl_transaction! + + def up + add_concurrent_index TABLE, COLUMNS, name: INDEX_NAME + end + + def down + # nothing to do here + end +end diff --git a/db/post_migrate/20220110171049_schedule_populate_test_reports_issue_id.rb b/db/post_migrate/20220110171049_schedule_populate_test_reports_issue_id.rb new file mode 100644 index 00000000000..dae93e1636d --- /dev/null +++ b/db/post_migrate/20220110171049_schedule_populate_test_reports_issue_id.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class SchedulePopulateTestReportsIssueId < Gitlab::Database::Migration[1.0] + MIGRATION = 'PopulateTestReportsIssueId' + DELAY_INTERVAL = 2.minutes.to_i + BATCH_SIZE = 30 + + disable_ddl_transaction! + + def up + queue_background_migration_jobs_by_range_at_intervals( + define_batchable_model('requirements_management_test_reports').where(issue_id: nil), + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220110224913_remove_dast_scanner_profiles_builds_ci_build_id_fk.rb b/db/post_migrate/20220110224913_remove_dast_scanner_profiles_builds_ci_build_id_fk.rb new file mode 100644 index 00000000000..d91cd3b43ef --- /dev/null +++ b/db/post_migrate/20220110224913_remove_dast_scanner_profiles_builds_ci_build_id_fk.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class RemoveDastScannerProfilesBuildsCiBuildIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + CONSTRAINT_NAME = 'fk_e4c49200f8' + + def up + with_lock_retries do + execute('LOCK ci_builds, dast_scanner_profiles_builds IN ACCESS EXCLUSIVE MODE') + remove_foreign_key_if_exists(:dast_scanner_profiles_builds, :ci_builds, name: CONSTRAINT_NAME) + end + end + + def down + add_concurrent_foreign_key(:dast_scanner_profiles_builds, :ci_builds, column: :ci_build_id, on_delete: :cascade, name: CONSTRAINT_NAME) + end +end diff --git a/db/post_migrate/20220110231420_remove_requirements_management_test_reports_build_id_fk.rb b/db/post_migrate/20220110231420_remove_requirements_management_test_reports_build_id_fk.rb new file mode 100644 index 00000000000..dd8c6de4aaf --- /dev/null +++ b/db/post_migrate/20220110231420_remove_requirements_management_test_reports_build_id_fk.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class RemoveRequirementsManagementTestReportsBuildIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + CONSTRAINT_NAME = 'fk_rails_e67d085910' + + def up + with_lock_retries do + execute('LOCK ci_builds, requirements_management_test_reports IN ACCESS EXCLUSIVE MODE') + remove_foreign_key_if_exists(:requirements_management_test_reports, :ci_builds, name: CONSTRAINT_NAME) + end + end + + def down + add_concurrent_foreign_key(:requirements_management_test_reports, :ci_builds, column: :build_id, on_delete: :nullify, name: CONSTRAINT_NAME) + end +end diff --git a/db/post_migrate/20220110233155_remove_dast_site_profiles_builds_ci_build_id_fk.rb b/db/post_migrate/20220110233155_remove_dast_site_profiles_builds_ci_build_id_fk.rb new file mode 100644 index 00000000000..00d8a39216b --- /dev/null +++ b/db/post_migrate/20220110233155_remove_dast_site_profiles_builds_ci_build_id_fk.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class RemoveDastSiteProfilesBuildsCiBuildIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + CONSTRAINT_NAME = 'fk_a325505e99' + + def up + with_lock_retries do + execute('LOCK ci_builds, dast_site_profiles_builds IN ACCESS EXCLUSIVE MODE') + remove_foreign_key_if_exists(:dast_site_profiles_builds, :ci_builds, name: CONSTRAINT_NAME) + end + end + + def down + add_concurrent_foreign_key(:dast_site_profiles_builds, :ci_builds, column: :ci_build_id, on_delete: :cascade, name: CONSTRAINT_NAME) + end +end diff --git a/db/post_migrate/20220111002756_remove_security_scans_build_id_fk.rb b/db/post_migrate/20220111002756_remove_security_scans_build_id_fk.rb new file mode 100644 index 00000000000..20782664f63 --- /dev/null +++ b/db/post_migrate/20220111002756_remove_security_scans_build_id_fk.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class RemoveSecurityScansBuildIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + CONSTRAINT_NAME = 'fk_rails_4ef1e6b4c6' + + def up + with_lock_retries do + execute('LOCK ci_builds, security_scans IN ACCESS EXCLUSIVE MODE') + remove_foreign_key_if_exists(:security_scans, :ci_builds, name: CONSTRAINT_NAME) + end + end + + def down + add_concurrent_foreign_key(:security_scans, :ci_builds, column: :build_id, on_delete: :cascade, name: CONSTRAINT_NAME) + end +end diff --git a/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb b/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb new file mode 100644 index 00000000000..6de0f9424e8 --- /dev/null +++ b/db/post_migrate/20220111023852_index_cluster_agent_tokens_on_status.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class IndexClusterAgentTokensOnStatus < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_cluster_agent_tokens_on_agent_id_status_last_used_at' + + def up + add_concurrent_index :cluster_agent_tokens, 'agent_id, status, last_used_at DESC NULLS LAST', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :cluster_agent_tokens, INDEX_NAME + end +end diff --git a/db/post_migrate/20220111093534_remove_index_on_auto_stop_in.rb b/db/post_migrate/20220111093534_remove_index_on_auto_stop_in.rb new file mode 100644 index 00000000000..bcb78b28376 --- /dev/null +++ b/db/post_migrate/20220111093534_remove_index_on_auto_stop_in.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveIndexOnAutoStopIn < Gitlab::Database::Migration[1.0] + TABLE = :environments + INDEX_NAME = 'index_environments_on_auto_stop_at' + COLUMN = :auto_stop_at + + disable_ddl_transaction! + + def up + remove_concurrent_index TABLE, COLUMN, where: 'auto_stop_at IS NOT NULL', name: INDEX_NAME + end + + def down + add_concurrent_index TABLE, COLUMN, where: 'auto_stop_at IS NOT NULL', name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220111101421_remove_index_on_merge_request_id.rb b/db/post_migrate/20220111101421_remove_index_on_merge_request_id.rb new file mode 100644 index 00000000000..38cc259312d --- /dev/null +++ b/db/post_migrate/20220111101421_remove_index_on_merge_request_id.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveIndexOnMergeRequestId < Gitlab::Database::Migration[1.0] + TABLE = :merge_request_context_commits + INDEX_NAME = 'index_merge_request_context_commits_on_merge_request_id' + COLUMN = :merge_request_id + + disable_ddl_transaction! + + def up + remove_concurrent_index TABLE, COLUMN, name: INDEX_NAME + end + + def down + add_concurrent_index TABLE, COLUMN, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220111102314_truncate_ci_mirror_tables.rb b/db/post_migrate/20220111102314_truncate_ci_mirror_tables.rb new file mode 100644 index 00000000000..795ec24f3bd --- /dev/null +++ b/db/post_migrate/20220111102314_truncate_ci_mirror_tables.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class TruncateCiMirrorTables < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + execute('TRUNCATE TABLE ci_namespace_mirrors') + execute('TRUNCATE TABLE ci_project_mirrors') + end + + def down + # noop + end +end diff --git a/db/post_migrate/20220111221516_remove_projects_ci_pending_builds_fk.rb b/db/post_migrate/20220111221516_remove_projects_ci_pending_builds_fk.rb new file mode 100644 index 00000000000..bc17c125ba7 --- /dev/null +++ b/db/post_migrate/20220111221516_remove_projects_ci_pending_builds_fk.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveProjectsCiPendingBuildsFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_pending_builds, :projects, name: "fk_rails_480669c3b3") + end + end + + def down + add_concurrent_foreign_key(:ci_pending_builds, :projects, name: "fk_rails_480669c3b3", column: :project_id, target_column: :id, on_delete: "cascade") + end +end diff --git a/db/post_migrate/20220112015940_remove_projects_ci_running_builds_fk.rb b/db/post_migrate/20220112015940_remove_projects_ci_running_builds_fk.rb new file mode 100644 index 00000000000..79d864e2c2a --- /dev/null +++ b/db/post_migrate/20220112015940_remove_projects_ci_running_builds_fk.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveProjectsCiRunningBuildsFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + execute('LOCK projects, ci_running_builds IN ACCESS EXCLUSIVE MODE') + + remove_foreign_key_if_exists(:ci_running_builds, :projects, name: "fk_rails_dc1d0801e8") + end + end + + def down + add_concurrent_foreign_key(:ci_running_builds, :projects, name: "fk_rails_dc1d0801e8", column: :project_id, target_column: :id, on_delete: "cascade") + end +end diff --git a/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb b/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb new file mode 100644 index 00000000000..d786c9d846a --- /dev/null +++ b/db/post_migrate/20220112090556_remove_cascade_delete_from_project_namespace_foreign_key.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class RemoveCascadeDeleteFromProjectNamespaceForeignKey < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + TARGET_COLUMN = :project_namespace_id + + def up + with_lock_retries do + remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN) + end + + add_concurrent_foreign_key(:projects, :namespaces, column: TARGET_COLUMN, on_delete: :nullify) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists(:projects, column: TARGET_COLUMN) + end + + add_concurrent_foreign_key(:projects, :namespaces, column: TARGET_COLUMN, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb b/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb new file mode 100644 index 00000000000..9ad90a3a7a0 --- /dev/null +++ b/db/post_migrate/20220112230642_remove_projects_ci_unit_tests_project_id_fk.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveProjectsCiUnitTestsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_unit_tests, :projects, name: "fk_7a8fabf0a8") + end + end + + def down + add_concurrent_foreign_key(:ci_unit_tests, :projects, name: "fk_7a8fabf0a8", column: :project_id, target_column: :id, on_delete: "cascade") + end +end diff --git a/db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb b/db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb new file mode 100644 index 00000000000..ad7cf2a20c9 --- /dev/null +++ b/db/post_migrate/20220112232723_remove_projects_ci_daily_build_group_report_results_project_id_fk.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveProjectsCiDailyBuildGroupReportResultsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + execute('LOCK projects, ci_daily_build_group_report_results IN ACCESS EXCLUSIVE MODE') + remove_foreign_key_if_exists(:ci_daily_build_group_report_results, :projects, name: "fk_rails_0667f7608c") + end + end + + def down + add_concurrent_foreign_key(:ci_daily_build_group_report_results, :projects, name: "fk_rails_0667f7608c", column: :project_id, target_column: :id, on_delete: "cascade") + end +end diff --git a/db/post_migrate/20220113013319_remove_projects_ci_freeze_periods_project_id_fk.rb b/db/post_migrate/20220113013319_remove_projects_ci_freeze_periods_project_id_fk.rb new file mode 100644 index 00000000000..13cfacdc223 --- /dev/null +++ b/db/post_migrate/20220113013319_remove_projects_ci_freeze_periods_project_id_fk.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveProjectsCiFreezePeriodsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_freeze_periods, :projects, name: "fk_2e02bbd1a6") + end + end + + def down + add_concurrent_foreign_key(:ci_freeze_periods, :projects, name: "fk_2e02bbd1a6", column: :project_id, target_column: :id, on_delete: "cascade") + end +end diff --git a/db/post_migrate/20220113014438_remove_projects_ci_resource_groups_project_id_fk.rb b/db/post_migrate/20220113014438_remove_projects_ci_resource_groups_project_id_fk.rb new file mode 100644 index 00000000000..e86dd015493 --- /dev/null +++ b/db/post_migrate/20220113014438_remove_projects_ci_resource_groups_project_id_fk.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveProjectsCiResourceGroupsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_resource_groups, :projects, name: "fk_774722d144") + end + end + + def down + add_concurrent_foreign_key(:ci_resource_groups, :projects, name: "fk_774722d144", column: :project_id, target_column: :id, on_delete: "cascade") + end +end diff --git a/db/post_migrate/20220113015830_remove_projects_ci_build_report_results_project_id_fk.rb b/db/post_migrate/20220113015830_remove_projects_ci_build_report_results_project_id_fk.rb new file mode 100644 index 00000000000..3d2753bf9bf --- /dev/null +++ b/db/post_migrate/20220113015830_remove_projects_ci_build_report_results_project_id_fk.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveProjectsCiBuildReportResultsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_build_report_results, :projects, name: "fk_rails_056d298d48") + end + end + + def down + add_concurrent_foreign_key(:ci_build_report_results, :projects, name: "fk_rails_056d298d48", column: :project_id, target_column: :id, on_delete: "cascade") + end +end diff --git a/db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb b/db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb new file mode 100644 index 00000000000..966286a6730 --- /dev/null +++ b/db/post_migrate/20220113035519_remove_users_ci_job_token_project_scope_links_added_by_id_fk.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveUsersCiJobTokenProjectScopeLinksAddedByIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_job_token_project_scope_links, :users, name: "fk_rails_35f7f506ce") + end + end + + def down + add_concurrent_foreign_key(:ci_job_token_project_scope_links, :users, name: "fk_rails_35f7f506ce", column: :added_by_id, target_column: :id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20220113040447_remove_users_ci_pipeline_schedules_owner_id_fk.rb b/db/post_migrate/20220113040447_remove_users_ci_pipeline_schedules_owner_id_fk.rb new file mode 100644 index 00000000000..2e5d4cfd22e --- /dev/null +++ b/db/post_migrate/20220113040447_remove_users_ci_pipeline_schedules_owner_id_fk.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveUsersCiPipelineSchedulesOwnerIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + remove_foreign_key_if_exists(:ci_pipeline_schedules, :users, name: "fk_9ea99f58d2") + end + end + + def down + add_concurrent_foreign_key(:ci_pipeline_schedules, :users, name: "fk_9ea99f58d2", column: :owner_id, target_column: :id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20220113111440_schedule_fix_incorrect_max_seats_used.rb b/db/post_migrate/20220113111440_schedule_fix_incorrect_max_seats_used.rb new file mode 100644 index 00000000000..f39b026bd77 --- /dev/null +++ b/db/post_migrate/20220113111440_schedule_fix_incorrect_max_seats_used.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class ScheduleFixIncorrectMaxSeatsUsed < Gitlab::Database::Migration[1.0] + DOWNTIME = false + TMP_IDX_NAME = 'tmp_gitlab_subscriptions_max_seats_used_migration' + + disable_ddl_transaction! + + def up + add_concurrent_index :gitlab_subscriptions, :id, where: "start_date >= '2021-08-02' AND start_date <= '2021-11-20' AND max_seats_used != 0 AND max_seats_used > seats_in_use AND max_seats_used > seats", name: TMP_IDX_NAME + + return unless Gitlab.com? + + migrate_in(1.hour, 'FixIncorrectMaxSeatsUsed') + end + + def down + remove_concurrent_index_by_name :gitlab_subscriptions, TMP_IDX_NAME + end +end diff --git a/db/post_migrate/20220114105525_add_index_on_projects_path.rb b/db/post_migrate/20220114105525_add_index_on_projects_path.rb new file mode 100644 index 00000000000..cef38f91b21 --- /dev/null +++ b/db/post_migrate/20220114105525_add_index_on_projects_path.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexOnProjectsPath < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + TABLE = :projects + INDEX_NAME = 'index_on_projects_path' + COLUMN = :path + + def up + add_concurrent_index TABLE, COLUMN, name: INDEX_NAME + end + + def down + remove_concurrent_index TABLE, COLUMN, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220116175851_add_author_index_to_design_management_versions.rb b/db/post_migrate/20220116175851_add_author_index_to_design_management_versions.rb new file mode 100644 index 00000000000..1ea89609926 --- /dev/null +++ b/db/post_migrate/20220116175851_add_author_index_to_design_management_versions.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddAuthorIndexToDesignManagementVersions < Gitlab::Database::Migration[1.0] + TABLE = :design_management_versions + INDEX_NAME = 'index_design_management_versions_on_author_id' + + disable_ddl_transaction! + + def up + add_concurrent_index TABLE, :author_id, where: 'author_id IS NOT NULL', name: INDEX_NAME + end + + def down + remove_concurrent_index TABLE, :author_id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220117034056_remove_index_cluster_agent_tokens_on_agent_id_and_last_used_at.rb b/db/post_migrate/20220117034056_remove_index_cluster_agent_tokens_on_agent_id_and_last_used_at.rb new file mode 100644 index 00000000000..5e306be016a --- /dev/null +++ b/db/post_migrate/20220117034056_remove_index_cluster_agent_tokens_on_agent_id_and_last_used_at.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveIndexClusterAgentTokensOnAgentIdAndLastUsedAt < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX = 'index_cluster_agent_tokens_on_agent_id_and_last_used_at' + + def up + remove_concurrent_index_by_name :cluster_agent_tokens, name: INDEX + end + + def down + add_concurrent_index :cluster_agent_tokens, 'agent_id, last_used_at DESC NULLS LAST', name: INDEX + end +end diff --git a/db/post_migrate/20220118204039_self_managed_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb b/db/post_migrate/20220118204039_self_managed_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb new file mode 100644 index 00000000000..18f68150e45 --- /dev/null +++ b/db/post_migrate/20220118204039_self_managed_reschedule_recalculate_vulnerability_finding_signatures_for_findings.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class SelfManagedRescheduleRecalculateVulnerabilityFindingSignaturesForFindings < Gitlab::Database::Migration[1.0] + MIGRATION = 'RecalculateVulnerabilityFindingSignaturesForFindings' + BATCH_SIZE = 1_000 + DELAY_INTERVAL = 2.minutes + + disable_ddl_transaction! + + def up + # Only run migration for self-managed + return if ::Gitlab.com? + + # Vulnerability Finding Signatures is an EE only feature + return unless Gitlab.ee? + + delete_queued_jobs(MIGRATION) + + requeue_background_migration_jobs_by_range_at_intervals( + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220119094503_populate_audit_event_streaming_verification_token.rb b/db/post_migrate/20220119094503_populate_audit_event_streaming_verification_token.rb new file mode 100644 index 00000000000..482f873739a --- /dev/null +++ b/db/post_migrate/20220119094503_populate_audit_event_streaming_verification_token.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class PopulateAuditEventStreamingVerificationToken < Gitlab::Database::Migration[1.0] + class ExternalAuditEventDestination < ActiveRecord::Base + self.table_name = 'audit_events_external_audit_event_destinations' + + def regenerate_verification_token + update!(verification_token: SecureRandom.base58(24)) + end + end + + def up + ExternalAuditEventDestination.all.each { |destination| destination.regenerate_verification_token } + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220119141736_remove_projects_ci_pipeline_artifacts_project_id_fk.rb b/db/post_migrate/20220119141736_remove_projects_ci_pipeline_artifacts_project_id_fk.rb new file mode 100644 index 00000000000..59a003c8f8d --- /dev/null +++ b/db/post_migrate/20220119141736_remove_projects_ci_pipeline_artifacts_project_id_fk.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveProjectsCiPipelineArtifactsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + execute('LOCK projects, ci_pipeline_artifacts IN ACCESS EXCLUSIVE MODE') + + remove_foreign_key_if_exists(:ci_pipeline_artifacts, :projects, name: "fk_rails_4a70390ca6") + end + end + + def down + add_concurrent_foreign_key(:ci_pipeline_artifacts, :projects, name: "fk_rails_4a70390ca6", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb b/db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb new file mode 100644 index 00000000000..7fe9f1c856b --- /dev/null +++ b/db/post_migrate/20220119143130_remove_projects_ci_sources_pipelines_source_project_id_fk.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveProjectsCiSourcesPipelinesSourceProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + execute('LOCK projects, ci_sources_pipelines IN ACCESS EXCLUSIVE MODE') + + remove_foreign_key_if_exists(:ci_sources_pipelines, :projects, name: "fk_acd9737679") + end + end + + def down + add_concurrent_foreign_key(:ci_sources_pipelines, :projects, name: "fk_acd9737679", column: :source_project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220119144458_remove_users_ci_triggers_owner_id_fk.rb b/db/post_migrate/20220119144458_remove_users_ci_triggers_owner_id_fk.rb new file mode 100644 index 00000000000..9acf53a6ea2 --- /dev/null +++ b/db/post_migrate/20220119144458_remove_users_ci_triggers_owner_id_fk.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveUsersCiTriggersOwnerIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + execute('LOCK users, ci_triggers IN ACCESS EXCLUSIVE MODE') + + remove_foreign_key_if_exists(:ci_triggers, :users, name: "fk_e8e10d1964") + end + end + + def down + add_concurrent_foreign_key(:ci_triggers, :users, name: "fk_e8e10d1964", column: :owner_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220119151221_remove_merge_requests_ci_pipelines_merge_request_id_fk.rb b/db/post_migrate/20220119151221_remove_merge_requests_ci_pipelines_merge_request_id_fk.rb new file mode 100644 index 00000000000..c7ced0ae3b7 --- /dev/null +++ b/db/post_migrate/20220119151221_remove_merge_requests_ci_pipelines_merge_request_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveMergeRequestsCiPipelinesMergeRequestIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_pipelines, :merge_requests, name: "fk_a23be95014") + + with_lock_retries do + execute('LOCK merge_requests, ci_pipelines IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_pipelines, :merge_requests, name: "fk_a23be95014") + end + end + + def down + add_concurrent_foreign_key(:ci_pipelines, :merge_requests, name: "fk_a23be95014", column: :merge_request_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220119153706_remove_ci_pipelines_merge_trains_pipeline_id_fk.rb b/db/post_migrate/20220119153706_remove_ci_pipelines_merge_trains_pipeline_id_fk.rb new file mode 100644 index 00000000000..92d68ff4fbb --- /dev/null +++ b/db/post_migrate/20220119153706_remove_ci_pipelines_merge_trains_pipeline_id_fk.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveCiPipelinesMergeTrainsPipelineIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + execute('LOCK ci_pipelines, merge_trains IN ACCESS EXCLUSIVE MODE') + + remove_foreign_key_if_exists(:merge_trains, :ci_pipelines, name: "fk_rails_f90820cb08") + end + end + + def down + add_concurrent_foreign_key(:merge_trains, :ci_pipelines, name: "fk_rails_f90820cb08", column: :pipeline_id, target_column: :id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20220119154442_remove_ci_pipelines_merge_requests_head_pipeline_id_fk.rb b/db/post_migrate/20220119154442_remove_ci_pipelines_merge_requests_head_pipeline_id_fk.rb new file mode 100644 index 00000000000..6a978ce2ab1 --- /dev/null +++ b/db/post_migrate/20220119154442_remove_ci_pipelines_merge_requests_head_pipeline_id_fk.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveCiPipelinesMergeRequestsHeadPipelineIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + execute('LOCK ci_pipelines, merge_requests IN ACCESS EXCLUSIVE MODE') + + remove_foreign_key_if_exists(:merge_requests, :ci_pipelines, name: "fk_fd82eae0b9") + end + end + + def down + add_concurrent_foreign_key(:merge_requests, :ci_pipelines, name: "fk_fd82eae0b9", column: :head_pipeline_id, target_column: :id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20220119193130_remove_ci_pipelines_dast_profiles_pipelines_ci_pipeline_id_fk.rb b/db/post_migrate/20220119193130_remove_ci_pipelines_dast_profiles_pipelines_ci_pipeline_id_fk.rb new file mode 100644 index 00000000000..f4eedd0fa70 --- /dev/null +++ b/db/post_migrate/20220119193130_remove_ci_pipelines_dast_profiles_pipelines_ci_pipeline_id_fk.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveCiPipelinesDastProfilesPipelinesCiPipelineIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + execute('LOCK ci_pipelines, dast_profiles_pipelines IN ACCESS EXCLUSIVE MODE') + + remove_foreign_key_if_exists(:dast_profiles_pipelines, :ci_pipelines, name: "fk_a60cad829d") + end + end + + def down + add_concurrent_foreign_key(:dast_profiles_pipelines, :ci_pipelines, name: "fk_a60cad829d", column: :ci_pipeline_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220119201340_remove_ci_pipelines_vulnerability_statistics_latest_pipeline_id_fk.rb b/db/post_migrate/20220119201340_remove_ci_pipelines_vulnerability_statistics_latest_pipeline_id_fk.rb new file mode 100644 index 00000000000..bd80767cf6a --- /dev/null +++ b/db/post_migrate/20220119201340_remove_ci_pipelines_vulnerability_statistics_latest_pipeline_id_fk.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveCiPipelinesVulnerabilityStatisticsLatestPipelineIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + execute('LOCK ci_pipelines, vulnerability_statistics IN ACCESS EXCLUSIVE MODE') + + remove_foreign_key_if_exists(:vulnerability_statistics, :ci_pipelines, name: "fk_e8b13c928f") + end + end + + def down + add_concurrent_foreign_key(:vulnerability_statistics, :ci_pipelines, name: "fk_e8b13c928f", column: :latest_pipeline_id, target_column: :id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20220119203119_remove_ci_pipelines_vulnerability_occurrence_pipelines_pipeline_id_fk.rb b/db/post_migrate/20220119203119_remove_ci_pipelines_vulnerability_occurrence_pipelines_pipeline_id_fk.rb new file mode 100644 index 00000000000..b6397486dd0 --- /dev/null +++ b/db/post_migrate/20220119203119_remove_ci_pipelines_vulnerability_occurrence_pipelines_pipeline_id_fk.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveCiPipelinesVulnerabilityOccurrencePipelinesPipelineIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + with_lock_retries do + execute('LOCK ci_pipelines, vulnerability_occurrence_pipelines IN ACCESS EXCLUSIVE MODE') + + remove_foreign_key_if_exists(:vulnerability_occurrence_pipelines, :ci_pipelines, name: "fk_rails_6421e35d7d") + end + end + + def down + add_concurrent_foreign_key(:vulnerability_occurrence_pipelines, :ci_pipelines, name: "fk_rails_6421e35d7d", column: :pipeline_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220120094340_drop_position_from_security_findings.rb b/db/post_migrate/20220120094340_drop_position_from_security_findings.rb new file mode 100644 index 00000000000..56af346ad1b --- /dev/null +++ b/db/post_migrate/20220120094340_drop_position_from_security_findings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class DropPositionFromSecurityFindings < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def change + remove_column :security_findings, :position, :integer + end +end diff --git a/db/post_migrate/20220120123700_add_tmp_index_routes_id_for_namespaces.rb b/db/post_migrate/20220120123700_add_tmp_index_routes_id_for_namespaces.rb new file mode 100644 index 00000000000..2b8cecd0e57 --- /dev/null +++ b/db/post_migrate/20220120123700_add_tmp_index_routes_id_for_namespaces.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddTmpIndexRoutesIdForNamespaces < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'tmp_index_for_namespace_id_migration_on_routes' + + disable_ddl_transaction! + + def up + # Temporary index to be removed in 14.9 + # https://gitlab.com/gitlab-org/gitlab/-/issues/352353 + add_concurrent_index :routes, :id, where: "routes.namespace_id is null and routes.source_type = 'Namespace'", name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :routes, INDEX_NAME + end +end diff --git a/db/post_migrate/20220120123800_backfill_namespace_id_for_namespace_routes.rb b/db/post_migrate/20220120123800_backfill_namespace_id_for_namespace_routes.rb new file mode 100644 index 00000000000..68279456ddd --- /dev/null +++ b/db/post_migrate/20220120123800_backfill_namespace_id_for_namespace_routes.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class BackfillNamespaceIdForNamespaceRoutes < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + MIGRATION = 'BackfillNamespaceIdForNamespaceRoute' + INTERVAL = 2.minutes + BATCH_SIZE = 1_000 + MAX_BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 200 + + def up + queue_batched_background_migration( + MIGRATION, + :routes, + :id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :routes, :id, []) + end +end diff --git a/db/post_migrate/20220120211832_backfill_member_namespace_id_for_group_members.rb b/db/post_migrate/20220120211832_backfill_member_namespace_id_for_group_members.rb new file mode 100644 index 00000000000..279084e0fc5 --- /dev/null +++ b/db/post_migrate/20220120211832_backfill_member_namespace_id_for_group_members.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class BackfillMemberNamespaceIdForGroupMembers < Gitlab::Database::Migration[1.0] + MIGRATION = 'BackfillMemberNamespaceForGroupMembers' + INTERVAL = 2.minutes + BATCH_SIZE = 1_000 + MAX_BATCH_SIZE = 2_000 + SUB_BATCH_SIZE = 100 + + disable_ddl_transaction! + + def up + queue_batched_background_migration( + MIGRATION, + :members, + :id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :members, :id, []) + end +end diff --git a/db/post_migrate/20220121214752_remove_projects_ci_stages_project_id_fk.rb b/db/post_migrate/20220121214752_remove_projects_ci_stages_project_id_fk.rb new file mode 100644 index 00000000000..93f0b30571a --- /dev/null +++ b/db/post_migrate/20220121214752_remove_projects_ci_stages_project_id_fk.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveProjectsCiStagesProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return if Gitlab.com? # unsafe migration, skip on GitLab.com due to https://gitlab.com/groups/gitlab-org/-/epics/7249#note_819625526 + return unless foreign_key_exists?(:ci_stages, :projects, name: "fk_2360681d1d") + + with_lock_retries do + execute('LOCK projects, ci_stages IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_stages, :projects, name: "fk_2360681d1d") + end + end + + def down + add_concurrent_foreign_key(:ci_stages, :projects, name: "fk_2360681d1d", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220121214753_re_remove_projects_ci_stages_project_id_fk.rb b/db/post_migrate/20220121214753_re_remove_projects_ci_stages_project_id_fk.rb new file mode 100644 index 00000000000..45dec15a5a7 --- /dev/null +++ b/db/post_migrate/20220121214753_re_remove_projects_ci_stages_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class ReRemoveProjectsCiStagesProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_stages, :projects, name: "fk_2360681d1d") + + with_lock_retries do + execute('LOCK projects, ci_stages IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_stages, :projects, name: "fk_2360681d1d") + end + end + + def down + # no-op, since the FK will be added via rollback by prior-migration + end +end diff --git a/db/post_migrate/20220121221651_remove_projects_ci_variables_project_id_fk.rb b/db/post_migrate/20220121221651_remove_projects_ci_variables_project_id_fk.rb new file mode 100644 index 00000000000..f647d4376ac --- /dev/null +++ b/db/post_migrate/20220121221651_remove_projects_ci_variables_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiVariablesProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_variables, :projects, name: "fk_ada5eb64b3") + + with_lock_retries do + execute('LOCK projects, ci_variables IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_variables, :projects, name: "fk_ada5eb64b3") + end + end + + def down + add_concurrent_foreign_key(:ci_variables, :projects, name: "fk_ada5eb64b3", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220124130028_dedup_runner_projects.rb b/db/post_migrate/20220124130028_dedup_runner_projects.rb new file mode 100644 index 00000000000..1a4c895f1c4 --- /dev/null +++ b/db/post_migrate/20220124130028_dedup_runner_projects.rb @@ -0,0 +1,71 @@ +# frozen_string_literal: true + +class DedupRunnerProjects < Gitlab::Database::Migration[1.0] + TABLE_NAME = :ci_runner_projects + TMP_INDEX_NAME = 'tmp_unique_ci_runner_projects_by_runner_id_and_project_id' + OLD_INDEX_NAME = 'index_ci_runner_projects_on_runner_id_and_project_id' + INDEX_NAME = 'index_unique_ci_runner_projects_on_runner_id_and_project_id' + BATCH_SIZE = 5000 + + disable_ddl_transaction! + + module Ci + class RunnerProject < ActiveRecord::Base + include EachBatch + + self.table_name = 'ci_runner_projects' + end + end + + def up + last_runner_project_record_id = Ci::RunnerProject.maximum(:id) || 0 + + # This index will disallow further duplicates while we're deduplicating the data. + add_concurrent_index(TABLE_NAME, [:runner_id, :project_id], where: "id > #{Integer(last_runner_project_record_id)}", unique: true, name: TMP_INDEX_NAME) + + Ci::RunnerProject.each_batch(of: BATCH_SIZE) do |relation| + duplicated_runner_projects = Ci::RunnerProject + .select('COUNT(*)', :runner_id, :project_id) + .where('(runner_id, project_id) IN (?)', relation.select(:runner_id, :project_id)) + .group(:runner_id, :project_id) + .having('COUNT(*) > 1') + + duplicated_runner_projects.each do |runner_project| + deduplicate_item(runner_project) + end + end + + add_concurrent_index(TABLE_NAME, [:runner_id, :project_id], unique: true, name: INDEX_NAME) + remove_concurrent_index_by_name(TABLE_NAME, TMP_INDEX_NAME) + remove_concurrent_index_by_name(TABLE_NAME, OLD_INDEX_NAME) + end + + def down + add_concurrent_index(TABLE_NAME, [:runner_id, :project_id], name: OLD_INDEX_NAME) + remove_concurrent_index_by_name(TABLE_NAME, TMP_INDEX_NAME) + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + private + + def deduplicate_item(runner_project) + runner_projects_records = Ci::RunnerProject + .where(project_id: runner_project.project_id, runner_id: runner_project.runner_id) + .order(updated_at: :asc) + .to_a + + attributes = {} + runner_projects_records.each do |runner_projects_record| + params = runner_projects_record.attributes.except('id') + attributes.merge!(params.compact) + end + + ApplicationRecord.transaction do + record_to_keep = runner_projects_records.pop + records_to_delete = runner_projects_records + + Ci::RunnerProject.where(id: records_to_delete.map(&:id)).delete_all + record_to_keep.update!(attributes) + end + end +end diff --git a/db/post_migrate/20220124145019_remove_projects_external_pull_requests_project_id_fk.rb b/db/post_migrate/20220124145019_remove_projects_external_pull_requests_project_id_fk.rb new file mode 100644 index 00000000000..b16234fc812 --- /dev/null +++ b/db/post_migrate/20220124145019_remove_projects_external_pull_requests_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsExternalPullRequestsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:external_pull_requests, :projects, name: "fk_rails_bcae9b5c7b") + + with_lock_retries do + execute('LOCK projects, external_pull_requests IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:external_pull_requests, :projects, name: "fk_rails_bcae9b5c7b") + end + end + + def down + add_concurrent_foreign_key(:external_pull_requests, :projects, name: "fk_rails_bcae9b5c7b", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220124151456_remove_projects_ci_triggers_project_id_fk.rb b/db/post_migrate/20220124151456_remove_projects_ci_triggers_project_id_fk.rb new file mode 100644 index 00000000000..684d363eb96 --- /dev/null +++ b/db/post_migrate/20220124151456_remove_projects_ci_triggers_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiTriggersProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_triggers, :projects, name: "fk_e3e63f966e") + + with_lock_retries do + execute('LOCK projects, ci_triggers IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_triggers, :projects, name: "fk_e3e63f966e") + end + end + + def down + add_concurrent_foreign_key(:ci_triggers, :projects, name: "fk_e3e63f966e", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220124151949_remove_projects_ci_runner_projects_project_id_fk.rb b/db/post_migrate/20220124151949_remove_projects_ci_runner_projects_project_id_fk.rb new file mode 100644 index 00000000000..de8feb96a06 --- /dev/null +++ b/db/post_migrate/20220124151949_remove_projects_ci_runner_projects_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiRunnerProjectsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_runner_projects, :projects, name: "fk_4478a6f1e4") + + with_lock_retries do + execute('LOCK projects, ci_runner_projects IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_runner_projects, :projects, name: "fk_4478a6f1e4") + end + end + + def down + add_concurrent_foreign_key(:ci_runner_projects, :projects, name: "fk_4478a6f1e4", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220124152824_remove_projects_ci_subscriptions_projects_downstream_project_id_fk.rb b/db/post_migrate/20220124152824_remove_projects_ci_subscriptions_projects_downstream_project_id_fk.rb new file mode 100644 index 00000000000..8596b1f14ba --- /dev/null +++ b/db/post_migrate/20220124152824_remove_projects_ci_subscriptions_projects_downstream_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiSubscriptionsProjectsDownstreamProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_subscriptions_projects, :projects, name: "fk_rails_0818751483") + + with_lock_retries do + execute('LOCK projects, ci_subscriptions_projects IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_subscriptions_projects, :projects, name: "fk_rails_0818751483") + end + end + + def down + add_concurrent_foreign_key(:ci_subscriptions_projects, :projects, name: "fk_rails_0818751483", column: :downstream_project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220124153233_remove_projects_ci_job_artifacts_project_id_fk.rb b/db/post_migrate/20220124153233_remove_projects_ci_job_artifacts_project_id_fk.rb new file mode 100644 index 00000000000..1948a78916d --- /dev/null +++ b/db/post_migrate/20220124153233_remove_projects_ci_job_artifacts_project_id_fk.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveProjectsCiJobArtifactsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return if Gitlab.com? # unsafe migration, skip on GitLab.com due to https://gitlab.com/groups/gitlab-org/-/epics/7249#note_819625526 + return unless foreign_key_exists?(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9") + + with_lock_retries do + execute('LOCK projects, ci_job_artifacts IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9") + end + end + + def down + add_concurrent_foreign_key(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220124153234_re_remove_projects_ci_job_artifacts_project_id_fk.rb b/db/post_migrate/20220124153234_re_remove_projects_ci_job_artifacts_project_id_fk.rb new file mode 100644 index 00000000000..bb59134b927 --- /dev/null +++ b/db/post_migrate/20220124153234_re_remove_projects_ci_job_artifacts_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class ReRemoveProjectsCiJobArtifactsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9") + + with_lock_retries do + execute('LOCK projects, ci_job_artifacts IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_job_artifacts, :projects, name: "fk_rails_9862d392f9") + end + end + + def down + # no-op, since the FK will be added via rollback by prior-migration + end +end diff --git a/db/post_migrate/20220124180704_remove_projects_ci_builds_metadata_project_id_fk.rb b/db/post_migrate/20220124180704_remove_projects_ci_builds_metadata_project_id_fk.rb new file mode 100644 index 00000000000..fc9dc2cc6dc --- /dev/null +++ b/db/post_migrate/20220124180704_remove_projects_ci_builds_metadata_project_id_fk.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveProjectsCiBuildsMetadataProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return if Gitlab.com? # unsafe migration, skip on GitLab.com due to https://gitlab.com/groups/gitlab-org/-/epics/7249#note_819625526 + return unless foreign_key_exists?(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02") + + with_lock_retries do + execute('LOCK projects, ci_builds_metadata IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02") + end + end + + def down + add_concurrent_foreign_key(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220124180705_re_remove_projects_ci_builds_metadata_project_id_fk.rb b/db/post_migrate/20220124180705_re_remove_projects_ci_builds_metadata_project_id_fk.rb new file mode 100644 index 00000000000..6483b8e0643 --- /dev/null +++ b/db/post_migrate/20220124180705_re_remove_projects_ci_builds_metadata_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class ReRemoveProjectsCiBuildsMetadataProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02") + + with_lock_retries do + execute('LOCK projects, ci_builds_metadata IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_builds_metadata, :projects, name: "fk_rails_ffcf702a02") + end + end + + def down + # no-op, since the FK will be added via rollback by prior-migration + end +end diff --git a/db/post_migrate/20220124184338_remove_projects_ci_subscriptions_projects_upstream_project_id_fk.rb b/db/post_migrate/20220124184338_remove_projects_ci_subscriptions_projects_upstream_project_id_fk.rb new file mode 100644 index 00000000000..50448f4a884 --- /dev/null +++ b/db/post_migrate/20220124184338_remove_projects_ci_subscriptions_projects_upstream_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiSubscriptionsProjectsUpstreamProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_subscriptions_projects, :projects, name: "fk_rails_7871f9a97b") + + with_lock_retries do + execute('LOCK projects, ci_subscriptions_projects IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_subscriptions_projects, :projects, name: "fk_rails_7871f9a97b") + end + end + + def down + add_concurrent_foreign_key(:ci_subscriptions_projects, :projects, name: "fk_rails_7871f9a97b", column: :upstream_project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220124204046_remove_projects_ci_sources_pipelines_project_id_fk.rb b/db/post_migrate/20220124204046_remove_projects_ci_sources_pipelines_project_id_fk.rb new file mode 100644 index 00000000000..e15d337045e --- /dev/null +++ b/db/post_migrate/20220124204046_remove_projects_ci_sources_pipelines_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiSourcesPipelinesProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_sources_pipelines, :projects, name: "fk_1e53c97c0a") + + with_lock_retries do + execute('LOCK projects, ci_sources_pipelines IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_sources_pipelines, :projects, name: "fk_1e53c97c0a") + end + end + + def down + add_concurrent_foreign_key(:ci_sources_pipelines, :projects, name: "fk_1e53c97c0a", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220124214131_remove_projects_ci_refs_project_id_fk.rb b/db/post_migrate/20220124214131_remove_projects_ci_refs_project_id_fk.rb new file mode 100644 index 00000000000..f90d477673a --- /dev/null +++ b/db/post_migrate/20220124214131_remove_projects_ci_refs_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiRefsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_refs, :projects, name: "fk_rails_4249db8cc3") + + with_lock_retries do + execute('LOCK projects, ci_refs IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_refs, :projects, name: "fk_rails_4249db8cc3") + end + end + + def down + add_concurrent_foreign_key(:ci_refs, :projects, name: "fk_rails_4249db8cc3", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220124215857_remove_projects_ci_job_token_project_scope_links_source_project_id_fk.rb b/db/post_migrate/20220124215857_remove_projects_ci_job_token_project_scope_links_source_project_id_fk.rb new file mode 100644 index 00000000000..8bfe9586a50 --- /dev/null +++ b/db/post_migrate/20220124215857_remove_projects_ci_job_token_project_scope_links_source_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiJobTokenProjectScopeLinksSourceProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_job_token_project_scope_links, :projects, name: "fk_rails_4b2ee3290b") + + with_lock_retries do + execute('LOCK projects, ci_job_token_project_scope_links IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_job_token_project_scope_links, :projects, name: "fk_rails_4b2ee3290b") + end + end + + def down + add_concurrent_foreign_key(:ci_job_token_project_scope_links, :projects, name: "fk_rails_4b2ee3290b", column: :source_project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220124221521_remove_projects_ci_project_monthly_usages_project_id_fk.rb b/db/post_migrate/20220124221521_remove_projects_ci_project_monthly_usages_project_id_fk.rb new file mode 100644 index 00000000000..cff78342d21 --- /dev/null +++ b/db/post_migrate/20220124221521_remove_projects_ci_project_monthly_usages_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiProjectMonthlyUsagesProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_project_monthly_usages, :projects, name: "fk_rails_508bcd4aa6") + + with_lock_retries do + execute('LOCK projects, ci_project_monthly_usages IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_project_monthly_usages, :projects, name: "fk_rails_508bcd4aa6") + end + end + + def down + add_concurrent_foreign_key(:ci_project_monthly_usages, :projects, name: "fk_rails_508bcd4aa6", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220125083520_remove_ci_pipelines_dast_site_profiles_pipelines_ci_pipeline_id_fk.rb b/db/post_migrate/20220125083520_remove_ci_pipelines_dast_site_profiles_pipelines_ci_pipeline_id_fk.rb new file mode 100644 index 00000000000..b111b95fccf --- /dev/null +++ b/db/post_migrate/20220125083520_remove_ci_pipelines_dast_site_profiles_pipelines_ci_pipeline_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveCiPipelinesDastSiteProfilesPipelinesCiPipelineIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:dast_site_profiles_pipelines, :ci_pipelines, name: "fk_53849b0ad5") + + with_lock_retries do + execute('LOCK ci_pipelines, dast_site_profiles_pipelines IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:dast_site_profiles_pipelines, :ci_pipelines, name: "fk_53849b0ad5") + end + end + + def down + add_concurrent_foreign_key(:dast_site_profiles_pipelines, :ci_pipelines, name: "fk_53849b0ad5", column: :ci_pipeline_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220125084348_remove_ci_pipelines_vulnerability_feedback_pipeline_id_fk.rb b/db/post_migrate/20220125084348_remove_ci_pipelines_vulnerability_feedback_pipeline_id_fk.rb new file mode 100644 index 00000000000..1b932d084bb --- /dev/null +++ b/db/post_migrate/20220125084348_remove_ci_pipelines_vulnerability_feedback_pipeline_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveCiPipelinesVulnerabilityFeedbackPipelineIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:vulnerability_feedback, :ci_pipelines, name: "fk_rails_20976e6fd9") + + with_lock_retries do + execute('LOCK ci_pipelines, vulnerability_feedback IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:vulnerability_feedback, :ci_pipelines, name: "fk_rails_20976e6fd9") + end + end + + def down + add_concurrent_foreign_key(:vulnerability_feedback, :ci_pipelines, name: "fk_rails_20976e6fd9", column: :pipeline_id, target_column: :id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb b/db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb new file mode 100644 index 00000000000..dee86a70553 --- /dev/null +++ b/db/post_migrate/20220125122640_schedule_populate_topics_non_private_projects_count.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class SchedulePopulateTopicsNonPrivateProjectsCount < Gitlab::Database::Migration[1.0] + MIGRATION = 'PopulateTopicsNonPrivateProjectsCount' + BATCH_SIZE = 10_000 + DELAY_INTERVAL = 2.minutes + + disable_ddl_transaction! + + def up + queue_background_migration_jobs_by_range_at_intervals( + define_batchable_model('topics'), + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220126201752_remove_projects_ci_job_token_project_scope_links_target_project_id_fk.rb b/db/post_migrate/20220126201752_remove_projects_ci_job_token_project_scope_links_target_project_id_fk.rb new file mode 100644 index 00000000000..a33e02f2408 --- /dev/null +++ b/db/post_migrate/20220126201752_remove_projects_ci_job_token_project_scope_links_target_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiJobTokenProjectScopeLinksTargetProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_job_token_project_scope_links, :projects, name: "fk_rails_6904b38465") + + with_lock_retries do + execute('LOCK projects, ci_job_token_project_scope_links IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_job_token_project_scope_links, :projects, name: "fk_rails_6904b38465") + end + end + + def down + add_concurrent_foreign_key(:ci_job_token_project_scope_links, :projects, name: "fk_rails_6904b38465", column: :target_project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220126202654_remove_projects_ci_sources_projects_source_project_id_fk.rb b/db/post_migrate/20220126202654_remove_projects_ci_sources_projects_source_project_id_fk.rb new file mode 100644 index 00000000000..a69cd43b921 --- /dev/null +++ b/db/post_migrate/20220126202654_remove_projects_ci_sources_projects_source_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiSourcesProjectsSourceProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_sources_projects, :projects, name: "fk_rails_64b6855cbc") + + with_lock_retries do + execute('LOCK projects, ci_sources_projects IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_sources_projects, :projects, name: "fk_rails_64b6855cbc") + end + end + + def down + add_concurrent_foreign_key(:ci_sources_projects, :projects, name: "fk_rails_64b6855cbc", column: :source_project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220126203421_remove_projects_ci_pipeline_schedules_project_id_fk.rb b/db/post_migrate/20220126203421_remove_projects_ci_pipeline_schedules_project_id_fk.rb new file mode 100644 index 00000000000..870127ab168 --- /dev/null +++ b/db/post_migrate/20220126203421_remove_projects_ci_pipeline_schedules_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiPipelineSchedulesProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_pipeline_schedules, :projects, name: "fk_8ead60fcc4") + + with_lock_retries do + execute('LOCK projects, ci_pipeline_schedules IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_pipeline_schedules, :projects, name: "fk_8ead60fcc4") + end + end + + def down + add_concurrent_foreign_key(:ci_pipeline_schedules, :projects, name: "fk_8ead60fcc4", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220126210021_remove_projects_ci_builds_project_id_fk.rb b/db/post_migrate/20220126210021_remove_projects_ci_builds_project_id_fk.rb new file mode 100644 index 00000000000..8caa6db7507 --- /dev/null +++ b/db/post_migrate/20220126210021_remove_projects_ci_builds_project_id_fk.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveProjectsCiBuildsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return if Gitlab.com? # unsafe migration, skip on GitLab.com due to https://gitlab.com/groups/gitlab-org/-/epics/7249#note_819625526 + return unless foreign_key_exists?(:ci_builds, :projects, name: "fk_befce0568a") + + with_lock_retries do + execute('LOCK projects, ci_builds IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_builds, :projects, name: "fk_befce0568a") + end + end + + def down + add_concurrent_foreign_key(:ci_builds, :projects, name: "fk_befce0568a", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220126210022_re_remove_projects_ci_builds_project_id_fk.rb b/db/post_migrate/20220126210022_re_remove_projects_ci_builds_project_id_fk.rb new file mode 100644 index 00000000000..2a026388bbf --- /dev/null +++ b/db/post_migrate/20220126210022_re_remove_projects_ci_builds_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class ReRemoveProjectsCiBuildsProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_builds, :projects, name: "fk_befce0568a") + + with_lock_retries do + execute('LOCK projects, ci_builds IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_builds, :projects, name: "fk_befce0568a") + end + end + + def down + # no-op, since the FK will be added via rollback by prior-migration + end +end diff --git a/db/post_migrate/20220126210657_remove_projects_ci_pipelines_project_id_fk.rb b/db/post_migrate/20220126210657_remove_projects_ci_pipelines_project_id_fk.rb new file mode 100644 index 00000000000..6867cf720f3 --- /dev/null +++ b/db/post_migrate/20220126210657_remove_projects_ci_pipelines_project_id_fk.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class RemoveProjectsCiPipelinesProjectIdFk < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless foreign_key_exists?(:ci_pipelines, :projects, name: "fk_86635dbd80") + + with_lock_retries do + execute('LOCK projects, ci_pipelines IN ACCESS EXCLUSIVE MODE') if transaction_open? + + remove_foreign_key_if_exists(:ci_pipelines, :projects, name: "fk_86635dbd80") + end + end + + def down + add_concurrent_foreign_key(:ci_pipelines, :projects, name: "fk_86635dbd80", column: :project_id, target_column: :id, on_delete: :cascade) + end +end diff --git a/db/post_migrate/20220127112243_add_index_to_merge_request_assignees_state.rb b/db/post_migrate/20220127112243_add_index_to_merge_request_assignees_state.rb new file mode 100644 index 00000000000..e6bb43af760 --- /dev/null +++ b/db/post_migrate/20220127112243_add_index_to_merge_request_assignees_state.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToMergeRequestAssigneesState < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_on_merge_request_assignees_state' + + def up + add_concurrent_index :merge_request_assignees, :state, where: 'state = 2', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :merge_request_assignees, INDEX_NAME + end +end diff --git a/db/post_migrate/20220127112412_add_index_to_merge_request_reviewers_state.rb b/db/post_migrate/20220127112412_add_index_to_merge_request_reviewers_state.rb new file mode 100644 index 00000000000..13f4e05c15b --- /dev/null +++ b/db/post_migrate/20220127112412_add_index_to_merge_request_reviewers_state.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToMergeRequestReviewersState < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_on_merge_request_reviewers_state' + + def up + add_concurrent_index :merge_request_reviewers, :state, where: 'state = 2', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :merge_request_reviewers, INDEX_NAME + end +end diff --git a/db/post_migrate/20220127132200_cleanup_backfill_ci_namespace_mirrors.rb b/db/post_migrate/20220127132200_cleanup_backfill_ci_namespace_mirrors.rb new file mode 100644 index 00000000000..a6775251d42 --- /dev/null +++ b/db/post_migrate/20220127132200_cleanup_backfill_ci_namespace_mirrors.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class CleanupBackfillCiNamespaceMirrors < Gitlab::Database::Migration[1.0] + def up + # no-op + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220127132201_cleanup_backfill_ci_project_mirrors.rb b/db/post_migrate/20220127132201_cleanup_backfill_ci_project_mirrors.rb new file mode 100644 index 00000000000..c0cdb74c595 --- /dev/null +++ b/db/post_migrate/20220127132201_cleanup_backfill_ci_project_mirrors.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class CleanupBackfillCiProjectMirrors < Gitlab::Database::Migration[1.0] + def up + # no-op + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220128103042_schedule_delete_invalid_epic_issues_revised.rb b/db/post_migrate/20220128103042_schedule_delete_invalid_epic_issues_revised.rb new file mode 100644 index 00000000000..642bf012ce0 --- /dev/null +++ b/db/post_migrate/20220128103042_schedule_delete_invalid_epic_issues_revised.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class ScheduleDeleteInvalidEpicIssuesRevised < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + MIGRATION = 'DeleteInvalidEpicIssues' + INTERVAL = 2.minutes + BATCH_SIZE = 1_000 + MAX_BATCH_SIZE = 2_000 + SUB_BATCH_SIZE = 50 + + def up + queue_batched_background_migration( + MIGRATION, + :epics, + :id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :epics, :id, []) + end +end diff --git a/db/post_migrate/20220128155251_remove_dangling_running_builds.rb b/db/post_migrate/20220128155251_remove_dangling_running_builds.rb new file mode 100644 index 00000000000..f86a21ced00 --- /dev/null +++ b/db/post_migrate/20220128155251_remove_dangling_running_builds.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class RemoveDanglingRunningBuilds < Gitlab::Database::Migration[1.0] + BATCH_SIZE = 100 + + disable_ddl_transaction! + + def up + each_batch_range('ci_running_builds', of: BATCH_SIZE) do |min, max| + execute <<~SQL + DELETE FROM ci_running_builds + USING ci_builds + WHERE ci_builds.id = ci_running_builds.build_id + AND ci_builds.status = 'failed' + AND ci_builds.type = 'Ci::Build' + AND ci_running_builds.id BETWEEN #{min} AND #{max} + SQL + end + end + + def down + # no-op + # This migration deletes data and it can not be reversed + end +end diff --git a/db/post_migrate/20220128155814_fix_approval_rules_code_owners_rule_type_index.rb b/db/post_migrate/20220128155814_fix_approval_rules_code_owners_rule_type_index.rb new file mode 100644 index 00000000000..eccfab25126 --- /dev/null +++ b/db/post_migrate/20220128155814_fix_approval_rules_code_owners_rule_type_index.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class FixApprovalRulesCodeOwnersRuleTypeIndex < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_approval_rules_code_owners_rule_type' + OLD_INDEX_NAME = 'index_approval_rules_code_owners_rule_type_old' + TABLE = :approval_merge_request_rules + COLUMN = :merge_request_id + WHERE_CONDITION = 'rule_type = 2' + + disable_ddl_transaction! + + def up + rename_index TABLE, INDEX_NAME, OLD_INDEX_NAME if index_exists_by_name?(TABLE, INDEX_NAME) && !index_exists_by_name?(TABLE, OLD_INDEX_NAME) + + add_concurrent_index TABLE, COLUMN, where: WHERE_CONDITION, name: INDEX_NAME + + remove_concurrent_index_by_name TABLE, OLD_INDEX_NAME + end + + def down + # No-op + end +end diff --git a/db/post_migrate/20220131000000_index_job_artifacts_on_trace_type_and_expire_at.rb b/db/post_migrate/20220131000000_index_job_artifacts_on_trace_type_and_expire_at.rb new file mode 100644 index 00000000000..f47c04dd2ef --- /dev/null +++ b/db/post_migrate/20220131000000_index_job_artifacts_on_trace_type_and_expire_at.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class IndexJobArtifactsOnTraceTypeAndExpireAt < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'tmp_index_ci_job_artifacts_on_id_where_trace_and_expire_at' + TIMESTAMPS = "'2021-04-22 00:00:00', '2021-05-22 00:00:00', '2021-06-22 00:00:00', '2022-01-22 00:00:00', '2022-02-22 00:00:00', '2022-03-22 00:00:00', '2022-04-22 00:00:00'" + + def up + add_concurrent_index :ci_job_artifacts, :id, where: "file_type = 3 AND expire_at IN (#{TIMESTAMPS})", name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME + end +end diff --git a/db/post_migrate/20220131000001_schedule_trace_expiry_removal.rb b/db/post_migrate/20220131000001_schedule_trace_expiry_removal.rb new file mode 100644 index 00000000000..8e282a9b8c2 --- /dev/null +++ b/db/post_migrate/20220131000001_schedule_trace_expiry_removal.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +class ScheduleTraceExpiryRemoval < Gitlab::Database::Migration[1.0] + MIGRATION = 'RemoveAllTraceExpirationDates' + BATCH_SIZE = 100_000 + DELAY_INTERVAL = 4.minutes + + disable_ddl_transaction! + + # Stubbed class to connect to the CI database + # connects_to has to be called in abstract classes. + class MultiDbAdaptableClass < ActiveRecord::Base + self.abstract_class = true + + if Gitlab::Database.has_config?(:ci) + connects_to database: { writing: :ci, reading: :ci } + end + end + + # Stubbed class to access the ci_job_artifacts table + class JobArtifact < MultiDbAdaptableClass + include EachBatch + + self.table_name = 'ci_job_artifacts' + + TARGET_TIMESTAMPS = [ + Date.new(2021, 04, 22).midnight.utc, + Date.new(2021, 05, 22).midnight.utc, + Date.new(2021, 06, 22).midnight.utc, + Date.new(2022, 01, 22).midnight.utc, + Date.new(2022, 02, 22).midnight.utc, + Date.new(2022, 03, 22).midnight.utc, + Date.new(2022, 04, 22).midnight.utc + ].freeze + + scope :in_targeted_timestamps, -> { where(expire_at: TARGET_TIMESTAMPS) } + scope :traces, -> { where(file_type: 3) } + end + + def up + return unless Gitlab.com? + + queue_background_migration_jobs_by_range_at_intervals( + JobArtifact.traces.in_targeted_timestamps, + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220201034731_remove_index_clusters_kubernetes_namespaces_on_cluster_id.rb b/db/post_migrate/20220201034731_remove_index_clusters_kubernetes_namespaces_on_cluster_id.rb new file mode 100644 index 00000000000..0e2ef3b3324 --- /dev/null +++ b/db/post_migrate/20220201034731_remove_index_clusters_kubernetes_namespaces_on_cluster_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveIndexClustersKubernetesNamespacesOnClusterId < Gitlab::Database::Migration[1.0] + INDEX = 'index_clusters_kubernetes_namespaces_on_cluster_id' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :clusters_kubernetes_namespaces, INDEX + end + + def down + add_concurrent_index :clusters_kubernetes_namespaces, :cluster_id, name: INDEX + end +end diff --git a/db/post_migrate/20220201141705_cleanup_background_migration_populate_test_reports_issue_id.rb b/db/post_migrate/20220201141705_cleanup_background_migration_populate_test_reports_issue_id.rb new file mode 100644 index 00000000000..252b4a01d04 --- /dev/null +++ b/db/post_migrate/20220201141705_cleanup_background_migration_populate_test_reports_issue_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CleanupBackgroundMigrationPopulateTestReportsIssueId < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + MIGRATION = 'PopulateTestReportsIssueId' + + def up + finalize_background_migration(MIGRATION) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220201173212_add_user_details_provisioning_index.rb b/db/post_migrate/20220201173212_add_user_details_provisioning_index.rb new file mode 100644 index 00000000000..a864ec7e395 --- /dev/null +++ b/db/post_migrate/20220201173212_add_user_details_provisioning_index.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddUserDetailsProvisioningIndex < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'idx_user_details_on_provisioned_by_group_id_user_id' + OLD_INDEX_NAME = 'index_user_details_on_provisioned_by_group_id' + + def up + add_concurrent_index :user_details, [:provisioned_by_group_id, :user_id], name: INDEX_NAME + remove_concurrent_index_by_name :user_details, OLD_INDEX_NAME + end + + def down + add_concurrent_index :user_details, :provisioned_by_group_id, name: OLD_INDEX_NAME + remove_concurrent_index_by_name :user_details, INDEX_NAME + end +end diff --git a/db/post_migrate/20220201193033_add_unique_index_to_vulnerability_finding_links_with_truncate.rb b/db/post_migrate/20220201193033_add_unique_index_to_vulnerability_finding_links_with_truncate.rb new file mode 100644 index 00000000000..cc9dabdf624 --- /dev/null +++ b/db/post_migrate/20220201193033_add_unique_index_to_vulnerability_finding_links_with_truncate.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddUniqueIndexToVulnerabilityFindingLinksWithTruncate < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + NAME_URL_INDEX_NAME = 'finding_link_name_url_idx' + URL_INDEX_NAME = 'finding_link_url_idx' + + def up + execute('TRUNCATE TABLE vulnerability_finding_links') + + add_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :name, :url], unique: true, name: NAME_URL_INDEX_NAME + add_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :url], unique: true, where: 'name is null', name: URL_INDEX_NAME + end + + def down + remove_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :name, :url], name: NAME_URL_INDEX_NAME + remove_concurrent_index :vulnerability_finding_links, [:vulnerability_occurrence_id, :url], name: URL_INDEX_NAME + end +end diff --git a/db/post_migrate/20220202105733_delete_service_template_records.rb b/db/post_migrate/20220202105733_delete_service_template_records.rb new file mode 100644 index 00000000000..e1697f23588 --- /dev/null +++ b/db/post_migrate/20220202105733_delete_service_template_records.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DeleteServiceTemplateRecords < Gitlab::Database::Migration[1.0] + class Integration < ActiveRecord::Base + # Disable single-table inheritance + self.inheritance_column = :_type_disabled + end + + def up + Integration.where(template: true).delete_all + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220204053655_remove_index_epic_issues_on_epic_id.rb b/db/post_migrate/20220204053655_remove_index_epic_issues_on_epic_id.rb new file mode 100644 index 00000000000..7815829d36a --- /dev/null +++ b/db/post_migrate/20220204053655_remove_index_epic_issues_on_epic_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveIndexEpicIssuesOnEpicId < Gitlab::Database::Migration[1.0] + INDEX = 'index_epic_issues_on_epic_id' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :epic_issues, name: INDEX + end + + def down + add_concurrent_index :epic_issues, :epic_id, name: INDEX + end +end diff --git a/db/post_migrate/20220204095121_backfill_namespace_statistics_with_dependency_proxy_size.rb b/db/post_migrate/20220204095121_backfill_namespace_statistics_with_dependency_proxy_size.rb new file mode 100644 index 00000000000..49c9efc497c --- /dev/null +++ b/db/post_migrate/20220204095121_backfill_namespace_statistics_with_dependency_proxy_size.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class BackfillNamespaceStatisticsWithDependencyProxySize < Gitlab::Database::Migration[1.0] + DELAY_INTERVAL = 2.minutes.to_i + BATCH_SIZE = 500 + MIGRATION = 'PopulateNamespaceStatistics' + + disable_ddl_transaction! + + def up + groups = exec_query <<~SQL + SELECT dependency_proxy_manifests.group_id FROM dependency_proxy_manifests + UNION + SELECT dependency_proxy_blobs.group_id from dependency_proxy_blobs + SQL + + groups.rows.flatten.in_groups_of(BATCH_SIZE, false).each_with_index do |group_ids, index| + migrate_in(index * DELAY_INTERVAL, MIGRATION, [group_ids, [:dependency_proxy_size]]) + end + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220204110725_backfill_cycle_analytics_aggregations.rb b/db/post_migrate/20220204110725_backfill_cycle_analytics_aggregations.rb new file mode 100644 index 00000000000..933ad747c5c --- /dev/null +++ b/db/post_migrate/20220204110725_backfill_cycle_analytics_aggregations.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +class BackfillCycleAnalyticsAggregations < Gitlab::Database::Migration[1.0] + BATCH_SIZE = 50 + + def up + model = define_batchable_model('analytics_cycle_analytics_group_value_streams') + + model.each_batch(of: BATCH_SIZE) do |relation| + execute <<~SQL + WITH records_to_be_inserted AS #{Gitlab::Database::AsWithMaterialized.materialized_if_supported} ( + SELECT root_ancestor.id AS group_id + FROM (#{relation.select(:group_id).to_sql}) as value_streams, + LATERAL ( + WITH RECURSIVE "base_and_ancestors" AS ( + (SELECT "namespaces"."id", "namespaces"."parent_id" FROM "namespaces" WHERE "namespaces"."id" = value_streams.group_id) + UNION + (SELECT "namespaces"."id", "namespaces"."parent_id" FROM "namespaces", "base_and_ancestors" WHERE "namespaces"."id" = "base_and_ancestors"."parent_id") + ) + SELECT "namespaces"."id" FROM "base_and_ancestors" as "namespaces" WHERE parent_id IS NULL LIMIT 1 + ) as root_ancestor + ) + INSERT INTO "analytics_cycle_analytics_aggregations" + SELECT * FROM "records_to_be_inserted" + ON CONFLICT DO NOTHING + SQL + end + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220204194347_encrypt_integration_properties.rb b/db/post_migrate/20220204194347_encrypt_integration_properties.rb new file mode 100644 index 00000000000..82dd3a05e1d --- /dev/null +++ b/db/post_migrate/20220204194347_encrypt_integration_properties.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class EncryptIntegrationProperties < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + MIGRATION = 'EncryptIntegrationProperties' + BATCH_SIZE = 1_000 + INTERVAL = 2.minutes.to_i + + def up + queue_background_migration_jobs_by_range_at_intervals( + define_batchable_model('integrations').all, + MIGRATION, + INTERVAL, + track_jobs: true, + batch_size: BATCH_SIZE + ) + end + + def down + # this migration is not reversible + end +end diff --git a/db/post_migrate/20220207080758_update_api_indexes_for_projects.rb b/db/post_migrate/20220207080758_update_api_indexes_for_projects.rb new file mode 100644 index 00000000000..3275912b0ab --- /dev/null +++ b/db/post_migrate/20220207080758_update_api_indexes_for_projects.rb @@ -0,0 +1,48 @@ +# frozen_string_literal: true + +class UpdateApiIndexesForProjects < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + ARCHIVED_INDEX_NAME = 'idx_projects_api_created_at_id_for_archived' + OLD_ARCHIVED_INDEX_NAME = 'index_projects_api_created_at_id_for_archived' + PUBLIC_AND_ARCHIVED_INDEX_NAME = 'idx_projects_api_created_at_id_for_archived_vis20' + OLD_PUBLIC_AND_ARCHIVED_INDEX_NAME = 'index_projects_api_created_at_id_for_archived_vis20' + INTERNAL_PROJECTS_INDEX_NAME = 'idx_projects_api_created_at_id_for_vis10' + OLD_INTERNAL_PROJECTS_INDEX_NAME = 'index_projects_api_created_at_id_for_vis10' + + def up + add_concurrent_index :projects, [:created_at, :id], + where: "archived = true AND pending_delete = false AND hidden = false", + name: ARCHIVED_INDEX_NAME + + add_concurrent_index :projects, [:created_at, :id], + where: "archived = true AND visibility_level = 20 AND pending_delete = false AND hidden = false", + name: PUBLIC_AND_ARCHIVED_INDEX_NAME + + add_concurrent_index :projects, [:created_at, :id], + where: "visibility_level = 10 AND pending_delete = false AND hidden = false", + name: INTERNAL_PROJECTS_INDEX_NAME + + remove_concurrent_index_by_name :projects, OLD_ARCHIVED_INDEX_NAME + remove_concurrent_index_by_name :projects, OLD_PUBLIC_AND_ARCHIVED_INDEX_NAME + remove_concurrent_index_by_name :projects, OLD_INTERNAL_PROJECTS_INDEX_NAME + end + + def down + add_concurrent_index :projects, [:created_at, :id], + where: "archived = true AND pending_delete = false", + name: OLD_ARCHIVED_INDEX_NAME + + add_concurrent_index :projects, [:created_at, :id], + where: "archived = true AND visibility_level = 20 AND pending_delete = false", + name: OLD_PUBLIC_AND_ARCHIVED_INDEX_NAME + + add_concurrent_index :projects, [:created_at, :id], + where: "visibility_level = 10 AND pending_delete = false", + name: OLD_INTERNAL_PROJECTS_INDEX_NAME + + remove_concurrent_index_by_name :projects, ARCHIVED_INDEX_NAME + remove_concurrent_index_by_name :projects, PUBLIC_AND_ARCHIVED_INDEX_NAME + remove_concurrent_index_by_name :projects, INTERNAL_PROJECTS_INDEX_NAME + end +end diff --git a/db/post_migrate/20220208080921_schedule_migrate_personal_namespace_project_maintainer_to_owner.rb b/db/post_migrate/20220208080921_schedule_migrate_personal_namespace_project_maintainer_to_owner.rb new file mode 100644 index 00000000000..633570aeaa0 --- /dev/null +++ b/db/post_migrate/20220208080921_schedule_migrate_personal_namespace_project_maintainer_to_owner.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class ScheduleMigratePersonalNamespaceProjectMaintainerToOwner < Gitlab::Database::Migration[1.0] + MIGRATION = 'MigratePersonalNamespaceProjectMaintainerToOwner' + INTERVAL = 2.minutes + BATCH_SIZE = 1_000 + SUB_BATCH_SIZE = 200 + + disable_ddl_transaction! + + def up + queue_batched_background_migration( + MIGRATION, + :members, + :id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220208115439_start_backfill_ci_queuing_tables.rb b/db/post_migrate/20220208115439_start_backfill_ci_queuing_tables.rb new file mode 100644 index 00000000000..82e36174290 --- /dev/null +++ b/db/post_migrate/20220208115439_start_backfill_ci_queuing_tables.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class StartBackfillCiQueuingTables < Gitlab::Database::Migration[1.0] + MIGRATION = 'BackfillCiQueuingTables' + BATCH_SIZE = 500 + DELAY_INTERVAL = 2.minutes + + disable_ddl_transaction! + + def up + return if Gitlab.com? + + queue_background_migration_jobs_by_range_at_intervals( + Gitlab::BackgroundMigration::BackfillCiQueuingTables::Ci::Build.pending, + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220209111007_add_partial_index_for_batching_active_cluster_image_scanning_vulnerabilities.rb b/db/post_migrate/20220209111007_add_partial_index_for_batching_active_cluster_image_scanning_vulnerabilities.rb new file mode 100644 index 00000000000..d38509ed8c2 --- /dev/null +++ b/db/post_migrate/20220209111007_add_partial_index_for_batching_active_cluster_image_scanning_vulnerabilities.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddPartialIndexForBatchingActiveClusterImageScanningVulnerabilities < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_vulnerabilities_on_project_id_and_id_active_cis' + INDEX_FILTER_CONDITION = 'report_type = 7 AND state = ANY(ARRAY[1, 4])' + + disable_ddl_transaction! + + def up + add_concurrent_index :vulnerabilities, [:project_id, :id], where: INDEX_FILTER_CONDITION, name: INDEX_NAME + end + + def down + remove_concurrent_index :vulnerabilities, [:project_id, :id], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220212120735_schedule_fix_incorrect_max_seats_used2.rb b/db/post_migrate/20220212120735_schedule_fix_incorrect_max_seats_used2.rb new file mode 100644 index 00000000000..c8a6bd0a15d --- /dev/null +++ b/db/post_migrate/20220212120735_schedule_fix_incorrect_max_seats_used2.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class ScheduleFixIncorrectMaxSeatsUsed2 < Gitlab::Database::Migration[1.0] + MIGRATION = 'FixIncorrectMaxSeatsUsed' + TMP_IDX_NAME = 'tmp_gitlab_subscriptions_max_seats_used_migration_2' + + disable_ddl_transaction! + + def up + add_concurrent_index :gitlab_subscriptions, :id, where: "start_date < '2021-08-02' AND max_seats_used != 0 AND max_seats_used > seats_in_use AND max_seats_used > seats", name: TMP_IDX_NAME + + return unless Gitlab.com? + + migrate_in(1.hour, MIGRATION, ['batch_2_for_start_date_before_02_aug_2021']) + end + + def down + remove_concurrent_index_by_name :gitlab_subscriptions, TMP_IDX_NAME + end +end diff --git a/db/post_migrate/20220213103859_remove_integrations_type.rb b/db/post_migrate/20220213103859_remove_integrations_type.rb new file mode 100644 index 00000000000..3c420760a2d --- /dev/null +++ b/db/post_migrate/20220213103859_remove_integrations_type.rb @@ -0,0 +1,132 @@ +# frozen_string_literal: true + +class RemoveIntegrationsType < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + MIGRATION = 'BackfillIntegrationsTypeNew' + BATCH_SIZE = 50 + TABLE_NAME = :integrations + COLUMN = :type + + # see db/post_migrate/20220213104531_create_indexes_on_integration_type_new.rb + def indices + [ + { + name: "index_integrations_on_project_and_#{COLUMN}_where_inherit_null", + columns: [:project_id, COLUMN], + where: 'inherit_from_id IS NULL' + }, + { + name: "index_integrations_on_project_id_and_#{COLUMN}_unique", + columns: [:project_id, COLUMN], + unique: true + }, + { + name: "index_integrations_on_#{COLUMN}", + columns: [COLUMN] + }, + { + name: "index_integrations_on_#{COLUMN}_and_instance_partial", + columns: [COLUMN, :instance], + where: 'instance = true', + unique: true + }, + { + name: 'index_integrations_on_type_id_when_active_and_project_id_not_nu', + columns: [COLUMN, :id], + where: '((active = true) AND (project_id IS NOT NULL))' + }, + { + name: "index_integrations_on_unique_group_id_and_#{COLUMN}", + columns: [:group_id, COLUMN], + unique: true + } + ] + end + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: TABLE_NAME, + column_name: :id, + job_arguments: []) + + cleanup_unmigrated_rows! + + remove_column :integrations, :type, :text + end + + # WARNING: this migration is not really safe to be reverted, since doing so + # will leave the type column empty. If this migration is reverted, we will + # need to backfill it from type_new + def down + add_column :integrations, :type, 'character varying' + + indices.each do |index| + add_concurrent_index TABLE_NAME, index[:columns], index.except(:columns) + end + end + + # Convert any remaining unmigrated rows + def cleanup_unmigrated_rows! + tmp_index_name = 'tmp_idx_integrations_unmigrated_type_new' + add_concurrent_index :integrations, :id, where: 'type_new is null', name: tmp_index_name + + define_batchable_model(:integrations).where(type_new: nil).each_batch do |batch| + min_id, max_id = batch.pick(Arel.sql('MIN(id), MAX(id)')) + + connection.execute(<<~SQL) + WITH mapping(old_type, new_type) AS (VALUES + ('AsanaService', 'Integrations::Asana'), + ('AssemblaService', 'Integrations::Assembla'), + ('BambooService', 'Integrations::Bamboo'), + ('BugzillaService', 'Integrations::Bugzilla'), + ('BuildkiteService', 'Integrations::Buildkite'), + ('CampfireService', 'Integrations::Campfire'), + ('ConfluenceService', 'Integrations::Confluence'), + ('CustomIssueTrackerService', 'Integrations::CustomIssueTracker'), + ('DatadogService', 'Integrations::Datadog'), + ('DiscordService', 'Integrations::Discord'), + ('DroneCiService', 'Integrations::DroneCi'), + ('EmailsOnPushService', 'Integrations::EmailsOnPush'), + ('EwmService', 'Integrations::Ewm'), + ('ExternalWikiService', 'Integrations::ExternalWiki'), + ('FlowdockService', 'Integrations::Flowdock'), + ('HangoutsChatService', 'Integrations::HangoutsChat'), + ('IrkerService', 'Integrations::Irker'), + ('JenkinsService', 'Integrations::Jenkins'), + ('JiraService', 'Integrations::Jira'), + ('MattermostService', 'Integrations::Mattermost'), + ('MattermostSlashCommandsService', 'Integrations::MattermostSlashCommands'), + ('MicrosoftTeamsService', 'Integrations::MicrosoftTeams'), + ('MockCiService', 'Integrations::MockCi'), + ('MockMonitoringService', 'Integrations::MockMonitoring'), + ('PackagistService', 'Integrations::Packagist'), + ('PipelinesEmailService', 'Integrations::PipelinesEmail'), + ('PivotaltrackerService', 'Integrations::Pivotaltracker'), + ('PrometheusService', 'Integrations::Prometheus'), + ('PushoverService', 'Integrations::Pushover'), + ('RedmineService', 'Integrations::Redmine'), + ('SlackService', 'Integrations::Slack'), + ('SlackSlashCommandsService', 'Integrations::SlackSlashCommands'), + ('TeamcityService', 'Integrations::Teamcity'), + ('UnifyCircuitService', 'Integrations::UnifyCircuit'), + ('WebexTeamsService', 'Integrations::WebexTeams'), + ('YoutrackService', 'Integrations::Youtrack'), + + -- EE-only integrations + ('GithubService', 'Integrations::Github'), + ('GitlabSlackApplicationService', 'Integrations::GitlabSlackApplication') + ) + + UPDATE integrations SET type_new = mapping.new_type + FROM mapping + WHERE integrations.type_new IS NULL + AND integrations.id BETWEEN #{min_id} AND #{max_id} + AND integrations.type = mapping.old_type + SQL + end + ensure + remove_concurrent_index_by_name(:integrations, tmp_index_name) + end +end diff --git a/db/post_migrate/20220213104531_create_indexes_on_integration_type_new.rb b/db/post_migrate/20220213104531_create_indexes_on_integration_type_new.rb new file mode 100644 index 00000000000..3a9f48dec44 --- /dev/null +++ b/db/post_migrate/20220213104531_create_indexes_on_integration_type_new.rb @@ -0,0 +1,60 @@ +# frozen_string_literal: true + +# Reproduce the indices on integrations.type on integrations.type_new +class CreateIndexesOnIntegrationTypeNew < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + TABLE_NAME = :integrations + COLUMN = :type_new + + def indices + [ + { + name: "index_integrations_on_project_and_#{COLUMN}_where_inherit_null", + columns: [:project_id, COLUMN], + where: 'inherit_from_id IS NULL' + }, + { + name: "index_integrations_on_project_id_and_#{COLUMN}_unique", + columns: [:project_id, COLUMN], + unique: true + }, + { + name: "index_integrations_on_#{COLUMN}", + columns: [COLUMN] + }, + { + name: "index_integrations_on_#{COLUMN}_and_instance_partial", + columns: [COLUMN, :instance], + where: 'instance = true' + }, + { + name: "index_integrations_on_#{COLUMN}_and_template_partial", + columns: [COLUMN, :template], + where: 'template = true' + }, + { + # column names are limited to 63 characters, so this one is re-worded for clarity + name: "index_integrations_on_#{COLUMN}_id_when_active_and_has_project", + columns: [COLUMN, :id], + where: '((active = true) AND (project_id IS NOT NULL))' + }, + { + name: "index_integrations_on_unique_group_id_and_#{COLUMN}", + columns: [:group_id, COLUMN] + } + ] + end + + def up + indices.each do |index| + add_concurrent_index TABLE_NAME, index[:columns], index.except(:columns) + end + end + + def down + indices.each do |index| + remove_concurrent_index_by_name TABLE_NAME, index[:name] + end + end +end diff --git a/db/post_migrate/20220215190020_rerun_convert_stringified_raw_metadata_hash_to_json.rb b/db/post_migrate/20220215190020_rerun_convert_stringified_raw_metadata_hash_to_json.rb new file mode 100644 index 00000000000..1f36132c578 --- /dev/null +++ b/db/post_migrate/20220215190020_rerun_convert_stringified_raw_metadata_hash_to_json.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class RerunConvertStringifiedRawMetadataHashToJson < Gitlab::Database::Migration[1.0] + MIGRATION_CLASS = Gitlab::BackgroundMigration::FixVulnerabilityOccurrencesWithHashesAsRawMetadata + MODEL_CLASS = MIGRATION_CLASS::Finding + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 500 + + disable_ddl_transaction! + + def up + queue_background_migration_jobs_by_range_at_intervals( + MODEL_CLASS.by_api_report_types, + MIGRATION_CLASS.name.demodulize, + DELAY_INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true + ) + end + + def down + # no-op + + # up fixes invalid data by updating columns in-place. + # It is a backwards-compatible change, and reversing it in a downgrade would not be desirable. + end +end diff --git a/db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb b/db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb new file mode 100644 index 00000000000..589b75dd918 --- /dev/null +++ b/db/post_migrate/20220216201949_remove_package_files_limit_from_application_settings.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class RemovePackageFilesLimitFromApplicationSettings < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + return unless column_exists?(:application_settings, :max_package_files_for_package_destruction) + + remove_column :application_settings, :max_package_files_for_package_destruction, :smallint + end + + def down + add_column :application_settings, :max_package_files_for_package_destruction, :smallint, default: 100, null: false + add_check_constraint :application_settings, + 'max_package_files_for_package_destruction > 0', + 'app_settings_max_package_files_for_package_destruction_positive' + end +end diff --git a/db/post_migrate/20220217135229_validate_not_null_constraint_on_security_findings_uuid.rb b/db/post_migrate/20220217135229_validate_not_null_constraint_on_security_findings_uuid.rb new file mode 100644 index 00000000000..9cc04cef757 --- /dev/null +++ b/db/post_migrate/20220217135229_validate_not_null_constraint_on_security_findings_uuid.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class ValidateNotNullConstraintOnSecurityFindingsUuid < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + validate_not_null_constraint(:security_findings, :uuid) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220221214928_remove_show_diff_preview_in_email_column.rb b/db/post_migrate/20220221214928_remove_show_diff_preview_in_email_column.rb new file mode 100644 index 00000000000..41cd3446c7a --- /dev/null +++ b/db/post_migrate/20220221214928_remove_show_diff_preview_in_email_column.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemoveShowDiffPreviewInEmailColumn < Gitlab::Database::Migration[1.0] + enable_lock_retries! + + def up + remove_column :project_settings, :show_diff_preview_in_email, :boolean + end + + def down + add_column :project_settings, :show_diff_preview_in_email, :boolean, default: true, null: false + end +end diff --git a/db/post_migrate/20220222191845_remove_not_null_constraint_for_security_scan_succeeded.rb b/db/post_migrate/20220222191845_remove_not_null_constraint_for_security_scan_succeeded.rb new file mode 100644 index 00000000000..4d4a20b83b3 --- /dev/null +++ b/db/post_migrate/20220222191845_remove_not_null_constraint_for_security_scan_succeeded.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RemoveNotNullConstraintForSecurityScanSucceeded < Gitlab::Database::Migration[1.0] + def up + change_column_null :analytics_devops_adoption_snapshots, :security_scan_succeeded, true + end + + def down + # There may now be nulls in the table, so we cannot re-add the constraint here. + end +end diff --git a/db/post_migrate/20220222192524_create_not_null_constraint_releases_tag.rb b/db/post_migrate/20220222192524_create_not_null_constraint_releases_tag.rb new file mode 100644 index 00000000000..2bb5ba18743 --- /dev/null +++ b/db/post_migrate/20220222192524_create_not_null_constraint_releases_tag.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class CreateNotNullConstraintReleasesTag < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + add_not_null_constraint :releases, :tag, constraint_name: 'releases_not_null_tag', validate: false + end + + def down + remove_not_null_constraint :releases, :tag, constraint_name: 'releases_not_null_tag' + end +end diff --git a/db/post_migrate/20220222192525_remove_null_releases.rb b/db/post_migrate/20220222192525_remove_null_releases.rb new file mode 100644 index 00000000000..4efd5393122 --- /dev/null +++ b/db/post_migrate/20220222192525_remove_null_releases.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class RemoveNullReleases < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + class Release < ActiveRecord::Base + include EachBatch + + self.table_name = 'releases' + end + + def up + Release.all.each_batch(of: 25000) do |rel| + rel.where(tag: nil).delete_all + end + end + + def down + # no-op + # + # releases with the same tag within a project have been removed + # and therefore the duplicate release data is no longer available + end +end diff --git a/db/post_migrate/20220223112304_schedule_nullify_orphan_runner_id_on_ci_builds.rb b/db/post_migrate/20220223112304_schedule_nullify_orphan_runner_id_on_ci_builds.rb new file mode 100644 index 00000000000..10b6ab8204d --- /dev/null +++ b/db/post_migrate/20220223112304_schedule_nullify_orphan_runner_id_on_ci_builds.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class ScheduleNullifyOrphanRunnerIdOnCiBuilds < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + MIGRATION = 'NullifyOrphanRunnerIdOnCiBuilds' + INTERVAL = 2.minutes + BATCH_SIZE = 50_000 + MAX_BATCH_SIZE = 150_000 + SUB_BATCH_SIZE = 500 + + def up + queue_batched_background_migration( + MIGRATION, + :ci_builds, + :id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :ci_builds, :id, []) + end +end diff --git a/db/post_migrate/20220223124428_schedule_merge_topics_with_same_name.rb b/db/post_migrate/20220223124428_schedule_merge_topics_with_same_name.rb new file mode 100644 index 00000000000..7e79c89203a --- /dev/null +++ b/db/post_migrate/20220223124428_schedule_merge_topics_with_same_name.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class ScheduleMergeTopicsWithSameName < Gitlab::Database::Migration[1.0] + MIGRATION = 'MergeTopicsWithSameName' + BATCH_SIZE = 100 + + disable_ddl_transaction! + + class Topic < ActiveRecord::Base + self.table_name = 'topics' + end + + def up + Topic.select('LOWER(name) as name').group('LOWER(name)').having('COUNT(*) > 1').order('LOWER(name)') + .in_groups_of(BATCH_SIZE, false).each_with_index do |group, i| + migrate_in((i + 1) * 2.minutes, MIGRATION, [group.map(&:name)]) + end + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220224000000_async_build_trace_expire_at_index.rb b/db/post_migrate/20220224000000_async_build_trace_expire_at_index.rb new file mode 100644 index 00000000000..b22f3e7996f --- /dev/null +++ b/db/post_migrate/20220224000000_async_build_trace_expire_at_index.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class AsyncBuildTraceExpireAtIndex < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'tmp_index_ci_job_artifacts_on_id_where_trace_and_expire_at' + TIMESTAMPS = "'2021-04-22 00:00:00', '2021-05-22 00:00:00', '2021-06-22 00:00:00', '2022-01-22 00:00:00', '2022-02-22 00:00:00', '2022-03-22 00:00:00', '2022-04-22 00:00:00'" + + def up + prepare_async_index :ci_job_artifacts, :id, where: "file_type = 3 AND expire_at IN (#{TIMESTAMPS})", name: INDEX_NAME + end + + def down + unprepare_async_index :ci_builds, :id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220224204415_recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb b/db/post_migrate/20220224204415_recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb new file mode 100644 index 00000000000..feb0f2c83ab --- /dev/null +++ b/db/post_migrate/20220224204415_recreate_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +class RecreateIndexSecurityCiBuildsOnNameAndIdParserWithNewFeatures < Gitlab::Database::Migration[1.0] + TABLE = "ci_builds" + OLD_INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features" + NEW_INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features_old" + COLUMNS = %i[name id] + CONSTRAINTS = "(name::text = ANY (ARRAY['container_scanning'::character varying::text, + 'dast'::character varying::text, + 'dependency_scanning'::character varying::text, + 'license_management'::character varying::text, + 'sast'::character varying::text, + 'secret_detection'::character varying::text, + 'coverage_fuzzing'::character varying::text, + 'license_scanning'::character varying::text, + 'apifuzzer_fuzz'::character varying::text, + 'apifuzzer_fuzz_dnd'::character varying::text]) + ) AND type::text = 'Ci::Build'::text" + + enable_lock_retries! + + def up + rename_index(TABLE, OLD_INDEX_NAME, NEW_INDEX_NAME) + prepare_async_index TABLE, COLUMNS, name: OLD_INDEX_NAME, where: CONSTRAINTS + end + + def down + unprepare_async_index TABLE, COLUMNS, name: OLD_INDEX_NAME + rename_index(TABLE, NEW_INDEX_NAME, OLD_INDEX_NAME) + end +end diff --git a/db/post_migrate/20220225133705_cleanup_backfill_ci_queuing_tables.rb b/db/post_migrate/20220225133705_cleanup_backfill_ci_queuing_tables.rb new file mode 100644 index 00000000000..4fcf8a28727 --- /dev/null +++ b/db/post_migrate/20220225133705_cleanup_backfill_ci_queuing_tables.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CleanupBackfillCiQueuingTables < Gitlab::Database::Migration[1.0] + MIGRATION = 'BackfillCiQueuingTables' + + disable_ddl_transaction! + + def up + finalize_background_migration(MIGRATION) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220301093434_backfill_all_project_namespaces.rb b/db/post_migrate/20220301093434_backfill_all_project_namespaces.rb new file mode 100644 index 00000000000..607161004cf --- /dev/null +++ b/db/post_migrate/20220301093434_backfill_all_project_namespaces.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class BackfillAllProjectNamespaces < Gitlab::Database::Migration[1.0] + MIGRATION = 'ProjectNamespaces::BackfillProjectNamespaces' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1_000 + MAX_BATCH_SIZE = 5_000 + SUB_BATCH_SIZE = 10 + + disable_ddl_transaction! + + def up + queue_batched_background_migration( + MIGRATION, + :projects, + :id, + nil, + 'up', + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :projects, :id, [nil, 'up']) + end +end diff --git a/db/post_migrate/20220302114046_backfill_group_features.rb b/db/post_migrate/20220302114046_backfill_group_features.rb new file mode 100644 index 00000000000..5e0ff9095a3 --- /dev/null +++ b/db/post_migrate/20220302114046_backfill_group_features.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class BackfillGroupFeatures < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + MIGRATION = 'BackfillGroupFeatures' + INTERVAL = 2.minutes + BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 1_000 + + def up + queue_batched_background_migration( + MIGRATION, + :namespaces, + :id, + BATCH_SIZE, + job_interval: INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :namespaces, :id, [BATCH_SIZE]) + end +end diff --git a/db/post_migrate/20220302203410_create_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb b/db/post_migrate/20220302203410_create_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb new file mode 100644 index 00000000000..5be6bb00269 --- /dev/null +++ b/db/post_migrate/20220302203410_create_index_security_ci_builds_on_name_and_id_parser_with_new_features.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class CreateIndexSecurityCiBuildsOnNameAndIdParserWithNewFeatures < Gitlab::Database::Migration[1.0] + TABLE = "ci_builds" + COLUMNS = %i[name id] + INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features" + CONSTRAINTS = "(name::text = ANY (ARRAY['container_scanning'::character varying::text, + 'dast'::character varying::text, + 'dependency_scanning'::character varying::text, + 'license_management'::character varying::text, + 'sast'::character varying::text, + 'secret_detection'::character varying::text, + 'coverage_fuzzing'::character varying::text, + 'license_scanning'::character varying::text, + 'apifuzzer_fuzz'::character varying::text, + 'apifuzzer_fuzz_dnd'::character varying::text]) + ) AND type::text = 'Ci::Build'::text" + + disable_ddl_transaction! + + def up + add_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS) + end + + def down + remove_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS) + end +end diff --git a/db/post_migrate/20220304165107_drop_partitioned_foreign_keys.rb b/db/post_migrate/20220304165107_drop_partitioned_foreign_keys.rb new file mode 100644 index 00000000000..43f89b05fa4 --- /dev/null +++ b/db/post_migrate/20220304165107_drop_partitioned_foreign_keys.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class DropPartitionedForeignKeys < Gitlab::Database::Migration[1.0] + def up + drop_table :partitioned_foreign_keys + end + + def down + create_table :partitioned_foreign_keys do |t| + t.boolean :cascade_delete, null: false, default: true + t.text :from_table, null: false, limit: 63 + t.text :from_column, null: false, limit: 63 + t.text :to_table, null: false, limit: 63 + t.text :to_column, null: false, limit: 63 + + t.index [:to_table, :from_table, :from_column], unique: true, name: :index_partitioned_foreign_keys_unique_index + end + end +end diff --git a/db/post_migrate/20220304201847_add_unique_index_on_security_training_providers.rb b/db/post_migrate/20220304201847_add_unique_index_on_security_training_providers.rb new file mode 100644 index 00000000000..e78b8fd48ca --- /dev/null +++ b/db/post_migrate/20220304201847_add_unique_index_on_security_training_providers.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddUniqueIndexOnSecurityTrainingProviders < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_security_training_providers_on_unique_name' + + disable_ddl_transaction! + + def up + add_concurrent_index :security_training_providers, :name, unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :security_training_providers, INDEX_NAME + end +end diff --git a/db/post_migrate/20220305223212_add_security_training_providers.rb b/db/post_migrate/20220305223212_add_security_training_providers.rb new file mode 100644 index 00000000000..fbddee0ae99 --- /dev/null +++ b/db/post_migrate/20220305223212_add_security_training_providers.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +class AddSecurityTrainingProviders < Gitlab::Database::Migration[1.0] + KONTRA_DATA = { + name: 'Kontra', + description: "Kontra Application Security provides interactive developer security education that + enables engineers to quickly learn security best practices + and fix issues in their code by analysing real-world software security vulnerabilities.", + url: "https://application.security/api/webhook/gitlab/exercises/search" + } + + SCW_DATA = { + name: 'Secure Code Warrior', + description: "Resolve vulnerabilities faster and confidently with highly relevant and bite-sized secure coding learning.", + url: "https://integration-api.securecodewarrior.com/api/v1/trial" + } + + module Security + class TrainingProvider < ActiveRecord::Base + self.table_name = 'security_training_providers' + end + end + + def up + current_time = Time.current + timestamps = { created_at: current_time, updated_at: current_time } + + Security::TrainingProvider.reset_column_information + + # upsert providers + Security::TrainingProvider.upsert_all([KONTRA_DATA.merge(timestamps), SCW_DATA.merge(timestamps)]) + end + + def down + Security::TrainingProvider.reset_column_information + + Security::TrainingProvider.find_by(name: KONTRA_DATA[:name])&.destroy + Security::TrainingProvider.find_by(name: SCW_DATA[:name])&.destroy + end +end diff --git a/db/post_migrate/20220307192534_create_index_for_remove_duplicate_project_tag_releases.rb b/db/post_migrate/20220307192534_create_index_for_remove_duplicate_project_tag_releases.rb new file mode 100644 index 00000000000..3e580c013c3 --- /dev/null +++ b/db/post_migrate/20220307192534_create_index_for_remove_duplicate_project_tag_releases.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CreateIndexForRemoveDuplicateProjectTagReleases < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_releases_on_id_project_id_tag' + + disable_ddl_transaction! + + def up + add_concurrent_index :releases, + %i[project_id tag id], + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :releases, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220307192610_remove_duplicate_project_tag_releases.rb b/db/post_migrate/20220307192610_remove_duplicate_project_tag_releases.rb new file mode 100644 index 00000000000..d8b99380825 --- /dev/null +++ b/db/post_migrate/20220307192610_remove_duplicate_project_tag_releases.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class RemoveDuplicateProjectTagReleases < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + class Release < ActiveRecord::Base + include EachBatch + + self.table_name = 'releases' + end + + def up + Release.each_batch(of: 5000) do |relation| + relation + .where('exists (select 1 from releases r2 where r2.project_id = releases.project_id and r2.tag = releases.tag and r2.id > releases.id)') + .delete_all + end + end + + def down + # no-op + # + # releases with the same tag within a project have been removed + # and therefore the duplicate release data is no longer available + end +end diff --git a/db/post_migrate/20220307192645_remove_index_for_remove_duplicate_project_tag_releases.rb b/db/post_migrate/20220307192645_remove_index_for_remove_duplicate_project_tag_releases.rb new file mode 100644 index 00000000000..8efb24daff9 --- /dev/null +++ b/db/post_migrate/20220307192645_remove_index_for_remove_duplicate_project_tag_releases.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveIndexForRemoveDuplicateProjectTagReleases < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_releases_on_id_project_id_tag' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :releases, name: INDEX_NAME + end + + def down + add_concurrent_index :releases, + %i[project_id tag id], + name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220307192725_create_unique_index_release_tag_project.rb b/db/post_migrate/20220307192725_create_unique_index_release_tag_project.rb new file mode 100644 index 00000000000..8540f19f079 --- /dev/null +++ b/db/post_migrate/20220307192725_create_unique_index_release_tag_project.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class CreateUniqueIndexReleaseTagProject < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_releases_on_project_tag_unique' + OLD_INDEX_NAME = 'index_releases_on_project_id_and_tag' + + disable_ddl_transaction! + + def up + add_concurrent_index :releases, + %i[project_id tag], + unique: true, + name: INDEX_NAME + remove_concurrent_index_by_name :releases, name: OLD_INDEX_NAME + end + + def down + remove_concurrent_index_by_name :releases, name: INDEX_NAME + add_concurrent_index :releases, + %i[project_id tag], + name: OLD_INDEX_NAME + end +end diff --git a/db/post_migrate/20220307203459_rename_user_email_lookup_limit_setting_to_search_settings_cleanup.rb b/db/post_migrate/20220307203459_rename_user_email_lookup_limit_setting_to_search_settings_cleanup.rb new file mode 100644 index 00000000000..2d01374780d --- /dev/null +++ b/db/post_migrate/20220307203459_rename_user_email_lookup_limit_setting_to_search_settings_cleanup.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RenameUserEmailLookupLimitSettingToSearchSettingsCleanup < Gitlab::Database::Migration[1.0] + class ApplicationSetting < ActiveRecord::Base + self.table_name = :application_settings + end + + def up + ApplicationSetting.update_all 'search_rate_limit=user_email_lookup_limit' + end + + def down + ApplicationSetting.update_all 'user_email_lookup_limit=search_rate_limit' + end +end diff --git a/db/post_migrate/20220308000205_drop_old_index_security_ci_builds_on_name_and_id_parser_features.rb b/db/post_migrate/20220308000205_drop_old_index_security_ci_builds_on_name_and_id_parser_features.rb new file mode 100644 index 00000000000..4b895c291d8 --- /dev/null +++ b/db/post_migrate/20220308000205_drop_old_index_security_ci_builds_on_name_and_id_parser_features.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class DropOldIndexSecurityCiBuildsOnNameAndIdParserFeatures < Gitlab::Database::Migration[1.0] + TABLE = "ci_builds" + COLUMNS = %i[name id] + INDEX_NAME = "index_security_ci_builds_on_name_and_id_parser_features_old" + CONSTRAINTS = "(name::text = ANY (ARRAY['container_scanning'::character varying::text, + 'dast'::character varying::text, + 'dependency_scanning'::character varying::text, + 'license_management'::character varying::text, + 'sast'::character varying::text, + 'secret_detection'::character varying::text, + 'coverage_fuzzing'::character varying::text, + 'license_scanning'::character varying::text]) + ) AND type::text = 'Ci::Build'::text" + + disable_ddl_transaction! + + def up + remove_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS) + end + + def down + add_concurrent_index(TABLE, COLUMNS, name: INDEX_NAME, where: CONSTRAINTS) + end +end diff --git a/db/post_migrate/20220308115219_schedule_reset_duplicate_ci_runners_token_encrypted_values_on_projects.rb b/db/post_migrate/20220308115219_schedule_reset_duplicate_ci_runners_token_encrypted_values_on_projects.rb new file mode 100644 index 00000000000..27e7af9a550 --- /dev/null +++ b/db/post_migrate/20220308115219_schedule_reset_duplicate_ci_runners_token_encrypted_values_on_projects.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class ScheduleResetDuplicateCiRunnersTokenEncryptedValuesOnProjects < Gitlab::Database::Migration[1.0] + MIGRATION = 'ResetDuplicateCiRunnersTokenEncryptedValuesOnProjects' + TOKEN_COLUMN_NAME = :runners_token_encrypted + TEMP_INDEX_NAME = "tmp_index_projects_on_id_and_#{TOKEN_COLUMN_NAME}" + BATCH_SIZE = 10_000 + DELAY_INTERVAL = 2.minutes + + disable_ddl_transaction! + + def up + add_concurrent_index :projects, [:id, TOKEN_COLUMN_NAME], where: "#{TOKEN_COLUMN_NAME} IS NOT NULL", unique: false, name: TEMP_INDEX_NAME + + queue_background_migration_jobs_by_range_at_intervals( + Gitlab::BackgroundMigration::ResetDuplicateCiRunnersTokenEncryptedValuesOnProjects::Project.base_query, + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true + ) + end + + def down + remove_concurrent_index_by_name(:projects, name: TEMP_INDEX_NAME) + end +end diff --git a/db/post_migrate/20220308115502_schedule_reset_duplicate_ci_runners_token_values_on_projects.rb b/db/post_migrate/20220308115502_schedule_reset_duplicate_ci_runners_token_values_on_projects.rb new file mode 100644 index 00000000000..f076b0a740e --- /dev/null +++ b/db/post_migrate/20220308115502_schedule_reset_duplicate_ci_runners_token_values_on_projects.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class ScheduleResetDuplicateCiRunnersTokenValuesOnProjects < Gitlab::Database::Migration[1.0] + MIGRATION = 'ResetDuplicateCiRunnersTokenValuesOnProjects' + TOKEN_COLUMN_NAME = :runners_token + TEMP_INDEX_NAME = "tmp_index_projects_on_id_and_#{TOKEN_COLUMN_NAME}" + BATCH_SIZE = 10_000 + DELAY_INTERVAL = 2.minutes + + disable_ddl_transaction! + + def up + add_concurrent_index :projects, [:id, TOKEN_COLUMN_NAME], where: "#{TOKEN_COLUMN_NAME} IS NOT NULL", unique: false, name: TEMP_INDEX_NAME + + queue_background_migration_jobs_by_range_at_intervals( + Gitlab::BackgroundMigration::ResetDuplicateCiRunnersTokenValuesOnProjects::Project.base_query, + MIGRATION, + DELAY_INTERVAL, + batch_size: BATCH_SIZE, + track_jobs: true + ) + end + + def down + remove_concurrent_index_by_name(:projects, name: TEMP_INDEX_NAME) + end +end diff --git a/db/post_migrate/20220309084838_remove_external_pull_request_tracking.rb b/db/post_migrate/20220309084838_remove_external_pull_request_tracking.rb new file mode 100644 index 00000000000..6159f9d6822 --- /dev/null +++ b/db/post_migrate/20220309084838_remove_external_pull_request_tracking.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveExternalPullRequestTracking < Gitlab::Database::Migration[1.0] + include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers + + enable_lock_retries! + + def up + untrack_record_deletions(:external_pull_requests) + end + + def down + track_record_deletions(:external_pull_requests) + end +end diff --git a/db/post_migrate/20220309084954_remove_leftover_external_pull_request_deletions.rb b/db/post_migrate/20220309084954_remove_leftover_external_pull_request_deletions.rb new file mode 100644 index 00000000000..ea9fd6b28c2 --- /dev/null +++ b/db/post_migrate/20220309084954_remove_leftover_external_pull_request_deletions.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class RemoveLeftoverExternalPullRequestDeletions < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + # Delete all pending record deletions in the public.external_pull_requests until + # there are no more rows left. + loop do + result = execute <<~SQL + DELETE FROM "loose_foreign_keys_deleted_records" + WHERE + ("loose_foreign_keys_deleted_records"."partition", "loose_foreign_keys_deleted_records"."id") IN ( + SELECT "loose_foreign_keys_deleted_records"."partition", "loose_foreign_keys_deleted_records"."id" + FROM "loose_foreign_keys_deleted_records" + WHERE + "loose_foreign_keys_deleted_records"."fully_qualified_table_name" = 'public.external_pull_requests' AND + "loose_foreign_keys_deleted_records"."status" = 1 + LIMIT 100 + ) + SQL + + break if result.cmd_tuples == 0 + end + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220309154855_add_index_on_issues_closed_incidents.rb b/db/post_migrate/20220309154855_add_index_on_issues_closed_incidents.rb new file mode 100644 index 00000000000..e9a2c1c85f2 --- /dev/null +++ b/db/post_migrate/20220309154855_add_index_on_issues_closed_incidents.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnIssuesClosedIncidents < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_on_issues_closed_incidents_by_project_id_and_closed_at' + + def up + add_concurrent_index :issues, [:project_id, :closed_at], where: "issue_type = 1 AND state_id = 2", name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :issues, INDEX_NAME + end +end diff --git a/db/post_migrate/20220310095341_add_async_index_ci_job_artifacts_project_id_created_at.rb b/db/post_migrate/20220310095341_add_async_index_ci_job_artifacts_project_id_created_at.rb new file mode 100644 index 00000000000..919e834a783 --- /dev/null +++ b/db/post_migrate/20220310095341_add_async_index_ci_job_artifacts_project_id_created_at.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class AddAsyncIndexCiJobArtifactsProjectIdCreatedAt < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_ci_job_artifacts_on_id_project_id_and_created_at' + + def up + prepare_async_index :ci_job_artifacts, [:project_id, :created_at, :id], name: INDEX_NAME + end + + def down + unprepare_async_index_by_name :ci_job_artifacts, INDEX_NAME + end +end diff --git a/db/post_migrate/20220310134207_add_index_project_id_and_released_at_and_id_on_releases.rb b/db/post_migrate/20220310134207_add_index_project_id_and_released_at_and_id_on_releases.rb new file mode 100644 index 00000000000..da928f3ec8f --- /dev/null +++ b/db/post_migrate/20220310134207_add_index_project_id_and_released_at_and_id_on_releases.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexProjectIdAndReleasedAtAndIdOnReleases < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_releases_on_project_id_and_released_at_and_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :releases, [:project_id, :released_at, :id], + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :releases, INDEX_NAME + end +end diff --git a/db/post_migrate/20220310141349_remove_dependency_list_usage_data_from_redis.rb b/db/post_migrate/20220310141349_remove_dependency_list_usage_data_from_redis.rb new file mode 100644 index 00000000000..3c1e6714529 --- /dev/null +++ b/db/post_migrate/20220310141349_remove_dependency_list_usage_data_from_redis.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemoveDependencyListUsageDataFromRedis < Gitlab::Database::Migration[1.0] + disable_ddl_transaction! + + def up + Gitlab::Redis::SharedState.with { |r| r.del("DEPENDENCY_LIST_USAGE_COUNTER") } + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220311010352_create_scan_id_and_id_index_on_security_findings.rb b/db/post_migrate/20220311010352_create_scan_id_and_id_index_on_security_findings.rb new file mode 100644 index 00000000000..1b72c4b0a78 --- /dev/null +++ b/db/post_migrate/20220311010352_create_scan_id_and_id_index_on_security_findings.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CreateScanIdAndIdIndexOnSecurityFindings < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_security_findings_on_scan_id_and_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :security_findings, [:scan_id, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :security_findings, INDEX_NAME + end +end diff --git a/db/post_migrate/20220314154235_migrate_vulnerability_approval_rules.rb b/db/post_migrate/20220314154235_migrate_vulnerability_approval_rules.rb new file mode 100644 index 00000000000..f9ad2ba4f0c --- /dev/null +++ b/db/post_migrate/20220314154235_migrate_vulnerability_approval_rules.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class MigrateVulnerabilityApprovalRules < Gitlab::Database::Migration[2.0] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + # no-op + end + + def down + # no-op + # Vulnerability-Check feature has been removed as part of 15.0 + end +end diff --git a/db/post_migrate/20220314162342_add_index_ci_job_artifacts_project_id_created_at.rb b/db/post_migrate/20220314162342_add_index_ci_job_artifacts_project_id_created_at.rb new file mode 100644 index 00000000000..7241fd54cb3 --- /dev/null +++ b/db/post_migrate/20220314162342_add_index_ci_job_artifacts_project_id_created_at.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexCiJobArtifactsProjectIdCreatedAt < Gitlab::Database::Migration[1.0] + INDEX_NAME = 'index_ci_job_artifacts_on_id_project_id_and_created_at' + + disable_ddl_transaction! + + def up + add_concurrent_index :ci_job_artifacts, [:project_id, :created_at, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME + end +end diff --git a/db/schema_migrations/20211202041233 b/db/schema_migrations/20211202041233 new file mode 100644 index 00000000000..fb19264fbd5 --- /dev/null +++ b/db/schema_migrations/20211202041233 @@ -0,0 +1 @@ +61c949b42338b248a0950cfafc82d58816c3fec44a2bf41c4ecb4cf09340a424
\ No newline at end of file diff --git a/db/schema_migrations/20211202094944 b/db/schema_migrations/20211202094944 new file mode 100644 index 00000000000..b917cca67fa --- /dev/null +++ b/db/schema_migrations/20211202094944 @@ -0,0 +1 @@ +2bca61880005c9303b2ff71747cde64d3418b6ef8ad2a9f114d584f4149e386b
\ No newline at end of file diff --git a/db/schema_migrations/20211202135508 b/db/schema_migrations/20211202135508 new file mode 100644 index 00000000000..6ca4701268d --- /dev/null +++ b/db/schema_migrations/20211202135508 @@ -0,0 +1 @@ +b565abbbb43f04ba4a6b77154ecb24b30328ac6d964f4be9fc5f9d05144606f0
\ No newline at end of file diff --git a/db/schema_migrations/20211202145237 b/db/schema_migrations/20211202145237 new file mode 100644 index 00000000000..f5b91a189c8 --- /dev/null +++ b/db/schema_migrations/20211202145237 @@ -0,0 +1 @@ +d109142aa838faedcd307f6cd235c969ca265813493eef50d63cbc2fe5d203b3
\ No newline at end of file diff --git a/db/schema_migrations/20211203091642 b/db/schema_migrations/20211203091642 new file mode 100644 index 00000000000..ef53b1d2ed9 --- /dev/null +++ b/db/schema_migrations/20211203091642 @@ -0,0 +1 @@ +9954fb041a3f284f53cc9c5c68b1a9dff36513a1851e663c221eccd40736fb16
\ No newline at end of file diff --git a/db/schema_migrations/20211203160952 b/db/schema_migrations/20211203160952 new file mode 100644 index 00000000000..10d033ef200 --- /dev/null +++ b/db/schema_migrations/20211203160952 @@ -0,0 +1 @@ +f25c65dfcb5b7b4a663cc4c792ffd985f6afd3156036485a5a43a791ee799e7b
\ No newline at end of file diff --git a/db/schema_migrations/20211203161149 b/db/schema_migrations/20211203161149 new file mode 100644 index 00000000000..3f58490a89c --- /dev/null +++ b/db/schema_migrations/20211203161149 @@ -0,0 +1 @@ +01482a299a7dac9d3f786f0dbe4650c686911bf788467146d3e9a91eafd0fc32
\ No newline at end of file diff --git a/db/schema_migrations/20211203161840 b/db/schema_migrations/20211203161840 new file mode 100644 index 00000000000..347bd0f7691 --- /dev/null +++ b/db/schema_migrations/20211203161840 @@ -0,0 +1 @@ +1b895e979ba2f1696559179c46c000e349da2d1ab94c968dd95103f188425103
\ No newline at end of file diff --git a/db/schema_migrations/20211203161942 b/db/schema_migrations/20211203161942 new file mode 100644 index 00000000000..f43c3733392 --- /dev/null +++ b/db/schema_migrations/20211203161942 @@ -0,0 +1 @@ +62432b2679cafa381671c9555f503867c254a7b3734e10cf634b34998d5fb5a3
\ No newline at end of file diff --git a/db/schema_migrations/20211204010826 b/db/schema_migrations/20211204010826 new file mode 100644 index 00000000000..11311e66ad0 --- /dev/null +++ b/db/schema_migrations/20211204010826 @@ -0,0 +1 @@ +6a3591e70ddd6573ad68360c1a8774ef61e7812ce831c75066baec5754e2bd76
\ No newline at end of file diff --git a/db/schema_migrations/20211206073851 b/db/schema_migrations/20211206073851 new file mode 100644 index 00000000000..bfd8140b109 --- /dev/null +++ b/db/schema_migrations/20211206073851 @@ -0,0 +1 @@ +403592fda1d82ed3c3fb8d5315593b67954a4ecbc368d9bcd5eedc75bb3c9821
\ No newline at end of file diff --git a/db/schema_migrations/20211206074547 b/db/schema_migrations/20211206074547 new file mode 100644 index 00000000000..dd84a987827 --- /dev/null +++ b/db/schema_migrations/20211206074547 @@ -0,0 +1 @@ +ba1c0d20e21ef51278109d0eaeb23f1c541eb5eb9aeb9a92583ee6de83c68918
\ No newline at end of file diff --git a/db/schema_migrations/20211206161271 b/db/schema_migrations/20211206161271 new file mode 100644 index 00000000000..8a2561eec24 --- /dev/null +++ b/db/schema_migrations/20211206161271 @@ -0,0 +1 @@ +fa4a39c3bea70d31e8144f8830ef0353f22a7a663a891d9043e79f362058fbde
\ No newline at end of file diff --git a/db/schema_migrations/20211207081708 b/db/schema_migrations/20211207081708 new file mode 100644 index 00000000000..b2fbb704451 --- /dev/null +++ b/db/schema_migrations/20211207081708 @@ -0,0 +1 @@ +e26065e63eca51e4138b6e9f07e9ec1ee45838afa82c5832849e360375beeae2
\ No newline at end of file diff --git a/db/schema_migrations/20211207090503 b/db/schema_migrations/20211207090503 new file mode 100644 index 00000000000..13daa5c81e6 --- /dev/null +++ b/db/schema_migrations/20211207090503 @@ -0,0 +1 @@ +c30656c3f079e789f386b5b607710a7d4df6d2eb20bd457bab3a2e8d9eeb051b
\ No newline at end of file diff --git a/db/schema_migrations/20211207125331 b/db/schema_migrations/20211207125331 new file mode 100644 index 00000000000..833d5d0a383 --- /dev/null +++ b/db/schema_migrations/20211207125331 @@ -0,0 +1 @@ +5ead867b7609248f702771078849c48c0558f5fe9a3021fbb32e4f9174af653a
\ No newline at end of file diff --git a/db/schema_migrations/20211207135331 b/db/schema_migrations/20211207135331 new file mode 100644 index 00000000000..b4085490cc8 --- /dev/null +++ b/db/schema_migrations/20211207135331 @@ -0,0 +1 @@ +3d9dcab49ee409da8c1ab398101041092e566b06a7bb2764db49a9201a0e5f0c
\ No newline at end of file diff --git a/db/schema_migrations/20211207154413 b/db/schema_migrations/20211207154413 new file mode 100644 index 00000000000..26bc9a47632 --- /dev/null +++ b/db/schema_migrations/20211207154413 @@ -0,0 +1 @@ +98098b41864158fc4de3b8fe42603b2c0c5c2fbc664397c431712311bdaa3621
\ No newline at end of file diff --git a/db/schema_migrations/20211207154414 b/db/schema_migrations/20211207154414 new file mode 100644 index 00000000000..c7e1f8de4d1 --- /dev/null +++ b/db/schema_migrations/20211207154414 @@ -0,0 +1 @@ +278907a15d04b455aa852eb9d17000c6b353be6ef78a8dcc2e71a9772a6e43ea
\ No newline at end of file diff --git a/db/schema_migrations/20211207165508 b/db/schema_migrations/20211207165508 new file mode 100644 index 00000000000..df0c91bad7d --- /dev/null +++ b/db/schema_migrations/20211207165508 @@ -0,0 +1 @@ +d1ed3ddf51c0bcebbac2a8dee05aa168daa35129110a463ac296ff2e640b0dbd
\ No newline at end of file diff --git a/db/schema_migrations/20211207173510 b/db/schema_migrations/20211207173510 new file mode 100644 index 00000000000..09474e1c643 --- /dev/null +++ b/db/schema_migrations/20211207173510 @@ -0,0 +1 @@ +0a4ac9de84b8351f39e549904d9e661648b496e6e3183c4ff5eb22b70d5ba7e9
\ No newline at end of file diff --git a/db/schema_migrations/20211207173511 b/db/schema_migrations/20211207173511 new file mode 100644 index 00000000000..93b44c20390 --- /dev/null +++ b/db/schema_migrations/20211207173511 @@ -0,0 +1 @@ +8f41f45c5ef23eafae2e67951497b5752f4b30ecf73ae3c08f61febfa4fb17be
\ No newline at end of file diff --git a/db/schema_migrations/20211208111425 b/db/schema_migrations/20211208111425 new file mode 100644 index 00000000000..0b1aa9199b6 --- /dev/null +++ b/db/schema_migrations/20211208111425 @@ -0,0 +1 @@ +1e3f29ed1a820588da9fe135fbdd0feaa960038b99397dbd7921d4804dce1e1f
\ No newline at end of file diff --git a/db/schema_migrations/20211208122200 b/db/schema_migrations/20211208122200 new file mode 100644 index 00000000000..1e4910d3a3c --- /dev/null +++ b/db/schema_migrations/20211208122200 @@ -0,0 +1 @@ +8dec4379f34773e979cf6b33ba608185827c37b1a95c74d6472b7562c16d6110
\ No newline at end of file diff --git a/db/schema_migrations/20211208122201 b/db/schema_migrations/20211208122201 new file mode 100644 index 00000000000..fb770a6d5fd --- /dev/null +++ b/db/schema_migrations/20211208122201 @@ -0,0 +1 @@ +f58ccb07fa67ede2a50fa5ff6bddbe4bb89a622e84786fc4bfb404c11b9dbab4
\ No newline at end of file diff --git a/db/schema_migrations/20211208171402 b/db/schema_migrations/20211208171402 new file mode 100644 index 00000000000..a563797dea5 --- /dev/null +++ b/db/schema_migrations/20211208171402 @@ -0,0 +1 @@ +09a9e7fc042aab19bf768a79401f33b6e7408acff303fc0ee68360dfd7605101
\ No newline at end of file diff --git a/db/schema_migrations/20211209093636 b/db/schema_migrations/20211209093636 new file mode 100644 index 00000000000..2d2601ff51c --- /dev/null +++ b/db/schema_migrations/20211209093636 @@ -0,0 +1 @@ +e544953376948489daf4840d4a6228b18dc6e18d071a1025dab24c3559640489
\ No newline at end of file diff --git a/db/schema_migrations/20211209093828 b/db/schema_migrations/20211209093828 new file mode 100644 index 00000000000..7f6b5a0c442 --- /dev/null +++ b/db/schema_migrations/20211209093828 @@ -0,0 +1 @@ +583ee4809560fec645e6f0942b332f9ab2630d06b0a422b360c5bb546d0aad93
\ No newline at end of file diff --git a/db/schema_migrations/20211209093923 b/db/schema_migrations/20211209093923 new file mode 100644 index 00000000000..654d4b3967e --- /dev/null +++ b/db/schema_migrations/20211209093923 @@ -0,0 +1 @@ +8ec578ddc956b2648bcdd8a2ce1728723e2b0eef1a0a4845f4cb0deb19c417ec
\ No newline at end of file diff --git a/db/schema_migrations/20211209094222 b/db/schema_migrations/20211209094222 new file mode 100644 index 00000000000..29156e38fe9 --- /dev/null +++ b/db/schema_migrations/20211209094222 @@ -0,0 +1 @@ +1b461efe52d55ba9dca05e64efaae411c3de01612cbc55f9525e522e9b181b3d
\ No newline at end of file diff --git a/db/schema_migrations/20211209103048 b/db/schema_migrations/20211209103048 new file mode 100644 index 00000000000..133d5fc1ed4 --- /dev/null +++ b/db/schema_migrations/20211209103048 @@ -0,0 +1 @@ +d2d270a335b3a2441a20673bf19d47553f607533d4503e3a01bc3d6d108bcdb3
\ No newline at end of file diff --git a/db/schema_migrations/20211209203820 b/db/schema_migrations/20211209203820 new file mode 100644 index 00000000000..cdff024b597 --- /dev/null +++ b/db/schema_migrations/20211209203820 @@ -0,0 +1 @@ +c501bc857cef21a8657508e9a286feb3c6f5db873247707e051a8702b1e80e79
\ No newline at end of file diff --git a/db/schema_migrations/20211209203821 b/db/schema_migrations/20211209203821 new file mode 100644 index 00000000000..890d3db0b3a --- /dev/null +++ b/db/schema_migrations/20211209203821 @@ -0,0 +1 @@ +4e8e0917bcfcadf288425e82eeb3747d775bb301017a9b320b694cd43ed0d60a
\ No newline at end of file diff --git a/db/schema_migrations/20211209230042 b/db/schema_migrations/20211209230042 new file mode 100644 index 00000000000..818734c1330 --- /dev/null +++ b/db/schema_migrations/20211209230042 @@ -0,0 +1 @@ +907fafc18fa515fff8f716f6464263ccc8a9b6e5ead36f30b05089100fd71b6b
\ No newline at end of file diff --git a/db/schema_migrations/20211210025754 b/db/schema_migrations/20211210025754 new file mode 100644 index 00000000000..f2fd6e506b8 --- /dev/null +++ b/db/schema_migrations/20211210025754 @@ -0,0 +1 @@ +d39b46bfd4bdf81cd4969190d08dce2260b4f476564a2e6c3e05d69b87c1c6df
\ No newline at end of file diff --git a/db/schema_migrations/20211210031721 b/db/schema_migrations/20211210031721 new file mode 100644 index 00000000000..57bbcccd347 --- /dev/null +++ b/db/schema_migrations/20211210031721 @@ -0,0 +1 @@ +6d62200480e46b356fe07eeb2c99b0fb441dadd00faf30079722c617facab7cc
\ No newline at end of file diff --git a/db/schema_migrations/20211210140000 b/db/schema_migrations/20211210140000 new file mode 100644 index 00000000000..b64d8251d69 --- /dev/null +++ b/db/schema_migrations/20211210140000 @@ -0,0 +1 @@ +f02c1b7412d2bb6d8a20639704ad55cdbcc14bfccf0509b659c3ef9614bcfa2b
\ No newline at end of file diff --git a/db/schema_migrations/20211210140629 b/db/schema_migrations/20211210140629 new file mode 100644 index 00000000000..ad631461d87 --- /dev/null +++ b/db/schema_migrations/20211210140629 @@ -0,0 +1 @@ +7940b0f692b62bcabbe98440082e2245fd28caba2c9e052e85e82acea0a98d23
\ No newline at end of file diff --git a/db/schema_migrations/20211210173137 b/db/schema_migrations/20211210173137 new file mode 100644 index 00000000000..3dfcb177167 --- /dev/null +++ b/db/schema_migrations/20211210173137 @@ -0,0 +1 @@ +9bbd4c3e396e0de130418e705a370ce629ca507c82fa2ff5bbf085cdf01c2ff3
\ No newline at end of file diff --git a/db/schema_migrations/20211213064821 b/db/schema_migrations/20211213064821 new file mode 100644 index 00000000000..119805a99b7 --- /dev/null +++ b/db/schema_migrations/20211213064821 @@ -0,0 +1 @@ +9d7e85ac7c9ee2b9505c479b878cb07888cf089c04d34bdeb834fbb0c5111931
\ No newline at end of file diff --git a/db/schema_migrations/20211213102111 b/db/schema_migrations/20211213102111 new file mode 100644 index 00000000000..214d061f265 --- /dev/null +++ b/db/schema_migrations/20211213102111 @@ -0,0 +1 @@ +3d011cc67fc6ac661788f2d0e3766e51d624a4248ac9dbd861a4db810d396091
\ No newline at end of file diff --git a/db/schema_migrations/20211213130324 b/db/schema_migrations/20211213130324 new file mode 100644 index 00000000000..529fe91ab5f --- /dev/null +++ b/db/schema_migrations/20211213130324 @@ -0,0 +1 @@ +2267855b2f12747b1f31f392677fac4d4f82ee234d7c54fd209b8bad417c8c75
\ No newline at end of file diff --git a/db/schema_migrations/20211213142344 b/db/schema_migrations/20211213142344 new file mode 100644 index 00000000000..2bcbb15c218 --- /dev/null +++ b/db/schema_migrations/20211213142344 @@ -0,0 +1 @@ +837539e12be12830d388bc6142622412b40ac061c397504eac03033a08f01e72
\ No newline at end of file diff --git a/db/schema_migrations/20211213154259 b/db/schema_migrations/20211213154259 new file mode 100644 index 00000000000..0555d0c6600 --- /dev/null +++ b/db/schema_migrations/20211213154259 @@ -0,0 +1 @@ +fccb1d6c7ac4e31cecaf7bc2e23f13f6c8147a3820cbd996a545a5b01cc03865
\ No newline at end of file diff --git a/db/schema_migrations/20211213154704 b/db/schema_migrations/20211213154704 new file mode 100644 index 00000000000..0d9ba6457ba --- /dev/null +++ b/db/schema_migrations/20211213154704 @@ -0,0 +1 @@ +deec24bae35829454a09d4e97478c0b57d5f80e3271f96b2554b1ab10dc84d7f
\ No newline at end of file diff --git a/db/schema_migrations/20211214012507 b/db/schema_migrations/20211214012507 new file mode 100644 index 00000000000..7bac6c6d8c5 --- /dev/null +++ b/db/schema_migrations/20211214012507 @@ -0,0 +1 @@ +a7aa1ffccce785d365720309e3773f167075a9d06805eea941e6cd47bc918471
\ No newline at end of file diff --git a/db/schema_migrations/20211214110307 b/db/schema_migrations/20211214110307 new file mode 100644 index 00000000000..6e3101bbe59 --- /dev/null +++ b/db/schema_migrations/20211214110307 @@ -0,0 +1 @@ +a1a6e3c5b4a8f959c55edbb084b37ba555b3977e450a549925de47605638f66e
\ No newline at end of file diff --git a/db/schema_migrations/20211215090620 b/db/schema_migrations/20211215090620 new file mode 100644 index 00000000000..9393ffee22e --- /dev/null +++ b/db/schema_migrations/20211215090620 @@ -0,0 +1 @@ +43ae6290e11e3944b23ce2865b5c466a29c9ba3cfd2e0b58bd834568414b5bf2
\ No newline at end of file diff --git a/db/schema_migrations/20211215182006 b/db/schema_migrations/20211215182006 new file mode 100644 index 00000000000..480a1e2369b --- /dev/null +++ b/db/schema_migrations/20211215182006 @@ -0,0 +1 @@ +ead2a1b13438514bb97bea3f1656f9bac352a8c733d9f808b2405685bce91e00
\ No newline at end of file diff --git a/db/schema_migrations/20211216133107 b/db/schema_migrations/20211216133107 new file mode 100644 index 00000000000..c841207fffc --- /dev/null +++ b/db/schema_migrations/20211216133107 @@ -0,0 +1 @@ +a0c3a9746250aa67ffa8d05486fb6997c8d839b8bce7e870c0415c25600c5434
\ No newline at end of file diff --git a/db/schema_migrations/20211216134134 b/db/schema_migrations/20211216134134 new file mode 100644 index 00000000000..09c3a59cc98 --- /dev/null +++ b/db/schema_migrations/20211216134134 @@ -0,0 +1 @@ +c53a1e4405187620929b8fc6877786cb713d13218f7385d1b9b3daaf6072fa05
\ No newline at end of file diff --git a/db/schema_migrations/20211216135651 b/db/schema_migrations/20211216135651 new file mode 100644 index 00000000000..a94bdb329f1 --- /dev/null +++ b/db/schema_migrations/20211216135651 @@ -0,0 +1 @@ +9b733363587957b4044bc6806dfbb9632ec7f5f6ffc8c82280e025012b8acb5a
\ No newline at end of file diff --git a/db/schema_migrations/20211216220939 b/db/schema_migrations/20211216220939 new file mode 100644 index 00000000000..3fe48da6ca2 --- /dev/null +++ b/db/schema_migrations/20211216220939 @@ -0,0 +1 @@ +649cf0eb794904457b230c1240d2bea8a6e80b00dbf6b2d25b95c66247460aa4
\ No newline at end of file diff --git a/db/schema_migrations/20211217050753 b/db/schema_migrations/20211217050753 new file mode 100644 index 00000000000..bfc571acab1 --- /dev/null +++ b/db/schema_migrations/20211217050753 @@ -0,0 +1 @@ +fe5cbf928d45d506132078678cf70264f01190cfe581628a5038d77f68a52961
\ No newline at end of file diff --git a/db/schema_migrations/20211217120000 b/db/schema_migrations/20211217120000 new file mode 100644 index 00000000000..d4efb66b985 --- /dev/null +++ b/db/schema_migrations/20211217120000 @@ -0,0 +1 @@ +d4360d6057602ec1f5e6e9d11c93cfbb16d878e9ecd4d5bfb1bed1c01e14c7a3
\ No newline at end of file diff --git a/db/schema_migrations/20211217145923 b/db/schema_migrations/20211217145923 new file mode 100644 index 00000000000..8a94da00fc8 --- /dev/null +++ b/db/schema_migrations/20211217145923 @@ -0,0 +1 @@ +2e35347592530f2a73e1cd75871438e29d277a206f621989e2c897fc587b6f5d
\ No newline at end of file diff --git a/db/schema_migrations/20211217174331 b/db/schema_migrations/20211217174331 new file mode 100644 index 00000000000..32657e28f96 --- /dev/null +++ b/db/schema_migrations/20211217174331 @@ -0,0 +1 @@ +649360f4069aac4784f4d039015f8dda3f4bae28e8132f841e25b48f034a392e
\ No newline at end of file diff --git a/db/schema_migrations/20211220064757 b/db/schema_migrations/20211220064757 new file mode 100644 index 00000000000..675596f1ce6 --- /dev/null +++ b/db/schema_migrations/20211220064757 @@ -0,0 +1 @@ +34bfe07fff59a415540ca2c5c96b33dc9030c15b2ffbb30cb7deedeb939ae132
\ No newline at end of file diff --git a/db/schema_migrations/20211220120402 b/db/schema_migrations/20211220120402 new file mode 100644 index 00000000000..c2bb4f8da7e --- /dev/null +++ b/db/schema_migrations/20211220120402 @@ -0,0 +1 @@ +157128732c321577b7fa7a1b3d252ff70a2a62b34cd1e6edea59da4e632a1755
\ No newline at end of file diff --git a/db/schema_migrations/20211220123956 b/db/schema_migrations/20211220123956 new file mode 100644 index 00000000000..291fdc306b5 --- /dev/null +++ b/db/schema_migrations/20211220123956 @@ -0,0 +1 @@ +088d17a1f55522c48e69ec78717b39b8c7538474a9263621bba1fa0280a27ad7
\ No newline at end of file diff --git a/db/schema_migrations/20211220174504 b/db/schema_migrations/20211220174504 new file mode 100644 index 00000000000..ed8f5f35efc --- /dev/null +++ b/db/schema_migrations/20211220174504 @@ -0,0 +1 @@ +80c1ad5815ef68ab1a7d63566d478683b3f9a5169ed15ecd6f44f7f542d40dc8
\ No newline at end of file diff --git a/db/schema_migrations/20211223125921 b/db/schema_migrations/20211223125921 new file mode 100644 index 00000000000..b4e3a1583df --- /dev/null +++ b/db/schema_migrations/20211223125921 @@ -0,0 +1 @@ +e08c1634376ed78b78c4a54d874bed66c1ce40c7c509b67cfda00d1a8657f127
\ No newline at end of file diff --git a/db/schema_migrations/20211224112937 b/db/schema_migrations/20211224112937 new file mode 100644 index 00000000000..98296f9a270 --- /dev/null +++ b/db/schema_migrations/20211224112937 @@ -0,0 +1 @@ +3709c5c229e45ff0f594d6291d0b2b9a167b3bf4f5b29158b9abdac333a638b8
\ No newline at end of file diff --git a/db/schema_migrations/20211224114539 b/db/schema_migrations/20211224114539 new file mode 100644 index 00000000000..2d7494e4291 --- /dev/null +++ b/db/schema_migrations/20211224114539 @@ -0,0 +1 @@ +f4ac776ec4213d6fcd07ccfa913f51e1386ff212bf47d27817b24b501a78443b
\ No newline at end of file diff --git a/db/schema_migrations/20211229023654 b/db/schema_migrations/20211229023654 new file mode 100644 index 00000000000..f34b188c5d3 --- /dev/null +++ b/db/schema_migrations/20211229023654 @@ -0,0 +1 @@ +8019915a00f62c137ee48c860c888e9d43f7253a5ea1a684ba2abe8bbe8016df
\ No newline at end of file diff --git a/db/schema_migrations/20211230112517 b/db/schema_migrations/20211230112517 new file mode 100644 index 00000000000..bd22204d82d --- /dev/null +++ b/db/schema_migrations/20211230112517 @@ -0,0 +1 @@ +32c4b0ad5b52b8990b4c0ab6e832d503be6fc802a30aa2de20c7d3ced7f04c36
\ No newline at end of file diff --git a/db/schema_migrations/20211230113031 b/db/schema_migrations/20211230113031 new file mode 100644 index 00000000000..2f5b81768c8 --- /dev/null +++ b/db/schema_migrations/20211230113031 @@ -0,0 +1 @@ +54201f4273226ed92ff0ed991fdba09c1108fccb764e6b9903e9f01e6acced1a
\ No newline at end of file diff --git a/db/schema_migrations/20220104060049 b/db/schema_migrations/20220104060049 new file mode 100644 index 00000000000..83c36018d73 --- /dev/null +++ b/db/schema_migrations/20220104060049 @@ -0,0 +1 @@ +fa87b087b576d320f94028444a082b920870a2554209808849f9f3f42ead83c4
\ No newline at end of file diff --git a/db/schema_migrations/20220104174445 b/db/schema_migrations/20220104174445 new file mode 100644 index 00000000000..fffb27113e2 --- /dev/null +++ b/db/schema_migrations/20220104174445 @@ -0,0 +1 @@ +5e5e41ee4c8dc9c3fe791470862d15b8d213fcc931ef8b80937bdb5f5db20aed
\ No newline at end of file diff --git a/db/schema_migrations/20220105020514 b/db/schema_migrations/20220105020514 new file mode 100644 index 00000000000..4ad9266c7c0 --- /dev/null +++ b/db/schema_migrations/20220105020514 @@ -0,0 +1 @@ +301c2f09f48aa3e34c2f679628a9542b4babc589e3d20e9ccf84a9209f5841ee
\ No newline at end of file diff --git a/db/schema_migrations/20220105082217 b/db/schema_migrations/20220105082217 new file mode 100644 index 00000000000..a6232406be6 --- /dev/null +++ b/db/schema_migrations/20220105082217 @@ -0,0 +1 @@ +448481ec9f7dd58d267e3660a49161c0e14baca35e640c59b27f2ebc4367b62a
\ No newline at end of file diff --git a/db/schema_migrations/20220105121325 b/db/schema_migrations/20220105121325 new file mode 100644 index 00000000000..384616aba7f --- /dev/null +++ b/db/schema_migrations/20220105121325 @@ -0,0 +1 @@ +27ca3977a7569e98271eeb2bd224be1cfe5452ab3778665325b89bf966e07942
\ No newline at end of file diff --git a/db/schema_migrations/20220105152547 b/db/schema_migrations/20220105152547 new file mode 100644 index 00000000000..d8c425da736 --- /dev/null +++ b/db/schema_migrations/20220105152547 @@ -0,0 +1 @@ +0f1ea41fae57710e0e05c9b71a14800394c4c57e37a39e92be49c50120d7d2ee
\ No newline at end of file diff --git a/db/schema_migrations/20220105153149 b/db/schema_migrations/20220105153149 new file mode 100644 index 00000000000..11b71946bc8 --- /dev/null +++ b/db/schema_migrations/20220105153149 @@ -0,0 +1 @@ +8194c695a809f2eb29e5033f089c1d20874f61731a4289026f2d550854e7097d
\ No newline at end of file diff --git a/db/schema_migrations/20220106111958 b/db/schema_migrations/20220106111958 new file mode 100644 index 00000000000..954db532950 --- /dev/null +++ b/db/schema_migrations/20220106111958 @@ -0,0 +1 @@ +c1af9546bdfa0f32c3c2faf362062cd300800514e5b1efd1fa8a1770753d00e5
\ No newline at end of file diff --git a/db/schema_migrations/20220106112043 b/db/schema_migrations/20220106112043 new file mode 100644 index 00000000000..34c8c5152da --- /dev/null +++ b/db/schema_migrations/20220106112043 @@ -0,0 +1 @@ +8b51ae2b13066a56d2131efb7ea746335513031e751fb231e43121552d6f2b1d
\ No newline at end of file diff --git a/db/schema_migrations/20220106112085 b/db/schema_migrations/20220106112085 new file mode 100644 index 00000000000..171f893a0ab --- /dev/null +++ b/db/schema_migrations/20220106112085 @@ -0,0 +1 @@ +f385631d0317630661d487011a228501a6cbc71de25ca457d75e6a815c598045
\ No newline at end of file diff --git a/db/schema_migrations/20220106141756 b/db/schema_migrations/20220106141756 new file mode 100644 index 00000000000..7718a41500b --- /dev/null +++ b/db/schema_migrations/20220106141756 @@ -0,0 +1 @@ +cedca81a6dc1562cf0ed5f17217c52420a1cb9a74acece8d67eb1bcb948a7181
\ No newline at end of file diff --git a/db/schema_migrations/20220106163326 b/db/schema_migrations/20220106163326 new file mode 100644 index 00000000000..dbfb9079dc1 --- /dev/null +++ b/db/schema_migrations/20220106163326 @@ -0,0 +1 @@ +4726d84ff42e64b1c47c5ba454ff5be05f434a86bb2af4bbe27dd00e5e3da5cb
\ No newline at end of file diff --git a/db/schema_migrations/20220106185033 b/db/schema_migrations/20220106185033 new file mode 100644 index 00000000000..be45c8bab6f --- /dev/null +++ b/db/schema_migrations/20220106185033 @@ -0,0 +1 @@ +5304bc3dada6794c8f6e1082861e12fdfb059effdcd5a17e11af5300e67708bd
\ No newline at end of file diff --git a/db/schema_migrations/20220106230629 b/db/schema_migrations/20220106230629 new file mode 100644 index 00000000000..e8751a6616c --- /dev/null +++ b/db/schema_migrations/20220106230629 @@ -0,0 +1 @@ +675d8f7bf77ddb860e707c25811d4eaaac1173c9fe62ce96c2708f0bbd0f4d48
\ No newline at end of file diff --git a/db/schema_migrations/20220106230712 b/db/schema_migrations/20220106230712 new file mode 100644 index 00000000000..589b65d423c --- /dev/null +++ b/db/schema_migrations/20220106230712 @@ -0,0 +1 @@ +672b51ca014d208f971efe698edb8a8b32f541bf9d21a7f555c53f749ee936a4
\ No newline at end of file diff --git a/db/schema_migrations/20220106231518 b/db/schema_migrations/20220106231518 new file mode 100644 index 00000000000..f7deaaa68b6 --- /dev/null +++ b/db/schema_migrations/20220106231518 @@ -0,0 +1 @@ +aafb52337688e8b57712872f6f7e8e67da132406b244df5e11a736b01e23354f
\ No newline at end of file diff --git a/db/schema_migrations/20220106233459 b/db/schema_migrations/20220106233459 new file mode 100644 index 00000000000..2911e79d843 --- /dev/null +++ b/db/schema_migrations/20220106233459 @@ -0,0 +1 @@ +fc44084057c5fd30f0e7918b4f856a60409f08ad1eb5c3fbc2d8ad5bad7f1ffd
\ No newline at end of file diff --git a/db/schema_migrations/20220106235626 b/db/schema_migrations/20220106235626 new file mode 100644 index 00000000000..d8d8e3b20d7 --- /dev/null +++ b/db/schema_migrations/20220106235626 @@ -0,0 +1 @@ +34f966723cae63e831f7fc9d965cda90f1fd7bca522fc58e78a0de4b959a47a2
\ No newline at end of file diff --git a/db/schema_migrations/20220107064845 b/db/schema_migrations/20220107064845 new file mode 100644 index 00000000000..bd63da88355 --- /dev/null +++ b/db/schema_migrations/20220107064845 @@ -0,0 +1 @@ +c7c645787aadc95c77df6420f437f78aed4e7e862ea2b66e7824766b1d9f3cb5
\ No newline at end of file diff --git a/db/schema_migrations/20220107091629 b/db/schema_migrations/20220107091629 new file mode 100644 index 00000000000..a14f97d77eb --- /dev/null +++ b/db/schema_migrations/20220107091629 @@ -0,0 +1 @@ +ef1a7c5f7b10640a0ddc669528dcdb02fd2525d716562f928578e8902a07a832
\ No newline at end of file diff --git a/db/schema_migrations/20220107165036 b/db/schema_migrations/20220107165036 new file mode 100644 index 00000000000..bab28284d04 --- /dev/null +++ b/db/schema_migrations/20220107165036 @@ -0,0 +1 @@ +72639ba84675a6687864ef4cb6f02d0429124d7deb9ce9f3c8e255591e2f0a8d
\ No newline at end of file diff --git a/db/schema_migrations/20220109133006 b/db/schema_migrations/20220109133006 new file mode 100644 index 00000000000..e74845e2254 --- /dev/null +++ b/db/schema_migrations/20220109133006 @@ -0,0 +1 @@ +192fc0b934c7d52e431a0ce7524a51beb24fa004a940e6b0675e36b0da143891
\ No newline at end of file diff --git a/db/schema_migrations/20220109134455 b/db/schema_migrations/20220109134455 new file mode 100644 index 00000000000..7a4762e240e --- /dev/null +++ b/db/schema_migrations/20220109134455 @@ -0,0 +1 @@ +fee092680e22e579ea51f776d11bbfd6a49b936e4ab776760a153ce613e7a0cd
\ No newline at end of file diff --git a/db/schema_migrations/20220110170953 b/db/schema_migrations/20220110170953 new file mode 100644 index 00000000000..d4c2aa5fcf2 --- /dev/null +++ b/db/schema_migrations/20220110170953 @@ -0,0 +1 @@ +da1c6f2db7cee1e4cb8b477d1892fa7206a95157a84864ad3d6022ab6cffbd1f
\ No newline at end of file diff --git a/db/schema_migrations/20220110171049 b/db/schema_migrations/20220110171049 new file mode 100644 index 00000000000..ab39a1afb25 --- /dev/null +++ b/db/schema_migrations/20220110171049 @@ -0,0 +1 @@ +55ad00b1cf70f5d1a3f033efccf64c2c273ad03f65823a2281869849571ab35b
\ No newline at end of file diff --git a/db/schema_migrations/20220110224913 b/db/schema_migrations/20220110224913 new file mode 100644 index 00000000000..653324d1060 --- /dev/null +++ b/db/schema_migrations/20220110224913 @@ -0,0 +1 @@ +d8b206e26f6dd7e9d5f2b2d8cc5ce2e2bbe2d8d33317948f8cf110fe41872a5d
\ No newline at end of file diff --git a/db/schema_migrations/20220110231420 b/db/schema_migrations/20220110231420 new file mode 100644 index 00000000000..b46bcdfd802 --- /dev/null +++ b/db/schema_migrations/20220110231420 @@ -0,0 +1 @@ +768f97a38c0b741f7de99082ce7c8efb1578ac6600c3af4b30019bc987968bc9
\ No newline at end of file diff --git a/db/schema_migrations/20220110233155 b/db/schema_migrations/20220110233155 new file mode 100644 index 00000000000..9301c7a2a7a --- /dev/null +++ b/db/schema_migrations/20220110233155 @@ -0,0 +1 @@ +e7d9d79ffb8989ab39fe719217f22736244df70c2b1461ef5a1a3f1e74e43870
\ No newline at end of file diff --git a/db/schema_migrations/20220111002756 b/db/schema_migrations/20220111002756 new file mode 100644 index 00000000000..ca619e3eaf4 --- /dev/null +++ b/db/schema_migrations/20220111002756 @@ -0,0 +1 @@ +34759cbf09171f6057b87af791f5e9f3045ac5e06558147436ba32e276f40a19
\ No newline at end of file diff --git a/db/schema_migrations/20220111023852 b/db/schema_migrations/20220111023852 new file mode 100644 index 00000000000..15ab0470662 --- /dev/null +++ b/db/schema_migrations/20220111023852 @@ -0,0 +1 @@ +fdb6e193748f9933aa3ae60fab41960e06d4edf271048fc5f6c9c465d30a8334
\ No newline at end of file diff --git a/db/schema_migrations/20220111093534 b/db/schema_migrations/20220111093534 new file mode 100644 index 00000000000..5999dbdf49a --- /dev/null +++ b/db/schema_migrations/20220111093534 @@ -0,0 +1 @@ +ff0127967c3ee6e4f4af528b84024a6a838f8dbeb19cf78d7d913d4fc8e155e7
\ No newline at end of file diff --git a/db/schema_migrations/20220111095006 b/db/schema_migrations/20220111095006 new file mode 100644 index 00000000000..b5fed6279f1 --- /dev/null +++ b/db/schema_migrations/20220111095006 @@ -0,0 +1 @@ +0bc00cc8a5fa7cafa665ec113a4d0d1384c5acde37dfdf53ab1f5a2e1d6acb02
\ No newline at end of file diff --git a/db/schema_migrations/20220111095007 b/db/schema_migrations/20220111095007 new file mode 100644 index 00000000000..77c70f8bccf --- /dev/null +++ b/db/schema_migrations/20220111095007 @@ -0,0 +1 @@ +65259b0e71c1883b81c61354325cfeeade0013b55af8901bf707f2a94ee3a46a
\ No newline at end of file diff --git a/db/schema_migrations/20220111101421 b/db/schema_migrations/20220111101421 new file mode 100644 index 00000000000..16d47665734 --- /dev/null +++ b/db/schema_migrations/20220111101421 @@ -0,0 +1 @@ +abbba4ccacebb825c3f9cb5b0463d457fd4a7b4396a2184a995e496aebaf4521
\ No newline at end of file diff --git a/db/schema_migrations/20220111102314 b/db/schema_migrations/20220111102314 new file mode 100644 index 00000000000..95c172c3587 --- /dev/null +++ b/db/schema_migrations/20220111102314 @@ -0,0 +1 @@ +69c20daf6a23346288e516df3e70120819d76dcb5fe2b1b51af416349311820b
\ No newline at end of file diff --git a/db/schema_migrations/20220111154950 b/db/schema_migrations/20220111154950 new file mode 100644 index 00000000000..6070beb76e9 --- /dev/null +++ b/db/schema_migrations/20220111154950 @@ -0,0 +1 @@ +4719c533acaac3234ac0e131c70be49d0f98642e29e7d2e31519cc6c372056bc
\ No newline at end of file diff --git a/db/schema_migrations/20220111154951 b/db/schema_migrations/20220111154951 new file mode 100644 index 00000000000..9d18e4c4d44 --- /dev/null +++ b/db/schema_migrations/20220111154951 @@ -0,0 +1 @@ +48d6eaa68912f702be2bd38609bea4fa807eab7131f7c5e2261416820df9836a
\ No newline at end of file diff --git a/db/schema_migrations/20220111200254 b/db/schema_migrations/20220111200254 new file mode 100644 index 00000000000..36ce3ad56f0 --- /dev/null +++ b/db/schema_migrations/20220111200254 @@ -0,0 +1 @@ +72c7e04b1a34154c894f93da800c15c717c3340d34729577538d539881d2e8ca
\ No newline at end of file diff --git a/db/schema_migrations/20220111221516 b/db/schema_migrations/20220111221516 new file mode 100644 index 00000000000..b0c747f8e8a --- /dev/null +++ b/db/schema_migrations/20220111221516 @@ -0,0 +1 @@ +0cb120b0036b3f472edb57fcb8a52877d399edf8ff1f416ce76497d6aa8265d7
\ No newline at end of file diff --git a/db/schema_migrations/20220112015940 b/db/schema_migrations/20220112015940 new file mode 100644 index 00000000000..0d012793ba0 --- /dev/null +++ b/db/schema_migrations/20220112015940 @@ -0,0 +1 @@ +e4417c3367115d6adba023e18657d8aecd476b8d1c4227c73e06f97d05af07ad
\ No newline at end of file diff --git a/db/schema_migrations/20220112090556 b/db/schema_migrations/20220112090556 new file mode 100644 index 00000000000..12ffaeffe00 --- /dev/null +++ b/db/schema_migrations/20220112090556 @@ -0,0 +1 @@ +e78e11a47017c67130fe88fa538578553b7015c18cf222b5e7fb7f503254dc6d
\ No newline at end of file diff --git a/db/schema_migrations/20220112115413 b/db/schema_migrations/20220112115413 new file mode 100644 index 00000000000..9c8c653f69b --- /dev/null +++ b/db/schema_migrations/20220112115413 @@ -0,0 +1 @@ +1199adba4c13e9234eabadefeb55ed3cfb19e9d5a87c07b90d438e4f48a973f7
\ No newline at end of file diff --git a/db/schema_migrations/20220112205111 b/db/schema_migrations/20220112205111 new file mode 100644 index 00000000000..a2d2d42271e --- /dev/null +++ b/db/schema_migrations/20220112205111 @@ -0,0 +1 @@ +65d9a1d63e90dfc336d0c69503c0899259fda773bc68a330782c206ac0fc48fd
\ No newline at end of file diff --git a/db/schema_migrations/20220112230642 b/db/schema_migrations/20220112230642 new file mode 100644 index 00000000000..c2d8e1d0a6e --- /dev/null +++ b/db/schema_migrations/20220112230642 @@ -0,0 +1 @@ +c528730414c1dcda5d312f03d4e37a0dbb51ebb0b0b87ada786cf686c358daa7
\ No newline at end of file diff --git a/db/schema_migrations/20220112232037 b/db/schema_migrations/20220112232037 new file mode 100644 index 00000000000..83267de0489 --- /dev/null +++ b/db/schema_migrations/20220112232037 @@ -0,0 +1 @@ +775ac42ad194bd0175a6925e1c2e83c11d57a8d4430ad08a70e3d5275ca2e709
\ No newline at end of file diff --git a/db/schema_migrations/20220112232605 b/db/schema_migrations/20220112232605 new file mode 100644 index 00000000000..fb5809b543e --- /dev/null +++ b/db/schema_migrations/20220112232605 @@ -0,0 +1 @@ +4813b55e933564851f2fec9a2fa5900409eff226fec34ae0be1895307f603904
\ No newline at end of file diff --git a/db/schema_migrations/20220112232723 b/db/schema_migrations/20220112232723 new file mode 100644 index 00000000000..2dc2a592980 --- /dev/null +++ b/db/schema_migrations/20220112232723 @@ -0,0 +1 @@ +cbea97a0d067939ba9d713489448cb6e0cc45b2bbd2c717ecf521493cc39d568
\ No newline at end of file diff --git a/db/schema_migrations/20220113013319 b/db/schema_migrations/20220113013319 new file mode 100644 index 00000000000..0dc31b95004 --- /dev/null +++ b/db/schema_migrations/20220113013319 @@ -0,0 +1 @@ +ccfbbbe52b27833453f867c4d7093187d21dbbfebe054b366ff010c54de50974
\ No newline at end of file diff --git a/db/schema_migrations/20220113014438 b/db/schema_migrations/20220113014438 new file mode 100644 index 00000000000..936c801bafe --- /dev/null +++ b/db/schema_migrations/20220113014438 @@ -0,0 +1 @@ +08d8a5a605058598a2f033bbd461518c502fb3da8627240c5d66f887b43f3ac3
\ No newline at end of file diff --git a/db/schema_migrations/20220113015830 b/db/schema_migrations/20220113015830 new file mode 100644 index 00000000000..a4897410077 --- /dev/null +++ b/db/schema_migrations/20220113015830 @@ -0,0 +1 @@ +774a5ff616663d6d0e002bd04d33747982de10b02cbb9ad7d8abfe0b26a2b441
\ No newline at end of file diff --git a/db/schema_migrations/20220113035519 b/db/schema_migrations/20220113035519 new file mode 100644 index 00000000000..eb908ae8982 --- /dev/null +++ b/db/schema_migrations/20220113035519 @@ -0,0 +1 @@ +4a90811aace678528b75171868fb178ab885d5aac885048e8eacecaf8b0ee374
\ No newline at end of file diff --git a/db/schema_migrations/20220113040447 b/db/schema_migrations/20220113040447 new file mode 100644 index 00000000000..465b51678f7 --- /dev/null +++ b/db/schema_migrations/20220113040447 @@ -0,0 +1 @@ +983e5522b2798ca0d17ca3fd848f527b12afdbdd1482a2d420c4c6ce4fa2c9c4
\ No newline at end of file diff --git a/db/schema_migrations/20220113111440 b/db/schema_migrations/20220113111440 new file mode 100644 index 00000000000..e6188a9616f --- /dev/null +++ b/db/schema_migrations/20220113111440 @@ -0,0 +1 @@ +faf899c1aa99e596eb386935ee6ff17a51b7942ee4f6d4cbd1ad2283dd0d40c0
\ No newline at end of file diff --git a/db/schema_migrations/20220113125401 b/db/schema_migrations/20220113125401 new file mode 100644 index 00000000000..7241e2e29c7 --- /dev/null +++ b/db/schema_migrations/20220113125401 @@ -0,0 +1 @@ +afe57b6b1b8b10e0e26d7f499b25adc5aef9f7c52af644d6a260f0ed3aab16d5
\ No newline at end of file diff --git a/db/schema_migrations/20220113135449 b/db/schema_migrations/20220113135449 new file mode 100644 index 00000000000..57e6ede94b5 --- /dev/null +++ b/db/schema_migrations/20220113135449 @@ -0,0 +1 @@ +46796379175ce9343907234d3ae14a417442c7c5ebbfcf6987db1d759eca2c3a
\ No newline at end of file diff --git a/db/schema_migrations/20220113135924 b/db/schema_migrations/20220113135924 new file mode 100644 index 00000000000..41328a43c37 --- /dev/null +++ b/db/schema_migrations/20220113135924 @@ -0,0 +1 @@ +2a230758c13111c9e3738794008c31a3608dda2f0d071fbde0ad3cd782d29162
\ No newline at end of file diff --git a/db/schema_migrations/20220113164801 b/db/schema_migrations/20220113164801 new file mode 100644 index 00000000000..8354489ac31 --- /dev/null +++ b/db/schema_migrations/20220113164801 @@ -0,0 +1 @@ +71526ea198c64d23a35f06804f30068591e937df22d74c262fdec9ecf04bf7d4
\ No newline at end of file diff --git a/db/schema_migrations/20220113164901 b/db/schema_migrations/20220113164901 new file mode 100644 index 00000000000..977ec8bb51b --- /dev/null +++ b/db/schema_migrations/20220113164901 @@ -0,0 +1 @@ +b157cec5eab77665ae57f02647c39dc0fb167d78e1894b395c46f59d791ab3e0
\ No newline at end of file diff --git a/db/schema_migrations/20220114105525 b/db/schema_migrations/20220114105525 new file mode 100644 index 00000000000..728820cbaf0 --- /dev/null +++ b/db/schema_migrations/20220114105525 @@ -0,0 +1 @@ +c9c7e8ff40fd3863095bb927f1aea27fecd5ca77dfc284a7673310e3501476c8
\ No newline at end of file diff --git a/db/schema_migrations/20220114131950 b/db/schema_migrations/20220114131950 new file mode 100644 index 00000000000..ca1e1033d9b --- /dev/null +++ b/db/schema_migrations/20220114131950 @@ -0,0 +1 @@ +f427f4c0d75308f7c97685e10e27a735dcf284714acd49659f62a6f7752234ef
\ No newline at end of file diff --git a/db/schema_migrations/20220116175851 b/db/schema_migrations/20220116175851 new file mode 100644 index 00000000000..47c21071440 --- /dev/null +++ b/db/schema_migrations/20220116175851 @@ -0,0 +1 @@ +3fa0d827ab8051d270a13ae5facb1560a87f9f4fef81368b9fbb5d6291948721
\ No newline at end of file diff --git a/db/schema_migrations/20220117034056 b/db/schema_migrations/20220117034056 new file mode 100644 index 00000000000..acf76bfb9d6 --- /dev/null +++ b/db/schema_migrations/20220117034056 @@ -0,0 +1 @@ +afc54500374602edcdc4fce5acf3673b84882da1afbb5598a6684a5ef480a2d7
\ No newline at end of file diff --git a/db/schema_migrations/20220117082611 b/db/schema_migrations/20220117082611 new file mode 100644 index 00000000000..9dead593ffb --- /dev/null +++ b/db/schema_migrations/20220117082611 @@ -0,0 +1 @@ +28df9a8b5bf73bc33275cfe47f260788fa3263680a97128e086fd1698ccac1d8
\ No newline at end of file diff --git a/db/schema_migrations/20220117225936 b/db/schema_migrations/20220117225936 new file mode 100644 index 00000000000..7ced75915e4 --- /dev/null +++ b/db/schema_migrations/20220117225936 @@ -0,0 +1 @@ +484eaf2ce1df1e2915b7ea8a5c9f4e044957c25d1ccf5841f24c75791d1a1a13
\ No newline at end of file diff --git a/db/schema_migrations/20220118015633 b/db/schema_migrations/20220118015633 new file mode 100644 index 00000000000..8ba4a376bcd --- /dev/null +++ b/db/schema_migrations/20220118015633 @@ -0,0 +1 @@ +6a73f49306de7c799a39afa3ac1f761840860833a96f1a91cf992c9a3ebfef9b
\ No newline at end of file diff --git a/db/schema_migrations/20220118020026 b/db/schema_migrations/20220118020026 new file mode 100644 index 00000000000..fe9dcccbc0c --- /dev/null +++ b/db/schema_migrations/20220118020026 @@ -0,0 +1 @@ +77374c81456f235d3afeb45cdda14552e1ef8047de5aaa3f5bb0a82e4aebe849
\ No newline at end of file diff --git a/db/schema_migrations/20220118141950 b/db/schema_migrations/20220118141950 new file mode 100644 index 00000000000..7c6549a1e60 --- /dev/null +++ b/db/schema_migrations/20220118141950 @@ -0,0 +1 @@ +a4131f86bc415f0c1897e3b975494806ffc5a834dca2b39c998c6a406e695e15
\ No newline at end of file diff --git a/db/schema_migrations/20220118155846 b/db/schema_migrations/20220118155846 new file mode 100644 index 00000000000..b5247cb3743 --- /dev/null +++ b/db/schema_migrations/20220118155846 @@ -0,0 +1 @@ +88935eee0781ee1faaf52e3bc89dc5c490c2095d6ccf83e4fd4186641507c173
\ No newline at end of file diff --git a/db/schema_migrations/20220118155847 b/db/schema_migrations/20220118155847 new file mode 100644 index 00000000000..caa0dfc5901 --- /dev/null +++ b/db/schema_migrations/20220118155847 @@ -0,0 +1 @@ +aa73b04aa355111564cdc7adb036a2030a28fbb3b524c3b3dbb8248e27b845d7
\ No newline at end of file diff --git a/db/schema_migrations/20220118155848 b/db/schema_migrations/20220118155848 new file mode 100644 index 00000000000..bf3205b5dda --- /dev/null +++ b/db/schema_migrations/20220118155848 @@ -0,0 +1 @@ +4d5adffe1a3e835d6d23f6bd9634993c778fef23d134552d54b003af2a3ff4da
\ No newline at end of file diff --git a/db/schema_migrations/20220118204039 b/db/schema_migrations/20220118204039 new file mode 100644 index 00000000000..209204054ff --- /dev/null +++ b/db/schema_migrations/20220118204039 @@ -0,0 +1 @@ +9b33f6e0c13acbf1adfc1b70f75418ceabc000a748c9216328ef36f1b8716ded
\ No newline at end of file diff --git a/db/schema_migrations/20220119094023 b/db/schema_migrations/20220119094023 new file mode 100644 index 00000000000..c2bf5ce88d6 --- /dev/null +++ b/db/schema_migrations/20220119094023 @@ -0,0 +1 @@ +4eddd356d87ce8fc8168dabe678211239e8d4051804d51d3bdce8cc137fa5a0d
\ No newline at end of file diff --git a/db/schema_migrations/20220119094503 b/db/schema_migrations/20220119094503 new file mode 100644 index 00000000000..840a4d82593 --- /dev/null +++ b/db/schema_migrations/20220119094503 @@ -0,0 +1 @@ +1048b3a9744f212297c0a3aba176556e92e85f199ac861eb3ee4183eff002860
\ No newline at end of file diff --git a/db/schema_migrations/20220119141407 b/db/schema_migrations/20220119141407 new file mode 100644 index 00000000000..0ff56c63dd6 --- /dev/null +++ b/db/schema_migrations/20220119141407 @@ -0,0 +1 @@ +18b3ef459c3633ebd4b418b4436d3d50b0dc697fa7c4ef4d2e1f62b01d656bce
\ No newline at end of file diff --git a/db/schema_migrations/20220119141736 b/db/schema_migrations/20220119141736 new file mode 100644 index 00000000000..431ed37ea5c --- /dev/null +++ b/db/schema_migrations/20220119141736 @@ -0,0 +1 @@ +faa30b386af9adf3e9f54a0e8e2880310490e4dc1378eae68b346872d0bb8bfd
\ No newline at end of file diff --git a/db/schema_migrations/20220119143130 b/db/schema_migrations/20220119143130 new file mode 100644 index 00000000000..8c9092fd187 --- /dev/null +++ b/db/schema_migrations/20220119143130 @@ -0,0 +1 @@ +a375f82fe0c1ef87aa6abb2142387b852b135be6e2158fd8456b23dc9bcf2a0e
\ No newline at end of file diff --git a/db/schema_migrations/20220119144253 b/db/schema_migrations/20220119144253 new file mode 100644 index 00000000000..ee59402bbcc --- /dev/null +++ b/db/schema_migrations/20220119144253 @@ -0,0 +1 @@ +723db0d234a4dadfdad68a92c249ec0b42e519297f48bcb843e89c1ad97032c7
\ No newline at end of file diff --git a/db/schema_migrations/20220119144458 b/db/schema_migrations/20220119144458 new file mode 100644 index 00000000000..c5eb43a3730 --- /dev/null +++ b/db/schema_migrations/20220119144458 @@ -0,0 +1 @@ +85227d2aa0e984f12362484b23554a4feb1304d055d54da40e20812f2d8c5b9e
\ No newline at end of file diff --git a/db/schema_migrations/20220119151221 b/db/schema_migrations/20220119151221 new file mode 100644 index 00000000000..377170d9cb1 --- /dev/null +++ b/db/schema_migrations/20220119151221 @@ -0,0 +1 @@ +7865f26c43c79681f37ceb6e4fecf6153282856907ddfd8211d6d1d57d1fb7f3
\ No newline at end of file diff --git a/db/schema_migrations/20220119153706 b/db/schema_migrations/20220119153706 new file mode 100644 index 00000000000..446fee12b44 --- /dev/null +++ b/db/schema_migrations/20220119153706 @@ -0,0 +1 @@ +f87eec3c61cfc9dc860fe77af1fbe98c1ea2a9b0dc1b2dbdaaee4276b518af73
\ No newline at end of file diff --git a/db/schema_migrations/20220119154442 b/db/schema_migrations/20220119154442 new file mode 100644 index 00000000000..78880a0164c --- /dev/null +++ b/db/schema_migrations/20220119154442 @@ -0,0 +1 @@ +7cb06f695c7e8e733ea50f0b2e8fbb115d5ac0d7e7f000228bd5ced58ab362c9
\ No newline at end of file diff --git a/db/schema_migrations/20220119170426 b/db/schema_migrations/20220119170426 new file mode 100644 index 00000000000..51274ac5979 --- /dev/null +++ b/db/schema_migrations/20220119170426 @@ -0,0 +1 @@ +a488fecd8e6e99b8d32ac27f72c6a3575b0ed29baaf242133e5d1abbd5b64314
\ No newline at end of file diff --git a/db/schema_migrations/20220119193130 b/db/schema_migrations/20220119193130 new file mode 100644 index 00000000000..5305ff9465e --- /dev/null +++ b/db/schema_migrations/20220119193130 @@ -0,0 +1 @@ +c991eda1b3a972a7da9bdbd5e1f9957394c52246b78d793b4b35fdec9daf6acd
\ No newline at end of file diff --git a/db/schema_migrations/20220119201340 b/db/schema_migrations/20220119201340 new file mode 100644 index 00000000000..0dc36b2dfba --- /dev/null +++ b/db/schema_migrations/20220119201340 @@ -0,0 +1 @@ +62b35cc5bd0abc5b7bcf4347346de832bbbed723fee7860ec649185d4d5fb53c
\ No newline at end of file diff --git a/db/schema_migrations/20220119203119 b/db/schema_migrations/20220119203119 new file mode 100644 index 00000000000..43bdb5b0391 --- /dev/null +++ b/db/schema_migrations/20220119203119 @@ -0,0 +1 @@ +c0f29fd7f960ffd92a65a00e8dce123b91a604f4d89b7cf0bc419fa80495e2e5
\ No newline at end of file diff --git a/db/schema_migrations/20220119220620 b/db/schema_migrations/20220119220620 new file mode 100644 index 00000000000..a6a9abb2acc --- /dev/null +++ b/db/schema_migrations/20220119220620 @@ -0,0 +1 @@ +535f476a358dcb3f3472f1e0ec1afef738f995197b5d1f4fcd61e58a9c9e8e75
\ No newline at end of file diff --git a/db/schema_migrations/20220120033115 b/db/schema_migrations/20220120033115 new file mode 100644 index 00000000000..ef71ca650cd --- /dev/null +++ b/db/schema_migrations/20220120033115 @@ -0,0 +1 @@ +41b67585574f6309d8e32fe695e65fc43f15f6738db713c1a11e04558a5ec515
\ No newline at end of file diff --git a/db/schema_migrations/20220120085655 b/db/schema_migrations/20220120085655 new file mode 100644 index 00000000000..534108786ec --- /dev/null +++ b/db/schema_migrations/20220120085655 @@ -0,0 +1 @@ +966c42749e9d200f2b7295fdbb86e596c33510f0abbf431d40b09629e5e4a6aa
\ No newline at end of file diff --git a/db/schema_migrations/20220120094340 b/db/schema_migrations/20220120094340 new file mode 100644 index 00000000000..423adf5cc94 --- /dev/null +++ b/db/schema_migrations/20220120094340 @@ -0,0 +1 @@ +69d8283501ba6a4946a60e3812fe2cf3031fc4a915d6e7c6fac3bf272423f2f2
\ No newline at end of file diff --git a/db/schema_migrations/20220120123700 b/db/schema_migrations/20220120123700 new file mode 100644 index 00000000000..263901fff19 --- /dev/null +++ b/db/schema_migrations/20220120123700 @@ -0,0 +1 @@ +9e274eae18520821dd890a11c8c6192da82a6051dce9ec2934b1365e57a10fdb
\ No newline at end of file diff --git a/db/schema_migrations/20220120123800 b/db/schema_migrations/20220120123800 new file mode 100644 index 00000000000..6d271f75c08 --- /dev/null +++ b/db/schema_migrations/20220120123800 @@ -0,0 +1 @@ +9d2f0b0d2cb1a5844bdca5bcb4b82fa5cc6b465fa19177f9f6ca16574128fdc8
\ No newline at end of file diff --git a/db/schema_migrations/20220120160625 b/db/schema_migrations/20220120160625 new file mode 100644 index 00000000000..287e364d331 --- /dev/null +++ b/db/schema_migrations/20220120160625 @@ -0,0 +1 @@ +92485ceb25d5733efe9a35a5bd64c9f33253bb10f815590518c6fc8d1c9e5f39
\ No newline at end of file diff --git a/db/schema_migrations/20220120211831 b/db/schema_migrations/20220120211831 new file mode 100644 index 00000000000..7601916df62 --- /dev/null +++ b/db/schema_migrations/20220120211831 @@ -0,0 +1 @@ +68b45f97a2165c934f097ca976fb27ffcb533c57facee95344e3985b5cfd8347
\ No newline at end of file diff --git a/db/schema_migrations/20220120211832 b/db/schema_migrations/20220120211832 new file mode 100644 index 00000000000..ed7679d4573 --- /dev/null +++ b/db/schema_migrations/20220120211832 @@ -0,0 +1 @@ +dd3a4209a72b470a14a3acc5d06db1f5fec67cb4f19b20b2e4d7d94b302fe122
\ No newline at end of file diff --git a/db/schema_migrations/20220121214752 b/db/schema_migrations/20220121214752 new file mode 100644 index 00000000000..84c03a6ed90 --- /dev/null +++ b/db/schema_migrations/20220121214752 @@ -0,0 +1 @@ +c56983a489b56eb6b4a5cd5ae6947a322fd58b8e96bcdee1e38634d99727c432
\ No newline at end of file diff --git a/db/schema_migrations/20220121214753 b/db/schema_migrations/20220121214753 new file mode 100644 index 00000000000..5142044be97 --- /dev/null +++ b/db/schema_migrations/20220121214753 @@ -0,0 +1 @@ +b7b9f5e516664e7eb3f7a5307d1871bb4f58a31f4807e0298fbf9414bad567fa
\ No newline at end of file diff --git a/db/schema_migrations/20220121221651 b/db/schema_migrations/20220121221651 new file mode 100644 index 00000000000..562751c6084 --- /dev/null +++ b/db/schema_migrations/20220121221651 @@ -0,0 +1 @@ +a1681c1c619db7f4e7e5a760cee7d06a931aa1f02dccfce46be81d75a03ce8ac
\ No newline at end of file diff --git a/db/schema_migrations/20220124130028 b/db/schema_migrations/20220124130028 new file mode 100644 index 00000000000..5ee8e463a55 --- /dev/null +++ b/db/schema_migrations/20220124130028 @@ -0,0 +1 @@ +7f2b3e70e33273d75f68bd1fa33103f24a4e4cfc3f2e5777dfd258b5a2e7bf4e
\ No newline at end of file diff --git a/db/schema_migrations/20220124145019 b/db/schema_migrations/20220124145019 new file mode 100644 index 00000000000..8de01024798 --- /dev/null +++ b/db/schema_migrations/20220124145019 @@ -0,0 +1 @@ +3b1f7a7b6481a960ac25523e5e1b5abc6c1436332d64d4319d9e4112b0fa765e
\ No newline at end of file diff --git a/db/schema_migrations/20220124151456 b/db/schema_migrations/20220124151456 new file mode 100644 index 00000000000..10a7b978e2f --- /dev/null +++ b/db/schema_migrations/20220124151456 @@ -0,0 +1 @@ +5ec73b28adb027a4462ec9b268ef9c505e281f1afedce3c592d431cd90808dac
\ No newline at end of file diff --git a/db/schema_migrations/20220124151949 b/db/schema_migrations/20220124151949 new file mode 100644 index 00000000000..2d6305b9789 --- /dev/null +++ b/db/schema_migrations/20220124151949 @@ -0,0 +1 @@ +4eb33deb4c2d5ff587f8af57b8296e46911f24a6ed0b2f7ff1f36243f1a9013d
\ No newline at end of file diff --git a/db/schema_migrations/20220124152824 b/db/schema_migrations/20220124152824 new file mode 100644 index 00000000000..5a0db5859f0 --- /dev/null +++ b/db/schema_migrations/20220124152824 @@ -0,0 +1 @@ +acf680cbf06d6eb2c0da44d416ff947e0460593cad74499acda91eb4bec63894
\ No newline at end of file diff --git a/db/schema_migrations/20220124153233 b/db/schema_migrations/20220124153233 new file mode 100644 index 00000000000..bfb0d6f3c38 --- /dev/null +++ b/db/schema_migrations/20220124153233 @@ -0,0 +1 @@ +f62f3d4cc6f4704e7b4e7d0b6b8e46ed3de4407f0db4282e2ce845aa6c0b3f3f
\ No newline at end of file diff --git a/db/schema_migrations/20220124153234 b/db/schema_migrations/20220124153234 new file mode 100644 index 00000000000..dfca9995395 --- /dev/null +++ b/db/schema_migrations/20220124153234 @@ -0,0 +1 @@ +0e8559121504f1a34394b5f613ef2c5554261f6aeaeaaf5a15d018803c4e5452
\ No newline at end of file diff --git a/db/schema_migrations/20220124180704 b/db/schema_migrations/20220124180704 new file mode 100644 index 00000000000..ef59507a2e8 --- /dev/null +++ b/db/schema_migrations/20220124180704 @@ -0,0 +1 @@ +5b5f47f1d7038518fef71dd8c0758b234bb890be9aab57b78918f7b2dc39bdc4
\ No newline at end of file diff --git a/db/schema_migrations/20220124180705 b/db/schema_migrations/20220124180705 new file mode 100644 index 00000000000..c1600192af1 --- /dev/null +++ b/db/schema_migrations/20220124180705 @@ -0,0 +1 @@ +6c147287ba8436bd0231dc22195c95a71d19987d23741c1291a117407f493184
\ No newline at end of file diff --git a/db/schema_migrations/20220124184338 b/db/schema_migrations/20220124184338 new file mode 100644 index 00000000000..860b47090c2 --- /dev/null +++ b/db/schema_migrations/20220124184338 @@ -0,0 +1 @@ +ae696157794bcbe3ebd0dc41d7b3fe4dc61982ad4a96fa503fd7857e0d3dab16
\ No newline at end of file diff --git a/db/schema_migrations/20220124200927 b/db/schema_migrations/20220124200927 new file mode 100644 index 00000000000..ff29cc59538 --- /dev/null +++ b/db/schema_migrations/20220124200927 @@ -0,0 +1 @@ +688232dde01ea4e8574dca73459094264bde405d799ecaf1a5867adb72576b98
\ No newline at end of file diff --git a/db/schema_migrations/20220124204046 b/db/schema_migrations/20220124204046 new file mode 100644 index 00000000000..f8de3adc215 --- /dev/null +++ b/db/schema_migrations/20220124204046 @@ -0,0 +1 @@ +90115936ede32bbf9a299582409cb0686e8072c204c4f91364dfb13195155929
\ No newline at end of file diff --git a/db/schema_migrations/20220124214131 b/db/schema_migrations/20220124214131 new file mode 100644 index 00000000000..7454bd8b3d1 --- /dev/null +++ b/db/schema_migrations/20220124214131 @@ -0,0 +1 @@ +af60c6df0fb178a4820ea8cb40b402178da7fb4b6ebeabb8739dc45b96225f89
\ No newline at end of file diff --git a/db/schema_migrations/20220124215857 b/db/schema_migrations/20220124215857 new file mode 100644 index 00000000000..495e428d2c4 --- /dev/null +++ b/db/schema_migrations/20220124215857 @@ -0,0 +1 @@ +785c2404175faef7d3d6f81ae8652ca0ced0f4b01def8d6364a4450f0db49ecf
\ No newline at end of file diff --git a/db/schema_migrations/20220124221521 b/db/schema_migrations/20220124221521 new file mode 100644 index 00000000000..8400dcbc1e2 --- /dev/null +++ b/db/schema_migrations/20220124221521 @@ -0,0 +1 @@ +4b1dad4fc34717c9b89a770e4e0682b0cee7d421da68223011bb9fde9460d1f8
\ No newline at end of file diff --git a/db/schema_migrations/20220125083520 b/db/schema_migrations/20220125083520 new file mode 100644 index 00000000000..c3fbb6beda5 --- /dev/null +++ b/db/schema_migrations/20220125083520 @@ -0,0 +1 @@ +2c3f7c587b2a20de1d8581584f7392fd81643af4eb7e25ffc8e08514b6ad83ab
\ No newline at end of file diff --git a/db/schema_migrations/20220125084127 b/db/schema_migrations/20220125084127 new file mode 100644 index 00000000000..f9ba7a4628b --- /dev/null +++ b/db/schema_migrations/20220125084127 @@ -0,0 +1 @@ +c50a21430e52fc6ccbe7ab4aba99ae3a48d1c69858f7886da115f54e19fc27ea
\ No newline at end of file diff --git a/db/schema_migrations/20220125084348 b/db/schema_migrations/20220125084348 new file mode 100644 index 00000000000..9d4cbd7c5ed --- /dev/null +++ b/db/schema_migrations/20220125084348 @@ -0,0 +1 @@ +75eb050fc789eb5775a5d3a88c2573dca5c38e16b63cd342bf46dca55d1adaef
\ No newline at end of file diff --git a/db/schema_migrations/20220125122228 b/db/schema_migrations/20220125122228 new file mode 100644 index 00000000000..2add72978c6 --- /dev/null +++ b/db/schema_migrations/20220125122228 @@ -0,0 +1 @@ +26600e01d8b31a4308d0e23564e4d4c52488ec87ad7990a410b7cc0c031f12e7
\ No newline at end of file diff --git a/db/schema_migrations/20220125122640 b/db/schema_migrations/20220125122640 new file mode 100644 index 00000000000..fdb85bb480a --- /dev/null +++ b/db/schema_migrations/20220125122640 @@ -0,0 +1 @@ +51c7ab860b952281bd7f65d68e7a539a8eee57cac3bbdaf439ff5593f5b065ed
\ No newline at end of file diff --git a/db/schema_migrations/20220125122725 b/db/schema_migrations/20220125122725 new file mode 100644 index 00000000000..7a6ef38bfbc --- /dev/null +++ b/db/schema_migrations/20220125122725 @@ -0,0 +1 @@ +7740d1e71571576a709ae5bfd46f60ea3fb4be3f48cddec2cca53f148096cdd7
\ No newline at end of file diff --git a/db/schema_migrations/20220125230538 b/db/schema_migrations/20220125230538 new file mode 100644 index 00000000000..45bd8bfb04c --- /dev/null +++ b/db/schema_migrations/20220125230538 @@ -0,0 +1 @@ +6f3a3712288c3316042426d60f087817eb57a3246b750831aa72f95f30269a5d
\ No newline at end of file diff --git a/db/schema_migrations/20220126191624 b/db/schema_migrations/20220126191624 new file mode 100644 index 00000000000..f8cbab24379 --- /dev/null +++ b/db/schema_migrations/20220126191624 @@ -0,0 +1 @@ +33170856a78b469c63d4821692929a1df0c41e4b9d98093e771b122b462c9c03
\ No newline at end of file diff --git a/db/schema_migrations/20220126201752 b/db/schema_migrations/20220126201752 new file mode 100644 index 00000000000..e5a1970ec9e --- /dev/null +++ b/db/schema_migrations/20220126201752 @@ -0,0 +1 @@ +7731772dfac065a60c1626707913ddf6ff632bb69dd5ed6534e8d29e4e03c573
\ No newline at end of file diff --git a/db/schema_migrations/20220126202654 b/db/schema_migrations/20220126202654 new file mode 100644 index 00000000000..341e2c6b8bf --- /dev/null +++ b/db/schema_migrations/20220126202654 @@ -0,0 +1 @@ +6067e4e22e49548496454b48171f8168f7d5bf626fedab4351e2a37a3f85731b
\ No newline at end of file diff --git a/db/schema_migrations/20220126203421 b/db/schema_migrations/20220126203421 new file mode 100644 index 00000000000..32469cd40ee --- /dev/null +++ b/db/schema_migrations/20220126203421 @@ -0,0 +1 @@ +07f837ddde21e36d1ca6a471dd96350d3020bd30204fca0e093983810c94e54d
\ No newline at end of file diff --git a/db/schema_migrations/20220126210021 b/db/schema_migrations/20220126210021 new file mode 100644 index 00000000000..edb9d9c779d --- /dev/null +++ b/db/schema_migrations/20220126210021 @@ -0,0 +1 @@ +fd7940bb6f077c91d7f9928f574443ba4bf33bb90cb702c0a2ecad14398ab1cc
\ No newline at end of file diff --git a/db/schema_migrations/20220126210022 b/db/schema_migrations/20220126210022 new file mode 100644 index 00000000000..32cb73ee3ee --- /dev/null +++ b/db/schema_migrations/20220126210022 @@ -0,0 +1 @@ +80a75bf72b40ee791bebd9ae97a793ce41fbd352841d83421525b6ad78e1c5e8
\ No newline at end of file diff --git a/db/schema_migrations/20220126210657 b/db/schema_migrations/20220126210657 new file mode 100644 index 00000000000..a3301b46756 --- /dev/null +++ b/db/schema_migrations/20220126210657 @@ -0,0 +1 @@ +853209f3babe2856481591790d9bb67145c4c0c919ed4d8365bb8d498e4f6b8e
\ No newline at end of file diff --git a/db/schema_migrations/20220127112243 b/db/schema_migrations/20220127112243 new file mode 100644 index 00000000000..2c591bdde58 --- /dev/null +++ b/db/schema_migrations/20220127112243 @@ -0,0 +1 @@ +7707b9bcdcd7ec28af31b90355905eb8971c12a90c4334b0ae214e45fac9645a
\ No newline at end of file diff --git a/db/schema_migrations/20220127112412 b/db/schema_migrations/20220127112412 new file mode 100644 index 00000000000..af58ff48473 --- /dev/null +++ b/db/schema_migrations/20220127112412 @@ -0,0 +1 @@ +350409be3f491b61a1d757dbd839b48d088339883e8e019d00ad90e6adc350e6
\ No newline at end of file diff --git a/db/schema_migrations/20220127132200 b/db/schema_migrations/20220127132200 new file mode 100644 index 00000000000..8dc7ac4ddbd --- /dev/null +++ b/db/schema_migrations/20220127132200 @@ -0,0 +1 @@ +394f1fa34ccf9188f25102ac963829ebee07dddaf02f1d5958ec14d701fb6fe8
\ No newline at end of file diff --git a/db/schema_migrations/20220127132201 b/db/schema_migrations/20220127132201 new file mode 100644 index 00000000000..f2c9cbbe38f --- /dev/null +++ b/db/schema_migrations/20220127132201 @@ -0,0 +1 @@ +f8ce7c183352ce08585eda83eb1e22c800b1b2044b93bc11858a74a8bd9a99d4
\ No newline at end of file diff --git a/db/schema_migrations/20220128093756 b/db/schema_migrations/20220128093756 new file mode 100644 index 00000000000..fd24b6cd4cd --- /dev/null +++ b/db/schema_migrations/20220128093756 @@ -0,0 +1 @@ +787b1be4b69ef0eeb049ee6a3d7126dc75094b79fba18f469fffe78b16fce6a3
\ No newline at end of file diff --git a/db/schema_migrations/20220128103042 b/db/schema_migrations/20220128103042 new file mode 100644 index 00000000000..de1e50b66bf --- /dev/null +++ b/db/schema_migrations/20220128103042 @@ -0,0 +1 @@ +57813d4c107938d8e58d6223719c2c67206172342b52655ca4a068c845edeb3a
\ No newline at end of file diff --git a/db/schema_migrations/20220128155251 b/db/schema_migrations/20220128155251 new file mode 100644 index 00000000000..11fa6807ed5 --- /dev/null +++ b/db/schema_migrations/20220128155251 @@ -0,0 +1 @@ +0d121aeecdd6ace1516c2e9b84fefd47d963c4cbe22a0448728241d83da3742e
\ No newline at end of file diff --git a/db/schema_migrations/20220128155814 b/db/schema_migrations/20220128155814 new file mode 100644 index 00000000000..209b0874a84 --- /dev/null +++ b/db/schema_migrations/20220128155814 @@ -0,0 +1 @@ +77cc8fc86f2c6a5ed017dde40dd4db796821a35e6ce4d8dcbe24b2cdaccbb5d9
\ No newline at end of file diff --git a/db/schema_migrations/20220128194722 b/db/schema_migrations/20220128194722 new file mode 100644 index 00000000000..9c06f452c1e --- /dev/null +++ b/db/schema_migrations/20220128194722 @@ -0,0 +1 @@ +087338f0b438d2aa33bc22bd3973d818c5d1f40948525d95181751722158605b
\ No newline at end of file diff --git a/db/schema_migrations/20220131000000 b/db/schema_migrations/20220131000000 new file mode 100644 index 00000000000..f80ceb97f1c --- /dev/null +++ b/db/schema_migrations/20220131000000 @@ -0,0 +1 @@ +08326048e15f368f09bc10ebf5bee3e77e8b43813f66c19d24731497ca6a8485
\ No newline at end of file diff --git a/db/schema_migrations/20220131000001 b/db/schema_migrations/20220131000001 new file mode 100644 index 00000000000..72dce62bbce --- /dev/null +++ b/db/schema_migrations/20220131000001 @@ -0,0 +1 @@ +59fe701bcaa102b7e0c1496198fa4aeea6b2e59132c951d1c9d54562c5e3900e
\ No newline at end of file diff --git a/db/schema_migrations/20220131135725 b/db/schema_migrations/20220131135725 new file mode 100644 index 00000000000..d63b24d5d6c --- /dev/null +++ b/db/schema_migrations/20220131135725 @@ -0,0 +1 @@ +a0e9bb92512b9ddb3fd718e086b0fd116ec307be6acc5789a872b1d3004fdebd
\ No newline at end of file diff --git a/db/schema_migrations/20220131192643 b/db/schema_migrations/20220131192643 new file mode 100644 index 00000000000..e947bf0cfbe --- /dev/null +++ b/db/schema_migrations/20220131192643 @@ -0,0 +1 @@ +3b9068f109685dcfa8a0a1fda886cca3909d29cbc280cf70ed9f3d927def12ac
\ No newline at end of file diff --git a/db/schema_migrations/20220201034731 b/db/schema_migrations/20220201034731 new file mode 100644 index 00000000000..59e4fd59720 --- /dev/null +++ b/db/schema_migrations/20220201034731 @@ -0,0 +1 @@ +873ff811d4f70c012785297ee8c07eb496994af69d5ae4b266e8f675c88daca4
\ No newline at end of file diff --git a/db/schema_migrations/20220201141705 b/db/schema_migrations/20220201141705 new file mode 100644 index 00000000000..92835993156 --- /dev/null +++ b/db/schema_migrations/20220201141705 @@ -0,0 +1 @@ +9eb0c4609fbec79370215d05a9a1faf4208b9dcc2bfeb861feeb7c9f354489ab
\ No newline at end of file diff --git a/db/schema_migrations/20220201173212 b/db/schema_migrations/20220201173212 new file mode 100644 index 00000000000..b07c8e371a5 --- /dev/null +++ b/db/schema_migrations/20220201173212 @@ -0,0 +1 @@ +7a48d49d576d183198df370593642419da5707d8b018a23f541c448e2aa7ad65
\ No newline at end of file diff --git a/db/schema_migrations/20220201193033 b/db/schema_migrations/20220201193033 new file mode 100644 index 00000000000..e40840c66fa --- /dev/null +++ b/db/schema_migrations/20220201193033 @@ -0,0 +1 @@ +92bbe74c6c3627dd26f709acd2a20f442212eab933f719be815701a3bc429539
\ No newline at end of file diff --git a/db/schema_migrations/20220201205300 b/db/schema_migrations/20220201205300 new file mode 100644 index 00000000000..86f6dd234fd --- /dev/null +++ b/db/schema_migrations/20220201205300 @@ -0,0 +1 @@ +79a636f33f70327206356abd1793b73a5ef5e920a41662e35cbff5597b03a365
\ No newline at end of file diff --git a/db/schema_migrations/20220202034409 b/db/schema_migrations/20220202034409 new file mode 100644 index 00000000000..4eb359f45e6 --- /dev/null +++ b/db/schema_migrations/20220202034409 @@ -0,0 +1 @@ +0efe482aa626cf80912feaa1176837253b094fc434f273bee35b5fe3e8ce4243
\ No newline at end of file diff --git a/db/schema_migrations/20220202105733 b/db/schema_migrations/20220202105733 new file mode 100644 index 00000000000..473b03d6210 --- /dev/null +++ b/db/schema_migrations/20220202105733 @@ -0,0 +1 @@ +6f2919091a6998f2f18f8dbff3c968e68dc218ab0e51341164d1fc5b8abf72ae
\ No newline at end of file diff --git a/db/schema_migrations/20220202115350 b/db/schema_migrations/20220202115350 new file mode 100644 index 00000000000..9b8148ca2d1 --- /dev/null +++ b/db/schema_migrations/20220202115350 @@ -0,0 +1 @@ +3bcc97592e8e329e39917deffae6619e69215930a688bebad2949f69155b53f9
\ No newline at end of file diff --git a/db/schema_migrations/20220203074916 b/db/schema_migrations/20220203074916 new file mode 100644 index 00000000000..fffd0dcc003 --- /dev/null +++ b/db/schema_migrations/20220203074916 @@ -0,0 +1 @@ +5bb52cc70aada72e0e569006fd05de0c0d7629559d78bfd361009c91482f02cf
\ No newline at end of file diff --git a/db/schema_migrations/20220203091304 b/db/schema_migrations/20220203091304 new file mode 100644 index 00000000000..847620db3d2 --- /dev/null +++ b/db/schema_migrations/20220203091304 @@ -0,0 +1 @@ +dac90da1a8c5af69610dd103c8db9cd70a395ad5f9addafb554a853d6acd2a6e
\ No newline at end of file diff --git a/db/schema_migrations/20220203123333 b/db/schema_migrations/20220203123333 new file mode 100644 index 00000000000..9cc146c4ed7 --- /dev/null +++ b/db/schema_migrations/20220203123333 @@ -0,0 +1 @@ +87cccb30bb6f27a1acb0dd0cb905040e2a0291cefc5f26bb9a08c8be18034ca3
\ No newline at end of file diff --git a/db/schema_migrations/20220203133652 b/db/schema_migrations/20220203133652 new file mode 100644 index 00000000000..7deda2292b4 --- /dev/null +++ b/db/schema_migrations/20220203133652 @@ -0,0 +1 @@ +5642cf604a1aaf8bef6098a9918b582e0e336d79ca3b2a005cf90bb8eab0ca13
\ No newline at end of file diff --git a/db/schema_migrations/20220203134942 b/db/schema_migrations/20220203134942 new file mode 100644 index 00000000000..7dea7f1f0e7 --- /dev/null +++ b/db/schema_migrations/20220203134942 @@ -0,0 +1 @@ +02f7a38c7bc19b1a266ac1f1d6631f1922fc135518baeb19ee90bebd7c31c6b9
\ No newline at end of file diff --git a/db/schema_migrations/20220204053655 b/db/schema_migrations/20220204053655 new file mode 100644 index 00000000000..e096dae0c07 --- /dev/null +++ b/db/schema_migrations/20220204053655 @@ -0,0 +1 @@ +d6b7fa6e5be83aa67bb479604bf6ddb9d8caae82fc8ea1ab7f34d5c534174ecf
\ No newline at end of file diff --git a/db/schema_migrations/20220204093120 b/db/schema_migrations/20220204093120 new file mode 100644 index 00000000000..debd48e3c5f --- /dev/null +++ b/db/schema_migrations/20220204093120 @@ -0,0 +1 @@ +e147a8281f98ee397d7d9b652ce21b943e4e87c11fca906b72db839e0e2fa360
\ No newline at end of file diff --git a/db/schema_migrations/20220204095121 b/db/schema_migrations/20220204095121 new file mode 100644 index 00000000000..bf12ca08f5a --- /dev/null +++ b/db/schema_migrations/20220204095121 @@ -0,0 +1 @@ +bce595c1c6587e785bc49d6e5a7181b5cc0164f2201375ad82d4bd19c217cd35
\ No newline at end of file diff --git a/db/schema_migrations/20220204110725 b/db/schema_migrations/20220204110725 new file mode 100644 index 00000000000..804dc8c6d54 --- /dev/null +++ b/db/schema_migrations/20220204110725 @@ -0,0 +1 @@ +c87ca83f592c6688c31182fcd4cf6fe282c00a3c92ebe245b66455f57b50fc32
\ No newline at end of file diff --git a/db/schema_migrations/20220204154220 b/db/schema_migrations/20220204154220 new file mode 100644 index 00000000000..42da4e82258 --- /dev/null +++ b/db/schema_migrations/20220204154220 @@ -0,0 +1 @@ +efecc3c6468d8a5036352f5b62e8d70de835d1beb4e45ba6d3906906d0317848
\ No newline at end of file diff --git a/db/schema_migrations/20220204193000 b/db/schema_migrations/20220204193000 new file mode 100644 index 00000000000..f0d16b9671c --- /dev/null +++ b/db/schema_migrations/20220204193000 @@ -0,0 +1 @@ +9d98618a1e9fd0474c45ac54420fc64a1d90ad77f36be594337e5b117fccdadb
\ No newline at end of file diff --git a/db/schema_migrations/20220204194347 b/db/schema_migrations/20220204194347 new file mode 100644 index 00000000000..d506497e036 --- /dev/null +++ b/db/schema_migrations/20220204194347 @@ -0,0 +1 @@ +1593e935601ae1f2ab788109687bb40bad026f3f425339a39c8d13d3e4c7e306
\ No newline at end of file diff --git a/db/schema_migrations/20220207080758 b/db/schema_migrations/20220207080758 new file mode 100644 index 00000000000..d4adf5ad455 --- /dev/null +++ b/db/schema_migrations/20220207080758 @@ -0,0 +1 @@ +f63be8bd42cc1856c92f9073fdb39c58c45806b483d38b91db007a8661c49a97
\ No newline at end of file diff --git a/db/schema_migrations/20220207083129 b/db/schema_migrations/20220207083129 new file mode 100644 index 00000000000..25dca4578f4 --- /dev/null +++ b/db/schema_migrations/20220207083129 @@ -0,0 +1 @@ +01cc0139097235991fa2caf8b780ccd1c3ce580647197418424ade83ce9be77e
\ No newline at end of file diff --git a/db/schema_migrations/20220208080921 b/db/schema_migrations/20220208080921 new file mode 100644 index 00000000000..ecf35389390 --- /dev/null +++ b/db/schema_migrations/20220208080921 @@ -0,0 +1 @@ +84346c2f608792f259ab91dbc2c8aac8397a2997f890f8e077aad809276bb7cd
\ No newline at end of file diff --git a/db/schema_migrations/20220208115439 b/db/schema_migrations/20220208115439 new file mode 100644 index 00000000000..72230321625 --- /dev/null +++ b/db/schema_migrations/20220208115439 @@ -0,0 +1 @@ +dbe6760198b8fa068c30871a439298e56802867044a178baa6b8b009f8da13e6
\ No newline at end of file diff --git a/db/schema_migrations/20220208170445 b/db/schema_migrations/20220208170445 new file mode 100644 index 00000000000..3a486a586a8 --- /dev/null +++ b/db/schema_migrations/20220208170445 @@ -0,0 +1 @@ +e00dd618ca393596f3ff05b44b1a9a36183729a864a5cf4b8f1a262dfcdb932b
\ No newline at end of file diff --git a/db/schema_migrations/20220208171826 b/db/schema_migrations/20220208171826 new file mode 100644 index 00000000000..75ae0dcef61 --- /dev/null +++ b/db/schema_migrations/20220208171826 @@ -0,0 +1 @@ +e48473172d7561fb7474e16e291e555843c0ec4543300b007f86cd4a5923db85
\ No newline at end of file diff --git a/db/schema_migrations/20220209111007 b/db/schema_migrations/20220209111007 new file mode 100644 index 00000000000..f10e05b8918 --- /dev/null +++ b/db/schema_migrations/20220209111007 @@ -0,0 +1 @@ +9462258bcbe45ab80f7ef5a02f8b8d5c0ed6ac69bf04b8934ae3dee2261ba458
\ No newline at end of file diff --git a/db/schema_migrations/20220211090920 b/db/schema_migrations/20220211090920 new file mode 100644 index 00000000000..1f08b66e508 --- /dev/null +++ b/db/schema_migrations/20220211090920 @@ -0,0 +1 @@ +644d38e401ac8179777cb9d3c5fefca2fb55e0c409197bb2d222f7e96e5dd42f
\ No newline at end of file diff --git a/db/schema_migrations/20220211125954 b/db/schema_migrations/20220211125954 new file mode 100644 index 00000000000..5f0bb009254 --- /dev/null +++ b/db/schema_migrations/20220211125954 @@ -0,0 +1 @@ +73feefe409b9c0f4ea373d0c3f13690df0086fbc4fc212595e959ad65fcc27b1
\ No newline at end of file diff --git a/db/schema_migrations/20220211214605 b/db/schema_migrations/20220211214605 new file mode 100644 index 00000000000..89dbee18ee7 --- /dev/null +++ b/db/schema_migrations/20220211214605 @@ -0,0 +1 @@ +add5ee0b8e090ba740ce738f66ea4f741485a0c84728fecfa5b0488564d55536
\ No newline at end of file diff --git a/db/schema_migrations/20220212120735 b/db/schema_migrations/20220212120735 new file mode 100644 index 00000000000..1ec5f9af681 --- /dev/null +++ b/db/schema_migrations/20220212120735 @@ -0,0 +1 @@ +c075ee9d6efeae4b7a9b6e310f0c3d0bdd0ac6a58dc214427d4de9ae579db50d
\ No newline at end of file diff --git a/db/schema_migrations/20220213100000 b/db/schema_migrations/20220213100000 new file mode 100644 index 00000000000..a62215351cd --- /dev/null +++ b/db/schema_migrations/20220213100000 @@ -0,0 +1 @@ +a6c1438ebcffca03e1c42ca9a233d087932fabcfd1eacf20dd801b9f574226e5
\ No newline at end of file diff --git a/db/schema_migrations/20220213103859 b/db/schema_migrations/20220213103859 new file mode 100644 index 00000000000..8950d31675e --- /dev/null +++ b/db/schema_migrations/20220213103859 @@ -0,0 +1 @@ +ffc9a2dd97ace1f34e0cfca0c407dcf98dabf30379a441ba948261aec531fe85
\ No newline at end of file diff --git a/db/schema_migrations/20220213104531 b/db/schema_migrations/20220213104531 new file mode 100644 index 00000000000..72656d85fb0 --- /dev/null +++ b/db/schema_migrations/20220213104531 @@ -0,0 +1 @@ +9ce8aa469b9469d25fbba52147e24c95f6242c2ab1e114df8baaf5a45268d2fd
\ No newline at end of file diff --git a/db/schema_migrations/20220215164709 b/db/schema_migrations/20220215164709 new file mode 100644 index 00000000000..60179eaeddd --- /dev/null +++ b/db/schema_migrations/20220215164709 @@ -0,0 +1 @@ +af6d142b77bc2787a520f8cbc63c287823a7a65a2edb3eb488e4f0f4efde9fa8
\ No newline at end of file diff --git a/db/schema_migrations/20220215190020 b/db/schema_migrations/20220215190020 new file mode 100644 index 00000000000..1d5be90ca1f --- /dev/null +++ b/db/schema_migrations/20220215190020 @@ -0,0 +1 @@ +aa92afc5f74f051132aeb73889d7360bbd6258b27c0aedb4fea6a44ccce597b3
\ No newline at end of file diff --git a/db/schema_migrations/20220216110023 b/db/schema_migrations/20220216110023 new file mode 100644 index 00000000000..30acd6fdaf2 --- /dev/null +++ b/db/schema_migrations/20220216110023 @@ -0,0 +1 @@ +5931c4981c89d65c5aaca05dc8375c2c21bb595e28354d6623986d906ece165d
\ No newline at end of file diff --git a/db/schema_migrations/20220216201949 b/db/schema_migrations/20220216201949 new file mode 100644 index 00000000000..466da69ad0e --- /dev/null +++ b/db/schema_migrations/20220216201949 @@ -0,0 +1 @@ +481bc7b167ddf46bd11322e4458e48de10483bf34d0e393f7e76a3572c28e09f
\ No newline at end of file diff --git a/db/schema_migrations/20220217100008 b/db/schema_migrations/20220217100008 new file mode 100644 index 00000000000..6347388a5ce --- /dev/null +++ b/db/schema_migrations/20220217100008 @@ -0,0 +1 @@ +f52d88262879c40d9ac60a74853b7070036f244fd5f7957c59bbfceb343811d1
\ No newline at end of file diff --git a/db/schema_migrations/20220217113058 b/db/schema_migrations/20220217113058 new file mode 100644 index 00000000000..ef801a0e269 --- /dev/null +++ b/db/schema_migrations/20220217113058 @@ -0,0 +1 @@ +d2d236e9ee5fa6e9c1ee97431543e871b78e469b812444bd9386dfecf849947b
\ No newline at end of file diff --git a/db/schema_migrations/20220217135229 b/db/schema_migrations/20220217135229 new file mode 100644 index 00000000000..fb80b77347f --- /dev/null +++ b/db/schema_migrations/20220217135229 @@ -0,0 +1 @@ +3223f741799216ee6afb4daafbcebfa09bd722d461dd4d64fcbda7d8700ae235
\ No newline at end of file diff --git a/db/schema_migrations/20220221102333 b/db/schema_migrations/20220221102333 new file mode 100644 index 00000000000..dfc13fd28a0 --- /dev/null +++ b/db/schema_migrations/20220221102333 @@ -0,0 +1 @@ +7aa2cf28363e914ad83c61d45321f701a68111122c75abeb54430c4035d56677
\ No newline at end of file diff --git a/db/schema_migrations/20220221214928 b/db/schema_migrations/20220221214928 new file mode 100644 index 00000000000..5c32b3fbd96 --- /dev/null +++ b/db/schema_migrations/20220221214928 @@ -0,0 +1 @@ +8c9936d1c0f728c2b40dca536f9edb40f4af94a274ccf1dbec984f218710f695
\ No newline at end of file diff --git a/db/schema_migrations/20220222072536 b/db/schema_migrations/20220222072536 new file mode 100644 index 00000000000..6a4b4f76dda --- /dev/null +++ b/db/schema_migrations/20220222072536 @@ -0,0 +1 @@ +d7ddc369818f0a2403abefea2ac1da5abd1ca41199d3948166f10dfdf9d2fa9d
\ No newline at end of file diff --git a/db/schema_migrations/20220222191845 b/db/schema_migrations/20220222191845 new file mode 100644 index 00000000000..88c15bc87c0 --- /dev/null +++ b/db/schema_migrations/20220222191845 @@ -0,0 +1 @@ +c528d64cafc072554cd1ef1006a1c359a3135896abae2d5ca20fbbc99ff14f8c
\ No newline at end of file diff --git a/db/schema_migrations/20220222192524 b/db/schema_migrations/20220222192524 new file mode 100644 index 00000000000..c49e45f0d61 --- /dev/null +++ b/db/schema_migrations/20220222192524 @@ -0,0 +1 @@ +b876119bb369a9831736cddf5326b72a74003ec2e17fe863654cb69497fcf236
\ No newline at end of file diff --git a/db/schema_migrations/20220222192525 b/db/schema_migrations/20220222192525 new file mode 100644 index 00000000000..6eeec13bbb5 --- /dev/null +++ b/db/schema_migrations/20220222192525 @@ -0,0 +1 @@ +f512ea4c4a2625c647c3d05765152fee963b56962b674f839180fd77c194ccb0
\ No newline at end of file diff --git a/db/schema_migrations/20220223112304 b/db/schema_migrations/20220223112304 new file mode 100644 index 00000000000..bfcbf9c1225 --- /dev/null +++ b/db/schema_migrations/20220223112304 @@ -0,0 +1 @@ +57dc23bb2a9faddefe20c1e30a8879ebb1f6f32f17e3cc381acc1d06ad3b598a
\ No newline at end of file diff --git a/db/schema_migrations/20220223124428 b/db/schema_migrations/20220223124428 new file mode 100644 index 00000000000..b163accc957 --- /dev/null +++ b/db/schema_migrations/20220223124428 @@ -0,0 +1 @@ +8fb72b15bfaa1b58f87cb3f1836df1e8bfa1a5ddec4e480a2cb6a3c9fafe3bda
\ No newline at end of file diff --git a/db/schema_migrations/20220224000000 b/db/schema_migrations/20220224000000 new file mode 100644 index 00000000000..e6e9aefbabb --- /dev/null +++ b/db/schema_migrations/20220224000000 @@ -0,0 +1 @@ +74b4d572118b7f5da0a80722601a4757ce47ccbdae1af1e84b2304343477d634
\ No newline at end of file diff --git a/db/schema_migrations/20220224204415 b/db/schema_migrations/20220224204415 new file mode 100644 index 00000000000..e0faa994b54 --- /dev/null +++ b/db/schema_migrations/20220224204415 @@ -0,0 +1 @@ +1d7105559c8d2da1d86c5625c592edc792d7cd729b8c86c7a2b950c3dd98e975
\ No newline at end of file diff --git a/db/schema_migrations/20220225133705 b/db/schema_migrations/20220225133705 new file mode 100644 index 00000000000..97f27e748e0 --- /dev/null +++ b/db/schema_migrations/20220225133705 @@ -0,0 +1 @@ +aa9ab05f6991f06c465fbc4878e0cbc648dc09b1b7912dbbf3dd68887a9cdd1d
\ No newline at end of file diff --git a/db/schema_migrations/20220301002101 b/db/schema_migrations/20220301002101 new file mode 100644 index 00000000000..ab8f76b3bbb --- /dev/null +++ b/db/schema_migrations/20220301002101 @@ -0,0 +1 @@ +a19f7f5026fd91cf6f3fcadccd19808920e64005c207b57b46955a0352a68366
\ No newline at end of file diff --git a/db/schema_migrations/20220301003502 b/db/schema_migrations/20220301003502 new file mode 100644 index 00000000000..5a2a9ee8334 --- /dev/null +++ b/db/schema_migrations/20220301003502 @@ -0,0 +1 @@ +bbca8df8e60c8d027f672dfdee2b0edef35f4fdc3152ae98450df67633f3998f
\ No newline at end of file diff --git a/db/schema_migrations/20220301091503 b/db/schema_migrations/20220301091503 new file mode 100644 index 00000000000..49184ad4262 --- /dev/null +++ b/db/schema_migrations/20220301091503 @@ -0,0 +1 @@ +4a05ddbc3d2a52a719c6fda8d834611be6f663fbce97b42655a00583d0e2042a
\ No newline at end of file diff --git a/db/schema_migrations/20220301093434 b/db/schema_migrations/20220301093434 new file mode 100644 index 00000000000..78886cc9df4 --- /dev/null +++ b/db/schema_migrations/20220301093434 @@ -0,0 +1 @@ +ffdd031395c025ea63ea1adcd63636822e62388a8860c93235f3748918fc30ca
\ No newline at end of file diff --git a/db/schema_migrations/20220301175104 b/db/schema_migrations/20220301175104 new file mode 100644 index 00000000000..2553c957576 --- /dev/null +++ b/db/schema_migrations/20220301175104 @@ -0,0 +1 @@ +52e172b1ca6e21a6864e82597a7aae6e1c4776507a475a88807ec140b8648966
\ No newline at end of file diff --git a/db/schema_migrations/20220301175426 b/db/schema_migrations/20220301175426 new file mode 100644 index 00000000000..6a11d9b04b8 --- /dev/null +++ b/db/schema_migrations/20220301175426 @@ -0,0 +1 @@ +d0a8daf9fb9892fc92b03f13de4d7e470e5c54f03b09f887cdd45bc5eb9a7e37
\ No newline at end of file diff --git a/db/schema_migrations/20220302110724 b/db/schema_migrations/20220302110724 new file mode 100644 index 00000000000..700a39b85c5 --- /dev/null +++ b/db/schema_migrations/20220302110724 @@ -0,0 +1 @@ +4f565a313c37d12f24afe26a9e344d4273c54d0f080b3108d56ed98bf7299ecc
\ No newline at end of file diff --git a/db/schema_migrations/20220302114046 b/db/schema_migrations/20220302114046 new file mode 100644 index 00000000000..40488b47eb2 --- /dev/null +++ b/db/schema_migrations/20220302114046 @@ -0,0 +1 @@ +4e2de14559b47a9bf3fa8910fdb84ff62cb18442620f4147e40e8026bf4bcf1b
\ No newline at end of file diff --git a/db/schema_migrations/20220302203410 b/db/schema_migrations/20220302203410 new file mode 100644 index 00000000000..70326d38a97 --- /dev/null +++ b/db/schema_migrations/20220302203410 @@ -0,0 +1 @@ +873aac965684e58cfdb6098b20891cbb73614aff833f235d76bfd379498f6fda
\ No newline at end of file diff --git a/db/schema_migrations/20220303190555 b/db/schema_migrations/20220303190555 new file mode 100644 index 00000000000..08db64ca2a4 --- /dev/null +++ b/db/schema_migrations/20220303190555 @@ -0,0 +1 @@ +f8fa8b83da24bf98c97447a2940c8ca801532c80395b6a65c11f83515f811652
\ No newline at end of file diff --git a/db/schema_migrations/20220303191047 b/db/schema_migrations/20220303191047 new file mode 100644 index 00000000000..6e933c08f6b --- /dev/null +++ b/db/schema_migrations/20220303191047 @@ -0,0 +1 @@ +19566152e16a92263dd5dcfd66299e3b9d8b82acd4edb4bba21f6b9b06fc8070
\ No newline at end of file diff --git a/db/schema_migrations/20220304052335 b/db/schema_migrations/20220304052335 new file mode 100644 index 00000000000..5716ea07f7d --- /dev/null +++ b/db/schema_migrations/20220304052335 @@ -0,0 +1 @@ +ba2bae8d9561eeab907ecf30664a593bdf93ab1041453f93794bf0be4464e92c
\ No newline at end of file diff --git a/db/schema_migrations/20220304061631 b/db/schema_migrations/20220304061631 new file mode 100644 index 00000000000..d7b38b30f9f --- /dev/null +++ b/db/schema_migrations/20220304061631 @@ -0,0 +1 @@ +7394be90999876473cfe39c38e72f21c7bb36a5038300d6fe1354f15f3d77e21
\ No newline at end of file diff --git a/db/schema_migrations/20220304062107 b/db/schema_migrations/20220304062107 new file mode 100644 index 00000000000..9ea552c6a9e --- /dev/null +++ b/db/schema_migrations/20220304062107 @@ -0,0 +1 @@ +a9aace14f847412c2af03cc6de61616a0f48d32d0fd24b25f6b1f85513c87139
\ No newline at end of file diff --git a/db/schema_migrations/20220304152729 b/db/schema_migrations/20220304152729 new file mode 100644 index 00000000000..021d4e5ad27 --- /dev/null +++ b/db/schema_migrations/20220304152729 @@ -0,0 +1 @@ +483f8299688a6e24fa77867b7dab8a2dad0c2b7ebe43c56c81c02ab1e0dc4674
\ No newline at end of file diff --git a/db/schema_migrations/20220304165107 b/db/schema_migrations/20220304165107 new file mode 100644 index 00000000000..6db7aee6b0f --- /dev/null +++ b/db/schema_migrations/20220304165107 @@ -0,0 +1 @@ +b7090327d2638bbee6646e5ca5a8f8597d97631f10f997698b8a1c1b6329c106
\ No newline at end of file diff --git a/db/schema_migrations/20220304201847 b/db/schema_migrations/20220304201847 new file mode 100644 index 00000000000..1dafb1b821e --- /dev/null +++ b/db/schema_migrations/20220304201847 @@ -0,0 +1 @@ +d60a313ac68b0edfe1ae219690aacbe74c038b90bc4239f67d14f9ced36d67f6
\ No newline at end of file diff --git a/db/schema_migrations/20220305223212 b/db/schema_migrations/20220305223212 new file mode 100644 index 00000000000..b8adc88a760 --- /dev/null +++ b/db/schema_migrations/20220305223212 @@ -0,0 +1 @@ +8a0e80b6df1d942e5ec23641c935103cddd96c044e2a960b88bb38284cf4d070
\ No newline at end of file diff --git a/db/schema_migrations/20220307192534 b/db/schema_migrations/20220307192534 new file mode 100644 index 00000000000..cf6687d88ea --- /dev/null +++ b/db/schema_migrations/20220307192534 @@ -0,0 +1 @@ +b8adcc6d7dc76fd18037de9b2b204e7db8803564df19cbd59f928901c8d97b9c
\ No newline at end of file diff --git a/db/schema_migrations/20220307192610 b/db/schema_migrations/20220307192610 new file mode 100644 index 00000000000..17575dc7174 --- /dev/null +++ b/db/schema_migrations/20220307192610 @@ -0,0 +1 @@ +3dd34a92230e36fe1e9761ce39e4edb2a3289c972ce56347e87d8e36818e46d1
\ No newline at end of file diff --git a/db/schema_migrations/20220307192645 b/db/schema_migrations/20220307192645 new file mode 100644 index 00000000000..913bbbf5c96 --- /dev/null +++ b/db/schema_migrations/20220307192645 @@ -0,0 +1 @@ +c31db54f15cff7b21272cc2e9e962419ba4422582c227c5af4131fe56c1fc9f8
\ No newline at end of file diff --git a/db/schema_migrations/20220307192725 b/db/schema_migrations/20220307192725 new file mode 100644 index 00000000000..1611c196a57 --- /dev/null +++ b/db/schema_migrations/20220307192725 @@ -0,0 +1 @@ +d1761614c3ac0e8bd33eff58134091ec6c1834ecde3e47290a80da45ab207923
\ No newline at end of file diff --git a/db/schema_migrations/20220307203458 b/db/schema_migrations/20220307203458 new file mode 100644 index 00000000000..3063be46503 --- /dev/null +++ b/db/schema_migrations/20220307203458 @@ -0,0 +1 @@ +d4bf5f7c695c9833a07722d724b7a6363f0ebcb7f6d8a15bcf8148bdae5e1b32
\ No newline at end of file diff --git a/db/schema_migrations/20220307203459 b/db/schema_migrations/20220307203459 new file mode 100644 index 00000000000..2220fd3cb61 --- /dev/null +++ b/db/schema_migrations/20220307203459 @@ -0,0 +1 @@ +74f6687c0793a2596467338d8b4904bef712e6ff3ad3561e3ab2546eed5cd24d
\ No newline at end of file diff --git a/db/schema_migrations/20220308000205 b/db/schema_migrations/20220308000205 new file mode 100644 index 00000000000..27caf959eb9 --- /dev/null +++ b/db/schema_migrations/20220308000205 @@ -0,0 +1 @@ +c30b1b36ec83df1b4fdf0c3c28656b158beab4f2188875898182c2dfbd073c80
\ No newline at end of file diff --git a/db/schema_migrations/20220308115219 b/db/schema_migrations/20220308115219 new file mode 100644 index 00000000000..6e55d2fdabe --- /dev/null +++ b/db/schema_migrations/20220308115219 @@ -0,0 +1 @@ +e18ed9e6b2a98c77190ff2ce33f4d2b1984710b438e851d6a526ec8bb1f33c80
\ No newline at end of file diff --git a/db/schema_migrations/20220308115502 b/db/schema_migrations/20220308115502 new file mode 100644 index 00000000000..c379b67485c --- /dev/null +++ b/db/schema_migrations/20220308115502 @@ -0,0 +1 @@ +0aacf46a4a5b430a718336108f52c1c0bed4283846f36c2ab1de80100dcae0b4
\ No newline at end of file diff --git a/db/schema_migrations/20220309084838 b/db/schema_migrations/20220309084838 new file mode 100644 index 00000000000..ba0ae90a3cf --- /dev/null +++ b/db/schema_migrations/20220309084838 @@ -0,0 +1 @@ +d9d17f94f54840eace48f210e3886423a8dc04109f2ebca8d8edb7d53e0b5688
\ No newline at end of file diff --git a/db/schema_migrations/20220309084954 b/db/schema_migrations/20220309084954 new file mode 100644 index 00000000000..944a1385fe7 --- /dev/null +++ b/db/schema_migrations/20220309084954 @@ -0,0 +1 @@ +6d9c5454372317955c4e16b5a02dece575221f15af60c33df45fffbca169c08c
\ No newline at end of file diff --git a/db/schema_migrations/20220309100648 b/db/schema_migrations/20220309100648 new file mode 100644 index 00000000000..a0697655d9a --- /dev/null +++ b/db/schema_migrations/20220309100648 @@ -0,0 +1 @@ +3385dc0dc2a3d306e01a719b7a21197ea8468976d37abab932beade4780bb4ff
\ No newline at end of file diff --git a/db/schema_migrations/20220309154855 b/db/schema_migrations/20220309154855 new file mode 100644 index 00000000000..01500ce5863 --- /dev/null +++ b/db/schema_migrations/20220309154855 @@ -0,0 +1 @@ +9e62675366f9c2f0fc159a9748409dbcaea240c813ab19ea26d24c966e5fd6c8
\ No newline at end of file diff --git a/db/schema_migrations/20220310011530 b/db/schema_migrations/20220310011530 new file mode 100644 index 00000000000..73fa8390231 --- /dev/null +++ b/db/schema_migrations/20220310011530 @@ -0,0 +1 @@ +a4245a3543796b48f16786e9c178f70d236b3ae4636661f021ad4e8f0c678f2c
\ No newline at end of file diff --git a/db/schema_migrations/20220310011613 b/db/schema_migrations/20220310011613 new file mode 100644 index 00000000000..fc62a04f551 --- /dev/null +++ b/db/schema_migrations/20220310011613 @@ -0,0 +1 @@ +ef816d9391d67a34121d11e6b6cc37de92768bd21bc301fa10c6652b1a0b66b6
\ No newline at end of file diff --git a/db/schema_migrations/20220310095341 b/db/schema_migrations/20220310095341 new file mode 100644 index 00000000000..d52763cce63 --- /dev/null +++ b/db/schema_migrations/20220310095341 @@ -0,0 +1 @@ +56d906eac31954988bd0659eabbc9f1bad1a47dd616fb99e4b90b56b2bf4c6a0
\ No newline at end of file diff --git a/db/schema_migrations/20220310101118 b/db/schema_migrations/20220310101118 new file mode 100644 index 00000000000..c87f727c8b9 --- /dev/null +++ b/db/schema_migrations/20220310101118 @@ -0,0 +1 @@ +e4d6111f19f05b42b51e8d066e221205460514cef88ecf15ca99aa59788c4153
\ No newline at end of file diff --git a/db/schema_migrations/20220310134207 b/db/schema_migrations/20220310134207 new file mode 100644 index 00000000000..3ba08608acc --- /dev/null +++ b/db/schema_migrations/20220310134207 @@ -0,0 +1 @@ +951abe39e4735f0f71ac6ad1701ffa8688dfd82a59b0383d6c55cef8f6de8e7f
\ No newline at end of file diff --git a/db/schema_migrations/20220310141349 b/db/schema_migrations/20220310141349 new file mode 100644 index 00000000000..d52b2d997a4 --- /dev/null +++ b/db/schema_migrations/20220310141349 @@ -0,0 +1 @@ +39785d4140c7345ddbe62417576381654ce22d505ee5c92a84425f0a3f8e4935
\ No newline at end of file diff --git a/db/schema_migrations/20220311010352 b/db/schema_migrations/20220311010352 new file mode 100644 index 00000000000..f9f4cf28605 --- /dev/null +++ b/db/schema_migrations/20220311010352 @@ -0,0 +1 @@ +1d1682cb14041f14f691fcf880e6446ae464645a5ccbd36687620c3279f53e25
\ No newline at end of file diff --git a/db/schema_migrations/20220314094841 b/db/schema_migrations/20220314094841 new file mode 100644 index 00000000000..f214ecaa9b3 --- /dev/null +++ b/db/schema_migrations/20220314094841 @@ -0,0 +1 @@ +eabdb1e45a67947401963a971f24ae1b19068c72f5d4dd61d7fd47b8e61f1ed2
\ No newline at end of file diff --git a/db/schema_migrations/20220314154235 b/db/schema_migrations/20220314154235 new file mode 100644 index 00000000000..911a5dc9854 --- /dev/null +++ b/db/schema_migrations/20220314154235 @@ -0,0 +1 @@ +b3015220caeb1d21856de8c5026e2db052e98e4fb1c4b4f3a931b8481c2b8240
\ No newline at end of file diff --git a/db/schema_migrations/20220314162342 b/db/schema_migrations/20220314162342 new file mode 100644 index 00000000000..8ee5a80c256 --- /dev/null +++ b/db/schema_migrations/20220314162342 @@ -0,0 +1 @@ +7992448797888fd69d1e5cd4f2602e5a2b49a57052c50b19522f37d711c9f2f2
\ No newline at end of file |