diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 22:00:14 +0300 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /db/init_structure.sql | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'db/init_structure.sql')
-rw-r--r-- | db/init_structure.sql | 2318 |
1 files changed, 2057 insertions, 261 deletions
diff --git a/db/init_structure.sql b/db/init_structure.sql index 913b495b6fd..00f06078426 100644 --- a/db/init_structure.sql +++ b/db/init_structure.sql @@ -41,58 +41,534 @@ RETURN NULL; END $$; -CREATE FUNCTION table_sync_function_2be879775d() RETURNS trigger +CREATE FUNCTION table_sync_function_29bc99d6db() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN IF (TG_OP = 'DELETE') THEN - DELETE FROM audit_events_archived where id = OLD.id; + DELETE FROM web_hook_logs_archived where id = OLD.id; ELSIF (TG_OP = 'UPDATE') THEN - UPDATE audit_events_archived - SET author_id = NEW.author_id, - entity_id = NEW.entity_id, - entity_type = NEW.entity_type, - details = NEW.details, + UPDATE web_hook_logs_archived + SET web_hook_id = NEW.web_hook_id, + trigger = NEW.trigger, + url = NEW.url, + request_headers = NEW.request_headers, + request_data = NEW.request_data, + response_headers = NEW.response_headers, + response_body = NEW.response_body, + response_status = NEW.response_status, + execution_duration = NEW.execution_duration, + internal_error_message = NEW.internal_error_message, created_at = NEW.created_at, - ip_address = NEW.ip_address, - author_name = NEW.author_name, - target_details = NEW.target_details, - entity_path = NEW.entity_path, - target_type = NEW.target_type, - target_id = NEW.target_id - WHERE audit_events_archived.id = NEW.id; + updated_at = NEW.updated_at + WHERE web_hook_logs_archived.id = NEW.id; ELSIF (TG_OP = 'INSERT') THEN - INSERT INTO audit_events_archived (id, - author_id, - entity_id, - entity_type, - details, + INSERT INTO web_hook_logs_archived (id, + web_hook_id, + trigger, + url, + request_headers, + request_data, + response_headers, + response_body, + response_status, + execution_duration, + internal_error_message, created_at, - ip_address, - author_name, - target_details, - entity_path, - target_type, - target_id) + updated_at) VALUES (NEW.id, - NEW.author_id, - NEW.entity_id, - NEW.entity_type, - NEW.details, + NEW.web_hook_id, + NEW.trigger, + NEW.url, + NEW.request_headers, + NEW.request_data, + NEW.response_headers, + NEW.response_body, + NEW.response_status, + NEW.execution_duration, + NEW.internal_error_message, NEW.created_at, - NEW.ip_address, - NEW.author_name, - NEW.target_details, - NEW.entity_path, - NEW.target_type, - NEW.target_id); + NEW.updated_at); END IF; RETURN NULL; END $$; -COMMENT ON FUNCTION table_sync_function_2be879775d() IS 'Partitioning migration: table sync for audit_events table'; +COMMENT ON FUNCTION table_sync_function_29bc99d6db() IS 'Partitioning migration: table sync for web_hook_logs table'; + +CREATE FUNCTION trigger_07c94931164e() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."event_id_convert_to_bigint" := NEW."event_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_21e7a2602957() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_3f6129be01d2() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."id_convert_to_bigint" := NEW."id"; + NEW."stage_id_convert_to_bigint" := NEW."stage_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_51ab7cef8934() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_69523443cc10() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."id_convert_to_bigint" := NEW."id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_77f5e1d20482() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."deployable_id_convert_to_bigint" := NEW."deployable_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_8485e97c00e3() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."source_job_id_convert_to_bigint" := NEW."source_job_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_8487d4de3e7b() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_91dc388a5fe6() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_aebe8b822ad3() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."id_convert_to_bigint" := NEW."id"; + NEW."taggable_id_convert_to_bigint" := NEW."taggable_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_be1804f21693() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."id_convert_to_bigint" := NEW."id"; + NEW."job_id_convert_to_bigint" := NEW."job_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_cf2f9e35f002() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."build_id_convert_to_bigint" := NEW."build_id"; + RETURN NEW; +END; +$$; + +CREATE FUNCTION trigger_f1ca8ec18d78() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN + NEW."job_artifact_id_convert_to_bigint" := NEW."job_artifact_id"; + RETURN NEW; +END; +$$; + +CREATE TABLE audit_events ( + id bigint NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +) +PARTITION BY RANGE (created_at); + +CREATE SEQUENCE audit_events_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE audit_events_id_seq OWNED BY audit_events.id; + +CREATE TABLE gitlab_partitions_dynamic.audit_events_000000 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000 FOR VALUES FROM (MINVALUE) TO ('2022-12-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202212 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212 FOR VALUES FROM ('2022-12-01 00:00:00') TO ('2023-01-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202301 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301 FOR VALUES FROM ('2023-01-01 00:00:00') TO ('2023-02-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202302 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302 FOR VALUES FROM ('2023-02-01 00:00:00') TO ('2023-03-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202303 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303 FOR VALUES FROM ('2023-03-01 00:00:00') TO ('2023-04-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202304 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304 FOR VALUES FROM ('2023-04-01 00:00:00') TO ('2023-05-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202305 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305 FOR VALUES FROM ('2023-05-01 00:00:00') TO ('2023-06-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.audit_events_202306 ( + id bigint DEFAULT nextval('audit_events_id_seq'::regclass) NOT NULL, + author_id integer NOT NULL, + entity_id integer NOT NULL, + entity_type character varying NOT NULL, + details text, + ip_address inet, + author_name text, + target_details text, + entity_path text, + created_at timestamp without time zone NOT NULL, + target_type text, + target_id bigint, + CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), + CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), + CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)), + CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) +); +ALTER TABLE ONLY audit_events ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00'); + +CREATE TABLE web_hook_logs ( + id bigint NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +) +PARTITION BY RANGE (created_at); + +CREATE SEQUENCE web_hook_logs_id_seq + AS integer + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE web_hook_logs_id_seq OWNED BY web_hook_logs.id; + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_000000 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_000000 FOR VALUES FROM (MINVALUE) TO ('2022-12-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202212 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202212 FOR VALUES FROM ('2022-12-01 00:00:00') TO ('2023-01-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202301 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202301 FOR VALUES FROM ('2023-01-01 00:00:00') TO ('2023-02-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202302 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302 FOR VALUES FROM ('2023-02-01 00:00:00') TO ('2023-03-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202303 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303 FOR VALUES FROM ('2023-03-01 00:00:00') TO ('2023-04-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202304 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304 FOR VALUES FROM ('2023-04-01 00:00:00') TO ('2023-05-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202305 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305 FOR VALUES FROM ('2023-05-01 00:00:00') TO ('2023-06-01 00:00:00'); + +CREATE TABLE gitlab_partitions_dynamic.web_hook_logs_202306 ( + id bigint DEFAULT nextval('web_hook_logs_id_seq'::regclass) NOT NULL, + web_hook_id integer NOT NULL, + trigger character varying, + url character varying, + request_headers text, + request_data text, + response_headers text, + response_body text, + response_status character varying, + execution_duration double precision, + internal_error_message character varying, + updated_at timestamp without time zone NOT NULL, + created_at timestamp without time zone NOT NULL +); +ALTER TABLE ONLY web_hook_logs ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306 FOR VALUES FROM ('2023-06-01 00:00:00') TO ('2023-07-01 00:00:00'); CREATE TABLE product_analytics_events_experimental ( id bigint NOT NULL, @@ -8938,7 +9414,8 @@ CREATE TABLE analytics_cycle_analytics_project_stages ( end_event_label_id bigint, hidden boolean DEFAULT false NOT NULL, custom boolean DEFAULT true NOT NULL, - name character varying(255) NOT NULL + name character varying(255) NOT NULL, + project_value_stream_id bigint NOT NULL ); CREATE SEQUENCE analytics_cycle_analytics_project_stages_id_seq @@ -8950,33 +9427,31 @@ CREATE SEQUENCE analytics_cycle_analytics_project_stages_id_seq ALTER SEQUENCE analytics_cycle_analytics_project_stages_id_seq OWNED BY analytics_cycle_analytics_project_stages.id; -CREATE TABLE analytics_devops_adoption_segment_selections ( +CREATE TABLE analytics_cycle_analytics_project_value_streams ( id bigint NOT NULL, - segment_id bigint NOT NULL, - group_id bigint, - project_id bigint, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - CONSTRAINT segment_selection_project_id_or_group_id_required CHECK ((((project_id <> NULL::bigint) AND (group_id IS NULL)) OR ((group_id <> NULL::bigint) AND (project_id IS NULL)))) + project_id bigint NOT NULL, + name text NOT NULL, + CONSTRAINT check_9b1970a898 CHECK ((char_length(name) <= 100)) ); -CREATE SEQUENCE analytics_devops_adoption_segment_selections_id_seq +CREATE SEQUENCE analytics_cycle_analytics_project_value_streams_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -ALTER SEQUENCE analytics_devops_adoption_segment_selections_id_seq OWNED BY analytics_devops_adoption_segment_selections.id; +ALTER SEQUENCE analytics_cycle_analytics_project_value_streams_id_seq OWNED BY analytics_cycle_analytics_project_value_streams.id; CREATE TABLE analytics_devops_adoption_segments ( id bigint NOT NULL, - name text, last_recorded_at timestamp with time zone, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, namespace_id integer, - CONSTRAINT check_4be7a006fd CHECK ((char_length(name) <= 255)) + display_namespace_id integer ); CREATE SEQUENCE analytics_devops_adoption_segments_id_seq @@ -8990,7 +9465,7 @@ ALTER SEQUENCE analytics_devops_adoption_segments_id_seq OWNED BY analytics_devo CREATE TABLE analytics_devops_adoption_snapshots ( id bigint NOT NULL, - segment_id bigint NOT NULL, + segment_id bigint, recorded_at timestamp with time zone NOT NULL, issue_opened boolean NOT NULL, merge_request_opened boolean NOT NULL, @@ -8999,7 +9474,11 @@ CREATE TABLE analytics_devops_adoption_snapshots ( pipeline_succeeded boolean NOT NULL, deploy_succeeded boolean NOT NULL, security_scan_succeeded boolean NOT NULL, - end_time timestamp with time zone NOT NULL + end_time timestamp with time zone NOT NULL, + total_projects_count integer, + code_owners_used_count integer, + namespace_id integer, + CONSTRAINT check_3f472de131 CHECK ((namespace_id IS NOT NULL)) ); CREATE SEQUENCE analytics_devops_adoption_snapshots_id_seq @@ -9011,31 +9490,31 @@ CREATE SEQUENCE analytics_devops_adoption_snapshots_id_seq ALTER SEQUENCE analytics_devops_adoption_snapshots_id_seq OWNED BY analytics_devops_adoption_snapshots.id; -CREATE TABLE analytics_instance_statistics_measurements ( +CREATE TABLE analytics_language_trend_repository_languages ( + file_count integer DEFAULT 0 NOT NULL, + programming_language_id bigint NOT NULL, + project_id bigint NOT NULL, + loc integer DEFAULT 0 NOT NULL, + bytes integer DEFAULT 0 NOT NULL, + percentage smallint DEFAULT 0 NOT NULL, + snapshot_date date NOT NULL +); + +CREATE TABLE analytics_usage_trends_measurements ( id bigint NOT NULL, count bigint NOT NULL, recorded_at timestamp with time zone NOT NULL, identifier smallint NOT NULL ); -CREATE SEQUENCE analytics_instance_statistics_measurements_id_seq +CREATE SEQUENCE analytics_usage_trends_measurements_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -ALTER SEQUENCE analytics_instance_statistics_measurements_id_seq OWNED BY analytics_instance_statistics_measurements.id; - -CREATE TABLE analytics_language_trend_repository_languages ( - file_count integer DEFAULT 0 NOT NULL, - programming_language_id bigint NOT NULL, - project_id bigint NOT NULL, - loc integer DEFAULT 0 NOT NULL, - bytes integer DEFAULT 0 NOT NULL, - percentage smallint DEFAULT 0 NOT NULL, - snapshot_date date NOT NULL -); +ALTER SEQUENCE analytics_usage_trends_measurements_id_seq OWNED BY analytics_usage_trends_measurements.id; CREATE TABLE appearances ( id integer NOT NULL, @@ -9377,13 +9856,38 @@ CREATE TABLE application_settings ( invisible_captcha_enabled boolean DEFAULT false NOT NULL, rate_limiting_response_text text, keep_latest_artifact boolean DEFAULT true NOT NULL, - enforce_ssh_key_expiration boolean DEFAULT false NOT NULL, + enforce_ssh_key_expiration boolean DEFAULT true NOT NULL, git_two_factor_session_expiry integer DEFAULT 15 NOT NULL, notes_create_limit integer DEFAULT 300 NOT NULL, notes_create_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL, in_product_marketing_emails_enabled boolean DEFAULT true NOT NULL, asset_proxy_whitelist text, + delayed_project_removal boolean DEFAULT false NOT NULL, + lock_delayed_project_removal boolean DEFAULT false NOT NULL, + admin_mode boolean DEFAULT false NOT NULL, + throttle_unauthenticated_packages_api_requests_per_period integer DEFAULT 800 NOT NULL, + throttle_unauthenticated_packages_api_period_in_seconds integer DEFAULT 15 NOT NULL, + throttle_authenticated_packages_api_requests_per_period integer DEFAULT 1000 NOT NULL, + throttle_authenticated_packages_api_period_in_seconds integer DEFAULT 15 NOT NULL, + throttle_unauthenticated_packages_api_enabled boolean DEFAULT false NOT NULL, + throttle_authenticated_packages_api_enabled boolean DEFAULT false NOT NULL, + valid_runner_registrars character varying[] DEFAULT '{project,group}'::character varying[], + whats_new_variant smallint DEFAULT 0, + external_pipeline_validation_service_timeout integer, + encrypted_external_pipeline_validation_service_token text, + encrypted_external_pipeline_validation_service_token_iv text, + external_pipeline_validation_service_url text, + deactivate_dormant_users boolean DEFAULT false NOT NULL, + encrypted_spam_check_api_key bytea, + encrypted_spam_check_api_key_iv bytea, + elasticsearch_username text, + encrypted_elasticsearch_password bytea, + encrypted_elasticsearch_password_iv bytea, + floc_enabled boolean DEFAULT false NOT NULL, + diff_max_lines integer DEFAULT 50000 NOT NULL, + diff_max_files integer DEFAULT 1000 NOT NULL, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), + CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)), CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)), CONSTRAINT check_17d9558205 CHECK ((char_length(kroki_url) <= 1024)), CONSTRAINT check_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)), @@ -9398,6 +9902,7 @@ CREATE TABLE application_settings ( CONSTRAINT check_b4f67a6296 CHECK ((allow_local_requests_from_web_hooks_and_services IS NOT NULL)), CONSTRAINT check_d03919528d CHECK ((char_length(container_registry_vendor) <= 255)), CONSTRAINT check_d820146492 CHECK ((char_length(spam_check_endpoint_url) <= 255)), + CONSTRAINT check_e5024c8801 CHECK ((char_length(elasticsearch_username) <= 255)), CONSTRAINT check_e5aba18f02 CHECK ((char_length(container_registry_version) <= 255)), CONSTRAINT check_ef6176834f CHECK ((char_length(encrypted_cloud_license_auth_token_iv) <= 255)) ); @@ -9631,53 +10136,6 @@ CREATE SEQUENCE atlassian_identities_user_id_seq ALTER SEQUENCE atlassian_identities_user_id_seq OWNED BY atlassian_identities.user_id; -CREATE TABLE audit_events ( - id bigint NOT NULL, - author_id integer NOT NULL, - entity_id integer NOT NULL, - entity_type character varying NOT NULL, - details text, - ip_address inet, - author_name text, - target_details text, - entity_path text, - created_at timestamp without time zone NOT NULL, - target_type text, - target_id bigint, - CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), - CONSTRAINT check_97a8c868e7 CHECK ((char_length(target_type) <= 255)) -) -PARTITION BY RANGE (created_at); - -CREATE TABLE audit_events_archived ( - id integer NOT NULL, - author_id integer NOT NULL, - entity_id integer NOT NULL, - entity_type character varying NOT NULL, - details text, - created_at timestamp without time zone, - ip_address inet, - author_name text, - target_details text, - entity_path text, - target_type text, - target_id bigint, - CONSTRAINT check_492aaa021d CHECK ((char_length(entity_path) <= 5500)), - CONSTRAINT check_82294106dd CHECK ((char_length(target_type) <= 255)), - CONSTRAINT check_83ff8406e2 CHECK ((char_length(author_name) <= 255)), - CONSTRAINT check_d493ec90b5 CHECK ((char_length(target_details) <= 5500)) -); - -CREATE SEQUENCE audit_events_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE audit_events_id_seq OWNED BY audit_events.id; - CREATE TABLE authentication_events ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -9782,7 +10240,9 @@ CREATE TABLE batched_background_migration_jobs ( batch_size integer NOT NULL, sub_batch_size integer NOT NULL, status smallint DEFAULT 0 NOT NULL, - attempts smallint DEFAULT 0 NOT NULL + attempts smallint DEFAULT 0 NOT NULL, + metrics jsonb DEFAULT '{}'::jsonb NOT NULL, + pause_ms integer DEFAULT 100 NOT NULL ); CREATE SEQUENCE batched_background_migration_jobs_id_seq @@ -9805,10 +10265,12 @@ CREATE TABLE batched_background_migrations ( "interval" smallint NOT NULL, status smallint DEFAULT 0 NOT NULL, job_class_name text NOT NULL, - batch_class_name text DEFAULT 'Gitlab::Database::BackgroundMigration::PrimaryKeyBatchingStrategy'::text NOT NULL, + batch_class_name text DEFAULT 'PrimaryKeyBatchingStrategy'::text NOT NULL, table_name text NOT NULL, column_name text NOT NULL, job_arguments jsonb DEFAULT '"[]"'::jsonb NOT NULL, + total_tuple_count bigint, + pause_ms integer DEFAULT 100 NOT NULL, 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)), @@ -9961,6 +10423,24 @@ CREATE SEQUENCE boards_epic_board_positions_id_seq ALTER SEQUENCE boards_epic_board_positions_id_seq OWNED BY boards_epic_board_positions.id; +CREATE TABLE boards_epic_board_recent_visits ( + id bigint NOT NULL, + user_id bigint NOT NULL, + epic_board_id bigint NOT NULL, + group_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE boards_epic_board_recent_visits_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE boards_epic_board_recent_visits_id_seq OWNED BY boards_epic_board_recent_visits.id; + CREATE TABLE boards_epic_boards ( id bigint NOT NULL, hide_backlog_list boolean DEFAULT false NOT NULL, @@ -10121,6 +10601,47 @@ CREATE SEQUENCE bulk_import_entities_id_seq ALTER SEQUENCE bulk_import_entities_id_seq OWNED BY bulk_import_entities.id; +CREATE TABLE bulk_import_export_uploads ( + id bigint NOT NULL, + export_id bigint NOT NULL, + updated_at timestamp with time zone NOT NULL, + export_file text, + CONSTRAINT check_5add76239d CHECK ((char_length(export_file) <= 255)) +); + +CREATE SEQUENCE bulk_import_export_uploads_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE bulk_import_export_uploads_id_seq OWNED BY bulk_import_export_uploads.id; + +CREATE TABLE bulk_import_exports ( + id bigint NOT NULL, + group_id bigint, + project_id bigint, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + status smallint DEFAULT 0 NOT NULL, + relation text NOT NULL, + jid text, + error text, + CONSTRAINT check_24cb010672 CHECK ((char_length(relation) <= 255)), + CONSTRAINT check_8f0f357334 CHECK ((char_length(error) <= 255)), + CONSTRAINT check_9ee6d14d33 CHECK ((char_length(jid) <= 255)) +); + +CREATE SEQUENCE bulk_import_exports_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE bulk_import_exports_id_seq OWNED BY bulk_import_exports.id; + CREATE TABLE bulk_import_failures ( id bigint NOT NULL, bulk_import_entity_id bigint NOT NULL, @@ -10152,8 +10673,12 @@ CREATE TABLE bulk_import_trackers ( relation text NOT NULL, next_page text, has_next_page boolean DEFAULT false NOT NULL, + jid text, + stage smallint DEFAULT 0 NOT NULL, + status smallint DEFAULT 0 NOT NULL, CONSTRAINT check_2d45cae629 CHECK ((char_length(relation) <= 255)), CONSTRAINT check_40aeaa600b CHECK ((char_length(next_page) <= 255)), + CONSTRAINT check_603f91cb06 CHECK ((char_length(jid) <= 255)), CONSTRAINT check_next_page_requirement CHECK (((has_next_page IS FALSE) OR (next_page IS NOT NULL))) ); @@ -10231,7 +10756,8 @@ CREATE TABLE ci_build_needs ( build_id integer NOT NULL, name text NOT NULL, artifacts boolean DEFAULT true NOT NULL, - optional boolean DEFAULT false NOT NULL + optional boolean DEFAULT false NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_build_needs_id_seq @@ -10286,7 +10812,8 @@ CREATE TABLE ci_build_trace_chunks ( data_store integer NOT NULL, raw_data bytea, checksum bytea, - lock_version integer DEFAULT 0 NOT NULL + lock_version integer DEFAULT 0 NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_build_trace_chunks_id_seq @@ -10321,7 +10848,8 @@ CREATE TABLE ci_build_trace_sections ( byte_start bigint NOT NULL, byte_end bigint NOT NULL, build_id integer NOT NULL, - section_name_id integer NOT NULL + section_name_id integer NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE TABLE ci_builds ( @@ -10369,7 +10897,9 @@ CREATE TABLE ci_builds ( processed boolean, resource_group_id bigint, waiting_for_resource_at timestamp with time zone, - scheduling_type smallint + scheduling_type smallint, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + stage_id_convert_to_bigint bigint ); CREATE SEQUENCE ci_builds_id_seq @@ -10394,7 +10924,8 @@ CREATE TABLE ci_builds_metadata ( has_exposed_artifacts boolean, environment_auto_stop_in character varying(255), expanded_environment_name character varying(255), - secrets jsonb DEFAULT '{}'::jsonb NOT NULL + secrets jsonb DEFAULT '{}'::jsonb NOT NULL, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_builds_metadata_id_seq @@ -10412,7 +10943,8 @@ CREATE TABLE ci_builds_runner_session ( build_id integer NOT NULL, url character varying NOT NULL, certificate character varying, - "authorization" character varying + "authorization" character varying, + build_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_builds_runner_session_id_seq @@ -10498,7 +11030,8 @@ CREATE TABLE ci_group_variables ( updated_at timestamp with time zone NOT NULL, masked boolean DEFAULT false NOT NULL, variable_type smallint DEFAULT 1 NOT NULL, - environment_scope text DEFAULT '*'::text NOT NULL + environment_scope text DEFAULT '*'::text NOT NULL, + CONSTRAINT check_dfe009485a CHECK ((char_length(environment_scope) <= 255)) ); CREATE SEQUENCE ci_group_variables_id_seq @@ -10547,6 +11080,8 @@ CREATE TABLE ci_job_artifacts ( file_sha256 bytea, file_format smallint, file_location smallint, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + job_id_convert_to_bigint bigint DEFAULT 0 NOT NULL, CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)) ); @@ -10560,6 +11095,23 @@ CREATE SEQUENCE ci_job_artifacts_id_seq ALTER SEQUENCE ci_job_artifacts_id_seq OWNED BY ci_job_artifacts.id; +CREATE TABLE ci_job_token_project_scope_links ( + id bigint NOT NULL, + source_project_id bigint NOT NULL, + target_project_id bigint NOT NULL, + added_by_id bigint, + created_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE ci_job_token_project_scope_links_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_job_token_project_scope_links_id_seq OWNED BY ci_job_token_project_scope_links.id; + CREATE TABLE ci_job_variables ( id bigint NOT NULL, key character varying NOT NULL, @@ -10579,6 +11131,26 @@ CREATE SEQUENCE ci_job_variables_id_seq ALTER SEQUENCE ci_job_variables_id_seq OWNED BY ci_job_variables.id; +CREATE TABLE ci_minutes_additional_packs ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + namespace_id bigint NOT NULL, + expires_at date, + number_of_minutes integer NOT NULL, + purchase_xid text, + CONSTRAINT check_d7ef254af0 CHECK ((char_length(purchase_xid) <= 32)) +); + +CREATE SEQUENCE ci_minutes_additional_packs_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_minutes_additional_packs_id_seq OWNED BY ci_minutes_additional_packs.id; + CREATE TABLE ci_namespace_monthly_usages ( id bigint NOT NULL, namespace_id bigint NOT NULL, @@ -10597,6 +11169,22 @@ CREATE SEQUENCE ci_namespace_monthly_usages_id_seq ALTER SEQUENCE ci_namespace_monthly_usages_id_seq OWNED BY ci_namespace_monthly_usages.id; +CREATE TABLE ci_pending_builds ( + id bigint NOT NULL, + build_id bigint NOT NULL, + project_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL +); + +CREATE SEQUENCE ci_pending_builds_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_pending_builds_id_seq OWNED BY ci_pending_builds.id; + CREATE TABLE ci_pipeline_artifacts ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -10609,8 +11197,16 @@ CREATE TABLE ci_pipeline_artifacts ( file_format smallint NOT NULL, file text, expire_at timestamp with time zone, + verification_started_at timestamp with time zone, + verification_retry_at timestamp with time zone, + verified_at timestamp with time zone, + verification_state smallint DEFAULT 0 NOT NULL, + verification_retry_count smallint, + verification_checksum bytea, + verification_failure text, CONSTRAINT check_191b5850ec CHECK ((char_length(file) <= 255)), - CONSTRAINT check_abeeb71caf CHECK ((file IS NOT NULL)) + CONSTRAINT check_abeeb71caf CHECK ((file IS NOT NULL)), + CONSTRAINT ci_pipeline_artifacts_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255)) ); CREATE SEQUENCE ci_pipeline_artifacts_id_seq @@ -10920,7 +11516,8 @@ CREATE TABLE ci_runners ( runner_type smallint NOT NULL, 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 + private_projects_minutes_cost_factor double precision DEFAULT 1.0 NOT NULL, + config jsonb DEFAULT '{}'::jsonb NOT NULL ); CREATE SEQUENCE ci_runners_id_seq @@ -10933,13 +11530,32 @@ CREATE SEQUENCE ci_runners_id_seq ALTER SEQUENCE ci_runners_id_seq OWNED BY ci_runners.id; +CREATE TABLE ci_running_builds ( + id bigint NOT NULL, + build_id bigint NOT NULL, + project_id bigint NOT NULL, + runner_id bigint NOT NULL, + created_at timestamp with time zone DEFAULT now() NOT NULL, + runner_type smallint NOT NULL +); + +CREATE SEQUENCE ci_running_builds_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_running_builds_id_seq OWNED BY ci_running_builds.id; + CREATE TABLE ci_sources_pipelines ( id integer NOT NULL, project_id integer, pipeline_id integer, source_project_id integer, source_job_id integer, - source_pipeline_id integer + source_pipeline_id integer, + source_job_id_convert_to_bigint bigint ); CREATE SEQUENCE ci_sources_pipelines_id_seq @@ -11076,6 +11692,42 @@ CREATE SEQUENCE ci_triggers_id_seq ALTER SEQUENCE ci_triggers_id_seq OWNED BY ci_triggers.id; +CREATE TABLE ci_unit_test_failures ( + id bigint NOT NULL, + failed_at timestamp with time zone NOT NULL, + unit_test_id bigint NOT NULL, + build_id bigint NOT NULL +); + +CREATE SEQUENCE ci_unit_test_failures_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_unit_test_failures_id_seq OWNED BY ci_unit_test_failures.id; + +CREATE TABLE ci_unit_tests ( + id bigint NOT NULL, + project_id bigint NOT NULL, + key_hash text NOT NULL, + name text NOT NULL, + suite_name text NOT NULL, + CONSTRAINT check_248fae1a3b CHECK ((char_length(name) <= 255)), + CONSTRAINT check_b288215ffe CHECK ((char_length(key_hash) <= 64)), + CONSTRAINT check_c2d57b3c49 CHECK ((char_length(suite_name) <= 255)) +); + +CREATE SEQUENCE ci_unit_tests_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_unit_tests_id_seq OWNED BY ci_unit_tests.id; + CREATE TABLE ci_variables ( id integer NOT NULL, key character varying NOT NULL, @@ -11109,6 +11761,8 @@ CREATE TABLE cluster_agent_tokens ( created_by_user_id bigint, description text, name text, + last_used_at timestamp with time zone, + CONSTRAINT check_0fb634d04d CHECK ((name IS NOT NULL)), CONSTRAINT check_2b79dbb315 CHECK ((char_length(name) <= 255)), CONSTRAINT check_4e4ec5070a CHECK ((char_length(description) <= 1024)), CONSTRAINT check_c60daed227 CHECK ((char_length(token_encrypted) <= 255)) @@ -11535,6 +12189,24 @@ CREATE SEQUENCE clusters_id_seq ALTER SEQUENCE clusters_id_seq OWNED BY clusters.id; +CREATE TABLE clusters_integration_elasticstack ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + cluster_id bigint NOT NULL, + enabled boolean DEFAULT false NOT NULL, + chart_version text, + CONSTRAINT check_f8d671ce04 CHECK ((char_length(chart_version) <= 10)) +); + +CREATE TABLE clusters_integration_prometheus ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + cluster_id bigint NOT NULL, + enabled boolean DEFAULT false NOT NULL, + encrypted_alert_manager_token text, + encrypted_alert_manager_token_iv text +); + CREATE TABLE clusters_kubernetes_namespaces ( id bigint NOT NULL, cluster_id integer NOT NULL, @@ -11747,6 +12419,13 @@ CREATE SEQUENCE dast_profiles_id_seq ALTER SEQUENCE dast_profiles_id_seq OWNED BY dast_profiles.id; +CREATE TABLE dast_profiles_pipelines ( + dast_profile_id bigint NOT NULL, + ci_pipeline_id bigint NOT NULL +); + +COMMENT ON TABLE dast_profiles_pipelines IS '{"owner":"group::dynamic analysis","description":"Join table between DAST Profiles and CI Pipelines"}'; + CREATE TABLE dast_scanner_profiles ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -11770,6 +12449,31 @@ CREATE SEQUENCE dast_scanner_profiles_id_seq ALTER SEQUENCE dast_scanner_profiles_id_seq OWNED BY dast_scanner_profiles.id; +CREATE TABLE dast_site_profile_secret_variables ( + id bigint NOT NULL, + dast_site_profile_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + variable_type smallint DEFAULT 1 NOT NULL, + key text NOT NULL, + encrypted_value bytea NOT NULL, + encrypted_value_iv bytea NOT NULL, + CONSTRAINT check_236213f179 CHECK ((length(encrypted_value) <= 13352)), + CONSTRAINT check_8cbef204b2 CHECK ((char_length(key) <= 255)), + CONSTRAINT check_b49080abbf CHECK ((length(encrypted_value_iv) <= 17)) +); + +COMMENT ON TABLE dast_site_profile_secret_variables IS '{"owner":"group::dynamic analysis","description":"Secret variables used in DAST on-demand scans"}'; + +CREATE SEQUENCE dast_site_profile_secret_variables_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE dast_site_profile_secret_variables_id_seq OWNED BY dast_site_profile_secret_variables.id; + CREATE TABLE dast_site_profiles ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -11777,7 +12481,18 @@ CREATE TABLE dast_site_profiles ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, name text NOT NULL, - CONSTRAINT check_6cfab17b48 CHECK ((char_length(name) <= 255)) + excluded_urls text[] DEFAULT '{}'::text[] NOT NULL, + auth_enabled boolean DEFAULT false NOT NULL, + auth_url text, + auth_username_field text, + auth_password_field text, + auth_username text, + target_type smallint DEFAULT 0 NOT NULL, + 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)), + CONSTRAINT check_d446f7047b CHECK ((char_length(auth_url) <= 1024)), + CONSTRAINT check_f22f18002a CHECK ((char_length(auth_username) <= 255)) ); CREATE SEQUENCE dast_site_profiles_id_seq @@ -11789,6 +12504,13 @@ CREATE SEQUENCE dast_site_profiles_id_seq ALTER SEQUENCE dast_site_profiles_id_seq OWNED BY dast_site_profiles.id; +CREATE TABLE dast_site_profiles_pipelines ( + dast_site_profile_id bigint NOT NULL, + ci_pipeline_id bigint NOT NULL +); + +COMMENT ON TABLE dast_site_profiles_pipelines IS '{"owner":"group::dynamic analysis","description":"Join table between DAST Site Profiles and CI Pipelines"}'; + CREATE TABLE dast_site_tokens ( id bigint NOT NULL, project_id bigint NOT NULL, @@ -11995,7 +12717,8 @@ CREATE TABLE deployments ( on_stop character varying, finished_at timestamp with time zone, status smallint NOT NULL, - cluster_id integer + cluster_id integer, + deployable_id_convert_to_bigint bigint ); CREATE SEQUENCE deployments_id_seq @@ -12165,13 +12888,53 @@ CREATE SEQUENCE draft_notes_id_seq ALTER SEQUENCE draft_notes_id_seq OWNED BY draft_notes.id; +CREATE TABLE elastic_index_settings ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + number_of_replicas smallint DEFAULT 1 NOT NULL, + number_of_shards smallint DEFAULT 5 NOT NULL, + alias_name text NOT NULL, + CONSTRAINT check_c30005c325 CHECK ((char_length(alias_name) <= 255)) +); + +CREATE SEQUENCE elastic_index_settings_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE elastic_index_settings_id_seq OWNED BY elastic_index_settings.id; + +CREATE TABLE elastic_reindexing_slices ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + elastic_reindexing_subtask_id bigint NOT NULL, + elastic_slice smallint DEFAULT 0 NOT NULL, + elastic_max_slice smallint DEFAULT 0 NOT NULL, + retry_attempt smallint DEFAULT 0 NOT NULL, + elastic_task text, + CONSTRAINT check_ca30e1396e CHECK ((char_length(elastic_task) <= 255)) +); + +CREATE SEQUENCE elastic_reindexing_slices_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE elastic_reindexing_slices_id_seq OWNED BY elastic_reindexing_slices.id; + CREATE TABLE elastic_reindexing_subtasks ( id bigint NOT NULL, elastic_reindexing_task_id bigint NOT NULL, alias_name text NOT NULL, index_name_from text NOT NULL, index_name_to text NOT NULL, - elastic_task text NOT NULL, + elastic_task text, documents_count_target integer, documents_count integer, created_at timestamp with time zone NOT NULL, @@ -12204,6 +12967,8 @@ CREATE TABLE elastic_reindexing_tasks ( error_message text, documents_count_target integer, delete_original_index_at timestamp with time zone, + max_slices_running smallint DEFAULT 60 NOT NULL, + slice_multiplier smallint DEFAULT 2 NOT NULL, CONSTRAINT check_04151aca42 CHECK ((char_length(index_name_from) <= 255)), CONSTRAINT check_7f64acda8e CHECK ((char_length(error_message) <= 255)), CONSTRAINT check_85ebff7124 CHECK ((char_length(index_name_to) <= 255)), @@ -12387,6 +13152,7 @@ CREATE TABLE events ( target_type character varying, group_id bigint, fingerprint bytea, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, CONSTRAINT check_97e06e05ad CHECK ((octet_length(fingerprint) <= 128)) ); @@ -12422,14 +13188,14 @@ CREATE TABLE experiment_subjects ( id bigint NOT NULL, experiment_id bigint NOT NULL, user_id bigint, - group_id bigint, project_id bigint, variant smallint DEFAULT 0 NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, converted_at timestamp with time zone, context jsonb DEFAULT '{}'::jsonb NOT NULL, - CONSTRAINT chk_has_one_subject CHECK ((num_nonnulls(user_id, group_id, project_id) = 1)) + namespace_id bigint, + CONSTRAINT check_f6411bc4b5 CHECK ((num_nonnulls(user_id, namespace_id, project_id) = 1)) ); CREATE SEQUENCE experiment_subjects_id_seq @@ -12719,7 +13485,8 @@ ALTER SEQUENCE geo_hashed_storage_migrated_events_id_seq OWNED BY geo_hashed_sto CREATE TABLE geo_job_artifact_deleted_events ( id bigint NOT NULL, job_artifact_id integer NOT NULL, - file_path character varying NOT NULL + file_path character varying NOT NULL, + job_artifact_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE geo_job_artifact_deleted_events_id_seq @@ -13006,7 +13773,8 @@ CREATE TABLE gitlab_subscription_histories ( gitlab_subscription_id bigint NOT NULL, created_at timestamp with time zone, trial_starts_on date, - auto_renew boolean + auto_renew boolean, + trial_extension_type smallint ); CREATE SEQUENCE gitlab_subscription_histories_id_seq @@ -13033,7 +13801,9 @@ CREATE TABLE gitlab_subscriptions ( trial_starts_on date, auto_renew boolean, seats_in_use integer DEFAULT 0 NOT NULL, - seats_owed integer DEFAULT 0 NOT NULL + seats_owed integer DEFAULT 0 NOT NULL, + trial_extension_type smallint, + CONSTRAINT check_77fea3f0e7 CHECK ((namespace_id IS NOT NULL)) ); CREATE SEQUENCE gitlab_subscriptions_id_seq @@ -13255,7 +14025,11 @@ CREATE TABLE group_merge_request_approval_settings ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, group_id bigint NOT NULL, - allow_author_approval boolean DEFAULT false NOT NULL + allow_author_approval boolean DEFAULT false NOT NULL, + allow_committer_approval boolean DEFAULT false NOT NULL, + allow_overrides_to_approver_list_per_merge_request boolean DEFAULT false NOT NULL, + retain_approvals_on_push boolean DEFAULT false NOT NULL, + require_password_to_approve boolean DEFAULT false NOT NULL ); CREATE TABLE group_repository_storage_moves ( @@ -13333,7 +14107,9 @@ CREATE TABLE import_export_uploads ( project_id integer, import_file text, export_file text, - group_id bigint + group_id bigint, + remote_import_url text, + CONSTRAINT check_58f0d37481 CHECK ((char_length(remote_import_url) <= 512)) ); CREATE SEQUENCE import_export_uploads_id_seq @@ -13369,6 +14145,60 @@ CREATE SEQUENCE import_failures_id_seq ALTER SEQUENCE import_failures_id_seq OWNED BY import_failures.id; +CREATE TABLE in_product_marketing_emails ( + id bigint NOT NULL, + user_id bigint NOT NULL, + cta_clicked_at timestamp with time zone, + track smallint NOT NULL, + series smallint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE in_product_marketing_emails_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE in_product_marketing_emails_id_seq OWNED BY in_product_marketing_emails.id; + +CREATE TABLE incident_management_escalation_policies ( + id bigint NOT NULL, + project_id bigint NOT NULL, + name text NOT NULL, + description text, + CONSTRAINT check_510b2a5258 CHECK ((char_length(description) <= 160)), + CONSTRAINT check_9a26365850 CHECK ((char_length(name) <= 72)) +); + +CREATE SEQUENCE incident_management_escalation_policies_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE incident_management_escalation_policies_id_seq OWNED BY incident_management_escalation_policies.id; + +CREATE TABLE incident_management_escalation_rules ( + id bigint NOT NULL, + policy_id bigint NOT NULL, + oncall_schedule_id bigint NOT NULL, + status smallint NOT NULL, + elapsed_time_seconds integer NOT NULL +); + +CREATE SEQUENCE incident_management_escalation_rules_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE incident_management_escalation_rules_id_seq OWNED BY incident_management_escalation_rules.id; + CREATE TABLE incident_management_oncall_participants ( id bigint NOT NULL, oncall_rotation_id bigint NOT NULL, @@ -13747,6 +14577,9 @@ CREATE TABLE iterations_cadences ( active boolean DEFAULT true NOT NULL, automatic boolean DEFAULT true NOT NULL, title text NOT NULL, + roll_over boolean DEFAULT false NOT NULL, + description text, + CONSTRAINT check_5c5d2b44bd CHECK ((char_length(description) <= 5000)), CONSTRAINT check_fedff82d3b CHECK ((char_length(title) <= 255)) ); @@ -13764,7 +14597,9 @@ CREATE TABLE jira_connect_installations ( client_key character varying, encrypted_shared_secret character varying, encrypted_shared_secret_iv character varying, - base_url character varying + base_url character varying, + instance_url text, + CONSTRAINT check_4c6abed669 CHECK ((char_length(instance_url) <= 255)) ); CREATE SEQUENCE jira_connect_installations_id_seq @@ -13842,14 +14677,6 @@ CREATE TABLE jira_tracker_data ( deployment_type smallint DEFAULT 0 NOT NULL, vulnerabilities_issuetype text, vulnerabilities_enabled boolean DEFAULT false NOT NULL, - encrypted_proxy_address text, - encrypted_proxy_address_iv text, - encrypted_proxy_port text, - encrypted_proxy_port_iv text, - encrypted_proxy_username text, - encrypted_proxy_username_iv text, - encrypted_proxy_password text, - encrypted_proxy_password_iv text, jira_issue_transition_automatic boolean DEFAULT false NOT NULL, CONSTRAINT check_0bf84b76e9 CHECK ((char_length(vulnerabilities_issuetype) <= 255)), CONSTRAINT check_214cf6a48b CHECK ((char_length(project_key) <= 255)) @@ -13876,7 +14703,9 @@ CREATE TABLE keys ( public boolean DEFAULT false NOT NULL, last_used_at timestamp without time zone, fingerprint_sha256 bytea, - expires_at timestamp with time zone + expires_at timestamp with time zone, + expiry_notification_delivered_at timestamp with time zone, + before_expiry_notification_delivered_at timestamp with time zone ); CREATE SEQUENCE keys_id_seq @@ -14035,7 +14864,8 @@ CREATE TABLE licenses ( id integer NOT NULL, data text NOT NULL, created_at timestamp without time zone, - updated_at timestamp without time zone + updated_at timestamp without time zone, + cloud boolean DEFAULT false ); CREATE SEQUENCE licenses_id_seq @@ -14213,6 +15043,24 @@ CREATE SEQUENCE merge_request_context_commits_id_seq ALTER SEQUENCE merge_request_context_commits_id_seq OWNED BY merge_request_context_commits.id; +CREATE TABLE merge_request_diff_commit_users ( + id bigint NOT NULL, + name text, + email text, + CONSTRAINT check_147358fc42 CHECK ((char_length(name) <= 512)), + CONSTRAINT check_f5fa206cf7 CHECK ((char_length(email) <= 512)), + CONSTRAINT merge_request_diff_commit_users_name_or_email_existence CHECK (((COALESCE(name, ''::text) <> ''::text) OR (COALESCE(email, ''::text) <> ''::text))) +); + +CREATE SEQUENCE merge_request_diff_commit_users_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_diff_commit_users_id_seq OWNED BY merge_request_diff_commit_users.id; + CREATE TABLE merge_request_diff_commits ( authored_date timestamp with time zone, committed_date timestamp with time zone, @@ -14224,7 +15072,9 @@ CREATE TABLE merge_request_diff_commits ( committer_name text, committer_email text, message text, - trailers jsonb DEFAULT '{}'::jsonb NOT NULL + trailers jsonb DEFAULT '{}'::jsonb NOT NULL, + commit_author_id bigint, + committer_id bigint ); CREATE TABLE merge_request_diff_details ( @@ -14234,6 +15084,8 @@ CREATE TABLE merge_request_diff_details ( verification_retry_count smallint, verification_checksum bytea, verification_failure text, + verification_state smallint DEFAULT 0 NOT NULL, + verification_started_at timestamp with time zone, CONSTRAINT check_81429e3622 CHECK ((char_length(verification_failure) <= 255)) ); @@ -14406,7 +15258,8 @@ CREATE TABLE merge_requests ( rebase_jid character varying, squash_commit_sha bytea, sprint_id bigint, - merge_ref_sha bytea + merge_ref_sha bytea, + draft boolean DEFAULT false NOT NULL ); CREATE TABLE merge_requests_closing_issues ( @@ -14574,6 +15427,9 @@ CREATE TABLE namespace_package_settings ( namespace_id bigint NOT NULL, maven_duplicates_allowed boolean DEFAULT true NOT NULL, maven_duplicate_exception_regex text DEFAULT ''::text NOT NULL, + generic_duplicates_allowed boolean DEFAULT true NOT NULL, + generic_duplicate_exception_regex text DEFAULT ''::text NOT NULL, + CONSTRAINT check_31340211b1 CHECK ((char_length(generic_duplicate_exception_regex) <= 255)), CONSTRAINT check_d63274b2b6 CHECK ((char_length(maven_duplicate_exception_regex) <= 255)) ); @@ -14609,7 +15465,10 @@ CREATE TABLE namespace_settings ( allow_mfa_for_subgroups boolean DEFAULT true NOT NULL, default_branch_name text, repository_read_only boolean DEFAULT false NOT NULL, - delayed_project_removal boolean DEFAULT false NOT NULL, + delayed_project_removal boolean, + lock_delayed_project_removal boolean DEFAULT false NOT NULL, + resource_access_token_creation_allowed boolean DEFAULT true NOT NULL, + prevent_sharing_groups_outside_hierarchy boolean DEFAULT false NOT NULL, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)) ); @@ -14743,7 +15602,8 @@ CREATE TABLE notes ( change_position text, resolved_by_push boolean, review_id bigint, - confidential boolean + confidential boolean, + last_edited_at timestamp with time zone ); CREATE SEQUENCE notes_id_seq @@ -15230,6 +16090,30 @@ CREATE SEQUENCE packages_debian_group_components_id_seq ALTER SEQUENCE packages_debian_group_components_id_seq OWNED BY packages_debian_group_components.id; +CREATE TABLE packages_debian_group_distribution_keys ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + distribution_id bigint NOT NULL, + encrypted_private_key text NOT NULL, + encrypted_private_key_iv text NOT NULL, + encrypted_passphrase text NOT NULL, + encrypted_passphrase_iv text NOT NULL, + public_key text NOT NULL, + fingerprint text NOT NULL, + CONSTRAINT check_bc95dc3fbe CHECK ((char_length(fingerprint) <= 255)), + CONSTRAINT check_f708183491 CHECK ((char_length(public_key) <= 524288)) +); + +CREATE SEQUENCE packages_debian_group_distribution_keys_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_debian_group_distribution_keys_id_seq OWNED BY packages_debian_group_distribution_keys.id; + CREATE TABLE packages_debian_group_distributions ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -15332,6 +16216,30 @@ CREATE SEQUENCE packages_debian_project_components_id_seq ALTER SEQUENCE packages_debian_project_components_id_seq OWNED BY packages_debian_project_components.id; +CREATE TABLE packages_debian_project_distribution_keys ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + distribution_id bigint NOT NULL, + encrypted_private_key text NOT NULL, + encrypted_private_key_iv text NOT NULL, + encrypted_passphrase text NOT NULL, + encrypted_passphrase_iv text NOT NULL, + public_key text NOT NULL, + fingerprint text NOT NULL, + CONSTRAINT check_9e8a5eef0a CHECK ((char_length(fingerprint) <= 255)), + CONSTRAINT check_d188f6547f CHECK ((char_length(public_key) <= 524288)) +); + +CREATE SEQUENCE packages_debian_project_distribution_keys_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_debian_project_distribution_keys_id_seq OWNED BY packages_debian_project_distribution_keys.id; + CREATE TABLE packages_debian_project_distributions ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -15438,6 +16346,15 @@ CREATE SEQUENCE packages_events_id_seq ALTER SEQUENCE packages_events_id_seq OWNED BY packages_events.id; +CREATE TABLE packages_helm_file_metadata ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + package_file_id bigint NOT NULL, + channel text NOT NULL, + metadata jsonb, + CONSTRAINT check_c34067922d CHECK ((char_length(channel) <= 63)) +); + CREATE TABLE packages_maven_metadata ( id bigint NOT NULL, package_id bigint NOT NULL, @@ -15817,7 +16734,13 @@ CREATE TABLE plan_limits ( daily_invites integer DEFAULT 0 NOT NULL, ci_pipeline_deployments integer DEFAULT 500 NOT NULL, pull_mirror_interval_seconds integer DEFAULT 300 NOT NULL, - rubygems_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL + rubygems_max_file_size bigint DEFAULT '3221225472'::bigint NOT NULL, + terraform_module_max_file_size bigint DEFAULT 1073741824 NOT NULL, + helm_max_file_size bigint DEFAULT 5242880 NOT NULL, + ci_registered_group_runners integer DEFAULT 1000 NOT NULL, + ci_registered_project_runners integer DEFAULT 1000 NOT NULL, + web_hook_calls integer DEFAULT 0 NOT NULL, + ci_daily_pipeline_schedule_triggers integer DEFAULT 0 NOT NULL ); CREATE SEQUENCE plan_limits_id_seq @@ -16469,7 +17392,8 @@ CREATE TABLE project_settings ( has_confluence boolean DEFAULT false NOT NULL, cve_id_request_enabled boolean DEFAULT true NOT NULL, has_vulnerabilities boolean DEFAULT false NOT NULL, - prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL + prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL, + mr_default_target_self boolean DEFAULT false NOT NULL ); CREATE TABLE project_statistics ( @@ -16574,7 +17498,7 @@ CREATE TABLE projects ( disable_overriding_approvers_per_merge_request boolean, external_webhook_token character varying, issues_template text, - merge_requests_author_approval boolean, + merge_requests_author_approval boolean DEFAULT false, merge_requests_disable_committers_approval boolean, merge_requests_template text, mirror_last_successful_update_at timestamp without time zone, @@ -16782,10 +17706,12 @@ ALTER SEQUENCE protected_environment_deploy_access_levels_id_seq OWNED BY protec CREATE TABLE protected_environments ( id integer NOT NULL, - project_id integer NOT NULL, + project_id integer, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - name character varying NOT NULL + name character varying NOT NULL, + group_id bigint, + CONSTRAINT protected_environments_project_or_group_existence CHECK (((project_id IS NULL) <> (group_id IS NULL))) ); CREATE SEQUENCE protected_environments_id_seq @@ -16845,7 +17771,8 @@ CREATE TABLE push_event_payloads ( commit_to bytea, ref text, commit_title character varying(70), - ref_count integer + ref_count integer, + event_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE TABLE push_rules ( @@ -17228,7 +18155,8 @@ CREATE TABLE saml_providers ( enforced_sso boolean DEFAULT false NOT NULL, enforced_group_managed_accounts boolean DEFAULT false NOT NULL, prohibited_outer_forks boolean DEFAULT true NOT NULL, - default_membership_role smallint DEFAULT 10 NOT NULL + default_membership_role smallint DEFAULT 10 NOT NULL, + git_check_enforced boolean DEFAULT false NOT NULL ); CREATE SEQUENCE saml_providers_id_seq @@ -17305,7 +18233,8 @@ CREATE TABLE security_orchestration_policy_configurations ( 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 + updated_at timestamp with time zone NOT 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"}'; @@ -17319,12 +18248,36 @@ CREATE SEQUENCE security_orchestration_policy_configurations_id_seq ALTER SEQUENCE security_orchestration_policy_configurations_id_seq OWNED BY security_orchestration_policy_configurations.id; +CREATE TABLE security_orchestration_policy_rule_schedules ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + next_run_at timestamp with time zone, + security_orchestration_policy_configuration_id bigint NOT NULL, + user_id bigint NOT NULL, + policy_index integer NOT NULL, + cron text NOT NULL, + CONSTRAINT check_915825a76e CHECK ((char_length(cron) <= 255)) +); + +COMMENT ON TABLE security_orchestration_policy_rule_schedules IS '{"owner":"group::container security","description":"Schedules used to store relationship between project and security policy repository"}'; + +CREATE SEQUENCE security_orchestration_policy_rule_schedules_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE security_orchestration_policy_rule_schedules_id_seq OWNED BY security_orchestration_policy_rule_schedules.id; + CREATE TABLE security_scans ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, build_id bigint NOT NULL, - scan_type smallint NOT NULL + scan_type smallint NOT NULL, + info jsonb DEFAULT '{}'::jsonb NOT NULL ); CREATE SEQUENCE security_scans_id_seq @@ -17516,6 +18469,8 @@ CREATE TABLE snippet_repositories ( verified_at timestamp with time zone, verification_checksum bytea, verification_failure text, + verification_state smallint DEFAULT 0 NOT NULL, + verification_started_at timestamp with time zone, CONSTRAINT snippet_repositories_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255)) ); @@ -17687,6 +18642,22 @@ CREATE SEQUENCE sprints_id_seq ALTER SEQUENCE sprints_id_seq OWNED BY sprints.id; +CREATE TABLE status_check_responses ( + id bigint NOT NULL, + merge_request_id bigint NOT NULL, + external_approval_rule_id bigint NOT NULL, + sha bytea NOT NULL +); + +CREATE SEQUENCE status_check_responses_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE status_check_responses_id_seq OWNED BY status_check_responses.id; + CREATE TABLE status_page_published_incidents ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -17797,7 +18768,9 @@ CREATE TABLE taggings ( tagger_id integer, tagger_type character varying, context character varying, - created_at timestamp without time zone + created_at timestamp without time zone, + id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + taggable_id_convert_to_bigint bigint ); CREATE SEQUENCE taggings_id_seq @@ -17860,6 +18833,8 @@ CREATE TABLE terraform_state_versions ( verification_checksum bytea, verification_failure text, ci_build_id bigint, + verification_started_at timestamp with time zone, + verification_state smallint DEFAULT 0 NOT NULL, CONSTRAINT check_0824bb7bbd CHECK ((char_length(file) <= 255)), CONSTRAINT tf_state_versions_verification_failure_text_limit CHECK ((char_length(verification_failure) <= 255)) ); @@ -17906,7 +18881,8 @@ CREATE TABLE timelogs ( issue_id integer, merge_request_id integer, spent_at timestamp with time zone, - note_id integer + note_id integer, + project_id integer ); CREATE SEQUENCE timelogs_id_seq @@ -17999,6 +18975,24 @@ CREATE SEQUENCE u2f_registrations_id_seq ALTER SEQUENCE u2f_registrations_id_seq OWNED BY u2f_registrations.id; +CREATE TABLE upcoming_reconciliations ( + id bigint NOT NULL, + namespace_id bigint, + next_reconciliation_date date NOT NULL, + display_alert_from date NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE upcoming_reconciliations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE upcoming_reconciliations_id_seq OWNED BY upcoming_reconciliations.id; + CREATE TABLE uploads ( id integer NOT NULL, size bigint NOT NULL, @@ -18079,6 +19073,11 @@ CREATE SEQUENCE user_canonical_emails_id_seq ALTER SEQUENCE user_canonical_emails_id_seq OWNED BY user_canonical_emails.id; +CREATE TABLE user_credit_card_validations ( + user_id bigint NOT NULL, + credit_card_validated_at timestamp with time zone NOT NULL +); + CREATE TABLE user_custom_attributes ( id integer NOT NULL, created_at timestamp with time zone NOT NULL, @@ -18512,23 +19511,87 @@ CREATE SEQUENCE vulnerability_feedback_id_seq ALTER SEQUENCE vulnerability_feedback_id_seq OWNED BY vulnerability_feedback.id; -CREATE TABLE vulnerability_finding_fingerprints ( +CREATE TABLE vulnerability_finding_evidence_headers ( id bigint NOT NULL, - finding_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - algorithm_type smallint NOT NULL, - fingerprint_sha256 bytea 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 NOT NULL, + method text, + url text, + body text, + 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 NOT NULL, + status_code integer, + reason_phrase text, + body text, + CONSTRAINT check_58b124ab48 CHECK ((char_length(reason_phrase) <= 2048)), + CONSTRAINT check_76bac0c32b CHECK ((char_length(body) <= 2048)) ); -CREATE SEQUENCE vulnerability_finding_fingerprints_id_seq +CREATE SEQUENCE vulnerability_finding_evidence_responses_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1; -ALTER SEQUENCE vulnerability_finding_fingerprints_id_seq OWNED BY vulnerability_finding_fingerprints.id; +ALTER SEQUENCE vulnerability_finding_evidence_responses_id_seq OWNED BY vulnerability_finding_evidence_responses.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, + summary text, + CONSTRAINT check_5773b236fb CHECK ((char_length(summary) <= 8000000)) +); + +CREATE SEQUENCE vulnerability_finding_evidences_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_evidences_id_seq OWNED BY vulnerability_finding_evidences.id; CREATE TABLE vulnerability_finding_links ( id bigint NOT NULL, @@ -18550,6 +19613,24 @@ CREATE SEQUENCE vulnerability_finding_links_id_seq ALTER SEQUENCE vulnerability_finding_links_id_seq OWNED BY vulnerability_finding_links.id; +CREATE TABLE vulnerability_finding_signatures ( + id bigint NOT NULL, + finding_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + algorithm_type smallint NOT NULL, + signature_sha bytea NOT NULL +); + +CREATE SEQUENCE vulnerability_finding_signatures_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vulnerability_finding_signatures_id_seq OWNED BY vulnerability_finding_signatures.id; + CREATE TABLE vulnerability_findings_remediations ( id bigint NOT NULL, vulnerability_occurrence_id bigint, @@ -18758,7 +19839,8 @@ CREATE TABLE vulnerability_statistics ( low integer DEFAULT 0 NOT NULL, unknown integer DEFAULT 0 NOT NULL, info integer DEFAULT 0 NOT NULL, - letter_grade smallint NOT NULL + letter_grade smallint NOT NULL, + latest_pipeline_id bigint ); CREATE SEQUENCE vulnerability_statistics_id_seq @@ -18788,7 +19870,7 @@ CREATE SEQUENCE vulnerability_user_mentions_id_seq ALTER SEQUENCE vulnerability_user_mentions_id_seq OWNED BY vulnerability_user_mentions.id; -CREATE TABLE web_hook_logs ( +CREATE TABLE web_hook_logs_archived ( id integer NOT NULL, web_hook_id integer NOT NULL, trigger character varying, @@ -18804,16 +19886,6 @@ CREATE TABLE web_hook_logs ( updated_at timestamp without time zone NOT NULL ); -CREATE SEQUENCE web_hook_logs_id_seq - AS integer - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE web_hook_logs_id_seq OWNED BY web_hook_logs.id; - CREATE TABLE web_hooks ( id integer NOT NULL, project_id integer, @@ -18843,7 +19915,10 @@ CREATE TABLE web_hooks ( feature_flag_events boolean DEFAULT false NOT NULL, releases_events boolean DEFAULT false NOT NULL, member_events boolean DEFAULT false NOT NULL, - subgroup_events boolean DEFAULT false NOT NULL + subgroup_events boolean DEFAULT false NOT NULL, + recent_failures smallint DEFAULT 0 NOT NULL, + backoff_count smallint DEFAULT 0 NOT NULL, + disabled_until timestamp with time zone ); CREATE SEQUENCE web_hooks_id_seq @@ -19011,13 +20086,13 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams ALTER COLUMN id S ALTER TABLE ONLY analytics_cycle_analytics_project_stages ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_project_stages_id_seq'::regclass); -ALTER TABLE ONLY analytics_devops_adoption_segment_selections ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_segment_selections_id_seq'::regclass); +ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_project_value_streams_id_seq'::regclass); ALTER TABLE ONLY analytics_devops_adoption_segments ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_segments_id_seq'::regclass); ALTER TABLE ONLY analytics_devops_adoption_snapshots ALTER COLUMN id SET DEFAULT nextval('analytics_devops_adoption_snapshots_id_seq'::regclass); -ALTER TABLE ONLY analytics_instance_statistics_measurements ALTER COLUMN id SET DEFAULT nextval('analytics_instance_statistics_measurements_id_seq'::regclass); +ALTER TABLE ONLY analytics_usage_trends_measurements ALTER COLUMN id SET DEFAULT nextval('analytics_usage_trends_measurements_id_seq'::regclass); ALTER TABLE ONLY appearances ALTER COLUMN id SET DEFAULT nextval('appearances_id_seq'::regclass); @@ -19079,6 +20154,8 @@ ALTER TABLE ONLY boards_epic_board_labels ALTER COLUMN id SET DEFAULT nextval('b ALTER TABLE ONLY boards_epic_board_positions ALTER COLUMN id SET DEFAULT nextval('boards_epic_board_positions_id_seq'::regclass); +ALTER TABLE ONLY boards_epic_board_recent_visits ALTER COLUMN id SET DEFAULT nextval('boards_epic_board_recent_visits_id_seq'::regclass); + ALTER TABLE ONLY boards_epic_boards ALTER COLUMN id SET DEFAULT nextval('boards_epic_boards_id_seq'::regclass); ALTER TABLE ONLY boards_epic_list_user_preferences ALTER COLUMN id SET DEFAULT nextval('boards_epic_list_user_preferences_id_seq'::regclass); @@ -19093,6 +20170,10 @@ ALTER TABLE ONLY bulk_import_configurations ALTER COLUMN id SET DEFAULT nextval( ALTER TABLE ONLY bulk_import_entities ALTER COLUMN id SET DEFAULT nextval('bulk_import_entities_id_seq'::regclass); +ALTER TABLE ONLY bulk_import_export_uploads ALTER COLUMN id SET DEFAULT nextval('bulk_import_export_uploads_id_seq'::regclass); + +ALTER TABLE ONLY bulk_import_exports ALTER COLUMN id SET DEFAULT nextval('bulk_import_exports_id_seq'::regclass); + ALTER TABLE ONLY bulk_import_failures ALTER COLUMN id SET DEFAULT nextval('bulk_import_failures_id_seq'::regclass); ALTER TABLE ONLY bulk_import_trackers ALTER COLUMN id SET DEFAULT nextval('bulk_import_trackers_id_seq'::regclass); @@ -19131,10 +20212,16 @@ ALTER TABLE ONLY ci_instance_variables ALTER COLUMN id SET DEFAULT nextval('ci_i ALTER TABLE ONLY ci_job_artifacts ALTER COLUMN id SET DEFAULT nextval('ci_job_artifacts_id_seq'::regclass); +ALTER TABLE ONLY ci_job_token_project_scope_links ALTER COLUMN id SET DEFAULT nextval('ci_job_token_project_scope_links_id_seq'::regclass); + ALTER TABLE ONLY ci_job_variables ALTER COLUMN id SET DEFAULT nextval('ci_job_variables_id_seq'::regclass); +ALTER TABLE ONLY ci_minutes_additional_packs ALTER COLUMN id SET DEFAULT nextval('ci_minutes_additional_packs_id_seq'::regclass); + ALTER TABLE ONLY ci_namespace_monthly_usages ALTER COLUMN id SET DEFAULT nextval('ci_namespace_monthly_usages_id_seq'::regclass); +ALTER TABLE ONLY ci_pending_builds ALTER COLUMN id SET DEFAULT nextval('ci_pending_builds_id_seq'::regclass); + ALTER TABLE ONLY ci_pipeline_artifacts ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_artifacts_id_seq'::regclass); ALTER TABLE ONLY ci_pipeline_chat_data ALTER COLUMN id SET DEFAULT nextval('ci_pipeline_chat_data_id_seq'::regclass); @@ -19167,6 +20254,8 @@ ALTER TABLE ONLY ci_runner_projects ALTER COLUMN id SET DEFAULT nextval('ci_runn ALTER TABLE ONLY ci_runners ALTER COLUMN id SET DEFAULT nextval('ci_runners_id_seq'::regclass); +ALTER TABLE ONLY ci_running_builds ALTER COLUMN id SET DEFAULT nextval('ci_running_builds_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); @@ -19183,6 +20272,10 @@ ALTER TABLE ONLY ci_trigger_requests ALTER COLUMN id SET DEFAULT nextval('ci_tri ALTER TABLE ONLY ci_triggers ALTER COLUMN id SET DEFAULT nextval('ci_triggers_id_seq'::regclass); +ALTER TABLE ONLY ci_unit_test_failures ALTER COLUMN id SET DEFAULT nextval('ci_unit_test_failures_id_seq'::regclass); + +ALTER TABLE ONLY ci_unit_tests ALTER COLUMN id SET DEFAULT nextval('ci_unit_tests_id_seq'::regclass); + ALTER TABLE ONLY ci_variables ALTER COLUMN id SET DEFAULT nextval('ci_variables_id_seq'::regclass); ALTER TABLE ONLY cluster_agent_tokens ALTER COLUMN id SET DEFAULT nextval('cluster_agent_tokens_id_seq'::regclass); @@ -19241,6 +20334,8 @@ ALTER TABLE ONLY dast_profiles ALTER COLUMN id SET DEFAULT nextval('dast_profile ALTER TABLE ONLY dast_scanner_profiles ALTER COLUMN id SET DEFAULT nextval('dast_scanner_profiles_id_seq'::regclass); +ALTER TABLE ONLY dast_site_profile_secret_variables ALTER COLUMN id SET DEFAULT nextval('dast_site_profile_secret_variables_id_seq'::regclass); + ALTER TABLE ONLY dast_site_profiles ALTER COLUMN id SET DEFAULT nextval('dast_site_profiles_id_seq'::regclass); ALTER TABLE ONLY dast_site_tokens ALTER COLUMN id SET DEFAULT nextval('dast_site_tokens_id_seq'::regclass); @@ -19277,6 +20372,10 @@ ALTER TABLE ONLY dora_daily_metrics ALTER COLUMN id SET DEFAULT nextval('dora_da ALTER TABLE ONLY draft_notes ALTER COLUMN id SET DEFAULT nextval('draft_notes_id_seq'::regclass); +ALTER TABLE ONLY elastic_index_settings ALTER COLUMN id SET DEFAULT nextval('elastic_index_settings_id_seq'::regclass); + +ALTER TABLE ONLY elastic_reindexing_slices ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_slices_id_seq'::regclass); + ALTER TABLE ONLY elastic_reindexing_subtasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_subtasks_id_seq'::regclass); ALTER TABLE ONLY elastic_reindexing_tasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_tasks_id_seq'::regclass); @@ -19387,6 +20486,12 @@ ALTER TABLE ONLY import_export_uploads ALTER COLUMN id SET DEFAULT nextval('impo ALTER TABLE ONLY import_failures ALTER COLUMN id SET DEFAULT nextval('import_failures_id_seq'::regclass); +ALTER TABLE ONLY in_product_marketing_emails ALTER COLUMN id SET DEFAULT nextval('in_product_marketing_emails_id_seq'::regclass); + +ALTER TABLE ONLY incident_management_escalation_policies ALTER COLUMN id SET DEFAULT nextval('incident_management_escalation_policies_id_seq'::regclass); + +ALTER TABLE ONLY incident_management_escalation_rules ALTER COLUMN id SET DEFAULT nextval('incident_management_escalation_rules_id_seq'::regclass); + ALTER TABLE ONLY incident_management_oncall_participants ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_participants_id_seq'::regclass); ALTER TABLE ONLY incident_management_oncall_rotations ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_rotations_id_seq'::regclass); @@ -19463,6 +20568,8 @@ ALTER TABLE ONLY merge_request_cleanup_schedules ALTER COLUMN merge_request_id S ALTER TABLE ONLY merge_request_context_commits ALTER COLUMN id SET DEFAULT nextval('merge_request_context_commits_id_seq'::regclass); +ALTER TABLE ONLY merge_request_diff_commit_users ALTER COLUMN id SET DEFAULT nextval('merge_request_diff_commit_users_id_seq'::regclass); + ALTER TABLE ONLY merge_request_diff_details ALTER COLUMN merge_request_diff_id SET DEFAULT nextval('merge_request_diff_details_merge_request_diff_id_seq'::regclass); ALTER TABLE ONLY merge_request_diffs ALTER COLUMN id SET DEFAULT nextval('merge_request_diffs_id_seq'::regclass); @@ -19543,6 +20650,8 @@ ALTER TABLE ONLY packages_debian_group_component_files ALTER COLUMN id SET DEFAU ALTER TABLE ONLY packages_debian_group_components ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_components_id_seq'::regclass); +ALTER TABLE ONLY packages_debian_group_distribution_keys ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_distribution_keys_id_seq'::regclass); + ALTER TABLE ONLY packages_debian_group_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_distributions_id_seq'::regclass); ALTER TABLE ONLY packages_debian_project_architectures ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_architectures_id_seq'::regclass); @@ -19551,6 +20660,8 @@ ALTER TABLE ONLY packages_debian_project_component_files ALTER COLUMN id SET DEF ALTER TABLE ONLY packages_debian_project_components ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_components_id_seq'::regclass); +ALTER TABLE ONLY packages_debian_project_distribution_keys ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_distribution_keys_id_seq'::regclass); + ALTER TABLE ONLY packages_debian_project_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_distributions_id_seq'::regclass); ALTER TABLE ONLY packages_debian_publications ALTER COLUMN id SET DEFAULT nextval('packages_debian_publications_id_seq'::regclass); @@ -19699,6 +20810,8 @@ ALTER TABLE ONLY security_findings ALTER COLUMN id SET DEFAULT nextval('security ALTER TABLE ONLY security_orchestration_policy_configurations ALTER COLUMN id SET DEFAULT nextval('security_orchestration_policy_configurations_id_seq'::regclass); +ALTER TABLE ONLY security_orchestration_policy_rule_schedules ALTER COLUMN id SET DEFAULT nextval('security_orchestration_policy_rule_schedules_id_seq'::regclass); + ALTER TABLE ONLY security_scans ALTER COLUMN id SET DEFAULT nextval('security_scans_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); @@ -19729,6 +20842,8 @@ ALTER TABLE ONLY spam_logs ALTER COLUMN id SET DEFAULT nextval('spam_logs_id_seq ALTER TABLE ONLY sprints ALTER COLUMN id SET DEFAULT nextval('sprints_id_seq'::regclass); +ALTER TABLE ONLY status_check_responses ALTER COLUMN id SET DEFAULT nextval('status_check_responses_id_seq'::regclass); + ALTER TABLE ONLY status_page_published_incidents ALTER COLUMN id SET DEFAULT nextval('status_page_published_incidents_id_seq'::regclass); ALTER TABLE ONLY status_page_settings ALTER COLUMN project_id SET DEFAULT nextval('status_page_settings_project_id_seq'::regclass); @@ -19759,6 +20874,8 @@ ALTER TABLE ONLY trending_projects ALTER COLUMN id SET DEFAULT nextval('trending ALTER TABLE ONLY u2f_registrations ALTER COLUMN id SET DEFAULT nextval('u2f_registrations_id_seq'::regclass); +ALTER TABLE ONLY upcoming_reconciliations ALTER COLUMN id SET DEFAULT nextval('upcoming_reconciliations_id_seq'::regclass); + ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass); ALTER TABLE ONLY user_agent_details ALTER COLUMN id SET DEFAULT nextval('user_agent_details_id_seq'::regclass); @@ -19795,10 +20912,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_fingerprints ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_fingerprints_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_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); +ALTER TABLE ONLY vulnerability_finding_signatures ALTER COLUMN id SET DEFAULT nextval('vulnerability_finding_signatures_id_seq'::regclass); + ALTER TABLE ONLY vulnerability_findings_remediations ALTER COLUMN id SET DEFAULT nextval('vulnerability_findings_remediations_id_seq'::regclass); ALTER TABLE ONLY vulnerability_historical_statistics ALTER COLUMN id SET DEFAULT nextval('vulnerability_historical_statistics_id_seq'::regclass); @@ -19839,6 +20964,60 @@ ALTER TABLE ONLY x509_issuers ALTER COLUMN id SET DEFAULT nextval('x509_issuers_ ALTER TABLE ONLY zoom_meetings ALTER COLUMN id SET DEFAULT nextval('zoom_meetings_id_seq'::regclass); +ALTER TABLE ONLY audit_events + ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_000000 + ADD CONSTRAINT audit_events_000000_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202212 + ADD CONSTRAINT audit_events_202212_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202301 + ADD CONSTRAINT audit_events_202301_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202302 + ADD CONSTRAINT audit_events_202302_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202303 + ADD CONSTRAINT audit_events_202303_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202304 + ADD CONSTRAINT audit_events_202304_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202305 + ADD CONSTRAINT audit_events_202305_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.audit_events_202306 + ADD CONSTRAINT audit_events_202306_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY web_hook_logs + ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_000000 + ADD CONSTRAINT web_hook_logs_000000_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202212 + ADD CONSTRAINT web_hook_logs_202212_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202301 + ADD CONSTRAINT web_hook_logs_202301_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202302 + ADD CONSTRAINT web_hook_logs_202302_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202303 + ADD CONSTRAINT web_hook_logs_202303_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202304 + ADD CONSTRAINT web_hook_logs_202304_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202305 + ADD CONSTRAINT web_hook_logs_202305_pkey PRIMARY KEY (id, created_at); + +ALTER TABLE ONLY gitlab_partitions_dynamic.web_hook_logs_202306 + ADD CONSTRAINT web_hook_logs_202306_pkey PRIMARY KEY (id, created_at); + ALTER TABLE ONLY product_analytics_events_experimental ADD CONSTRAINT product_analytics_events_experimental_pkey PRIMARY KEY (id, project_id); @@ -20061,8 +21240,8 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams ALTER TABLE ONLY analytics_cycle_analytics_project_stages ADD CONSTRAINT analytics_cycle_analytics_project_stages_pkey PRIMARY KEY (id); -ALTER TABLE ONLY analytics_devops_adoption_segment_selections - ADD CONSTRAINT analytics_devops_adoption_segment_selections_pkey PRIMARY KEY (id); +ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams + ADD CONSTRAINT analytics_cycle_analytics_project_value_streams_pkey PRIMARY KEY (id); ALTER TABLE ONLY analytics_devops_adoption_segments ADD CONSTRAINT analytics_devops_adoption_segments_pkey PRIMARY KEY (id); @@ -20070,12 +21249,12 @@ ALTER TABLE ONLY analytics_devops_adoption_segments ALTER TABLE ONLY analytics_devops_adoption_snapshots ADD CONSTRAINT analytics_devops_adoption_snapshots_pkey PRIMARY KEY (id); -ALTER TABLE ONLY analytics_instance_statistics_measurements - ADD CONSTRAINT analytics_instance_statistics_measurements_pkey PRIMARY KEY (id); - ALTER TABLE ONLY analytics_language_trend_repository_languages ADD CONSTRAINT analytics_language_trend_repository_languages_pkey PRIMARY KEY (programming_language_id, project_id, snapshot_date); +ALTER TABLE ONLY analytics_usage_trends_measurements + ADD CONSTRAINT analytics_usage_trends_measurements_pkey PRIMARY KEY (id); + ALTER TABLE ONLY appearances ADD CONSTRAINT appearances_pkey PRIMARY KEY (id); @@ -20124,12 +21303,6 @@ ALTER TABLE ONLY approvers ALTER TABLE ONLY atlassian_identities ADD CONSTRAINT atlassian_identities_pkey PRIMARY KEY (user_id); -ALTER TABLE ONLY audit_events_archived - ADD CONSTRAINT audit_events_archived_pkey PRIMARY KEY (id); - -ALTER TABLE ONLY audit_events - ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id, created_at); - ALTER TABLE ONLY authentication_events ADD CONSTRAINT authentication_events_pkey PRIMARY KEY (id); @@ -20172,6 +21345,9 @@ ALTER TABLE ONLY boards_epic_board_labels ALTER TABLE ONLY boards_epic_board_positions ADD CONSTRAINT boards_epic_board_positions_pkey PRIMARY KEY (id); +ALTER TABLE ONLY boards_epic_board_recent_visits + ADD CONSTRAINT boards_epic_board_recent_visits_pkey PRIMARY KEY (id); + ALTER TABLE ONLY boards_epic_boards ADD CONSTRAINT boards_epic_boards_pkey PRIMARY KEY (id); @@ -20196,6 +21372,12 @@ ALTER TABLE ONLY bulk_import_configurations ALTER TABLE ONLY bulk_import_entities ADD CONSTRAINT bulk_import_entities_pkey PRIMARY KEY (id); +ALTER TABLE ONLY bulk_import_export_uploads + ADD CONSTRAINT bulk_import_export_uploads_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY bulk_import_exports + ADD CONSTRAINT bulk_import_exports_pkey PRIMARY KEY (id); + ALTER TABLE ONLY bulk_import_failures ADD CONSTRAINT bulk_import_failures_pkey PRIMARY KEY (id); @@ -20268,12 +21450,21 @@ ALTER TABLE ONLY ci_instance_variables ALTER TABLE ONLY ci_job_artifacts ADD CONSTRAINT ci_job_artifacts_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_job_token_project_scope_links + ADD CONSTRAINT ci_job_token_project_scope_links_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_job_variables ADD CONSTRAINT ci_job_variables_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_minutes_additional_packs + ADD CONSTRAINT ci_minutes_additional_packs_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_namespace_monthly_usages ADD CONSTRAINT ci_namespace_monthly_usages_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_pending_builds + ADD CONSTRAINT ci_pending_builds_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_pipeline_artifacts ADD CONSTRAINT ci_pipeline_artifacts_pkey PRIMARY KEY (id); @@ -20322,6 +21513,9 @@ ALTER TABLE ONLY ci_runner_projects ALTER TABLE ONLY ci_runners ADD CONSTRAINT ci_runners_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT ci_running_builds_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT ci_sources_pipelines_pkey PRIMARY KEY (id); @@ -20346,6 +21540,12 @@ ALTER TABLE ONLY ci_trigger_requests ALTER TABLE ONLY ci_triggers ADD CONSTRAINT ci_triggers_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_unit_test_failures + ADD CONSTRAINT ci_unit_test_failures_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ci_unit_tests + ADD CONSTRAINT ci_unit_tests_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_variables ADD CONSTRAINT ci_variables_pkey PRIMARY KEY (id); @@ -20403,6 +21603,12 @@ ALTER TABLE ONLY clusters_applications_prometheus ALTER TABLE ONLY clusters_applications_runners ADD CONSTRAINT clusters_applications_runners_pkey PRIMARY KEY (id); +ALTER TABLE ONLY clusters_integration_elasticstack + ADD CONSTRAINT clusters_integration_elasticstack_pkey PRIMARY KEY (cluster_id); + +ALTER TABLE ONLY clusters_integration_prometheus + ADD CONSTRAINT clusters_integration_prometheus_pkey PRIMARY KEY (cluster_id); + ALTER TABLE ONLY clusters_kubernetes_namespaces ADD CONSTRAINT clusters_kubernetes_namespaces_pkey PRIMARY KEY (id); @@ -20430,12 +21636,21 @@ ALTER TABLE ONLY csv_issue_imports ALTER TABLE ONLY custom_emoji ADD CONSTRAINT custom_emoji_pkey PRIMARY KEY (id); +ALTER TABLE ONLY dast_profiles_pipelines + ADD CONSTRAINT dast_profiles_pipelines_pkey PRIMARY KEY (dast_profile_id, ci_pipeline_id); + ALTER TABLE ONLY dast_profiles ADD CONSTRAINT dast_profiles_pkey PRIMARY KEY (id); ALTER TABLE ONLY dast_scanner_profiles ADD CONSTRAINT dast_scanner_profiles_pkey PRIMARY KEY (id); +ALTER TABLE ONLY dast_site_profile_secret_variables + ADD CONSTRAINT dast_site_profile_secret_variables_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY dast_site_profiles_pipelines + ADD CONSTRAINT dast_site_profiles_pipelines_pkey PRIMARY KEY (dast_site_profile_id, ci_pipeline_id); + ALTER TABLE ONLY dast_site_profiles ADD CONSTRAINT dast_site_profiles_pkey PRIMARY KEY (id); @@ -20496,6 +21711,12 @@ ALTER TABLE ONLY dora_daily_metrics ALTER TABLE ONLY draft_notes ADD CONSTRAINT draft_notes_pkey PRIMARY KEY (id); +ALTER TABLE ONLY elastic_index_settings + ADD CONSTRAINT elastic_index_settings_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY elastic_reindexing_slices + ADD CONSTRAINT elastic_reindexing_slices_pkey PRIMARY KEY (id); + ALTER TABLE ONLY elastic_reindexing_subtasks ADD CONSTRAINT elastic_reindexing_subtasks_pkey PRIMARY KEY (id); @@ -20676,9 +21897,18 @@ ALTER TABLE ONLY import_export_uploads ALTER TABLE ONLY import_failures ADD CONSTRAINT import_failures_pkey PRIMARY KEY (id); +ALTER TABLE ONLY in_product_marketing_emails + ADD CONSTRAINT in_product_marketing_emails_pkey PRIMARY KEY (id); + ALTER TABLE ONLY incident_management_oncall_shifts ADD CONSTRAINT inc_mgmnt_no_overlapping_oncall_shifts EXCLUDE USING gist (rotation_id WITH =, tstzrange(starts_at, ends_at, '[)'::text) WITH &&); +ALTER TABLE ONLY incident_management_escalation_policies + ADD CONSTRAINT incident_management_escalation_policies_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY incident_management_escalation_rules + ADD CONSTRAINT incident_management_escalation_rules_pkey PRIMARY KEY (id); + ALTER TABLE ONLY incident_management_oncall_participants ADD CONSTRAINT incident_management_oncall_participants_pkey PRIMARY KEY (id); @@ -20811,6 +22041,9 @@ ALTER TABLE ONLY merge_request_context_commit_diff_files ALTER TABLE ONLY merge_request_context_commits ADD CONSTRAINT merge_request_context_commits_pkey PRIMARY KEY (id); +ALTER TABLE ONLY merge_request_diff_commit_users + ADD CONSTRAINT merge_request_diff_commit_users_pkey PRIMARY KEY (id); + ALTER TABLE ONLY merge_request_diff_commits ADD CONSTRAINT merge_request_diff_commits_pkey PRIMARY KEY (merge_request_diff_id, relative_order); @@ -20955,6 +22188,9 @@ ALTER TABLE ONLY packages_debian_group_component_files ALTER TABLE ONLY packages_debian_group_components ADD CONSTRAINT packages_debian_group_components_pkey PRIMARY KEY (id); +ALTER TABLE ONLY packages_debian_group_distribution_keys + ADD CONSTRAINT packages_debian_group_distribution_keys_pkey PRIMARY KEY (id); + ALTER TABLE ONLY packages_debian_group_distributions ADD CONSTRAINT packages_debian_group_distributions_pkey PRIMARY KEY (id); @@ -20967,6 +22203,9 @@ ALTER TABLE ONLY packages_debian_project_component_files ALTER TABLE ONLY packages_debian_project_components ADD CONSTRAINT packages_debian_project_components_pkey PRIMARY KEY (id); +ALTER TABLE ONLY packages_debian_project_distribution_keys + ADD CONSTRAINT packages_debian_project_distribution_keys_pkey PRIMARY KEY (id); + ALTER TABLE ONLY packages_debian_project_distributions ADD CONSTRAINT packages_debian_project_distributions_pkey PRIMARY KEY (id); @@ -20982,6 +22221,9 @@ ALTER TABLE ONLY packages_dependency_links ALTER TABLE ONLY packages_events ADD CONSTRAINT packages_events_pkey PRIMARY KEY (id); +ALTER TABLE ONLY packages_helm_file_metadata + ADD CONSTRAINT packages_helm_file_metadata_pkey PRIMARY KEY (package_file_id); + ALTER TABLE ONLY packages_maven_metadata ADD CONSTRAINT packages_maven_metadata_pkey PRIMARY KEY (id); @@ -21231,6 +22473,9 @@ ALTER TABLE ONLY security_findings ALTER TABLE ONLY security_orchestration_policy_configurations ADD CONSTRAINT security_orchestration_policy_configurations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY security_orchestration_policy_rule_schedules + ADD CONSTRAINT security_orchestration_policy_rule_schedules_pkey PRIMARY KEY (id); + ALTER TABLE ONLY security_scans ADD CONSTRAINT security_scans_pkey PRIMARY KEY (id); @@ -21288,6 +22533,9 @@ ALTER TABLE ONLY spam_logs ALTER TABLE ONLY sprints ADD CONSTRAINT sprints_pkey PRIMARY KEY (id); +ALTER TABLE ONLY status_check_responses + ADD CONSTRAINT status_check_responses_pkey PRIMARY KEY (id); + ALTER TABLE ONLY status_page_published_incidents ADD CONSTRAINT status_page_published_incidents_pkey PRIMARY KEY (id); @@ -21333,6 +22581,9 @@ ALTER TABLE ONLY trending_projects ALTER TABLE ONLY u2f_registrations ADD CONSTRAINT u2f_registrations_pkey PRIMARY KEY (id); +ALTER TABLE ONLY upcoming_reconciliations + ADD CONSTRAINT upcoming_reconciliations_pkey PRIMARY KEY (id); + ALTER TABLE ONLY uploads ADD CONSTRAINT uploads_pkey PRIMARY KEY (id); @@ -21345,6 +22596,9 @@ ALTER TABLE ONLY user_callouts ALTER TABLE ONLY user_canonical_emails ADD CONSTRAINT user_canonical_emails_pkey PRIMARY KEY (id); +ALTER TABLE ONLY user_credit_card_validations + ADD CONSTRAINT user_credit_card_validations_pkey PRIMARY KEY (user_id); + ALTER TABLE ONLY user_custom_attributes ADD CONSTRAINT user_custom_attributes_pkey PRIMARY KEY (id); @@ -21399,12 +22653,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_fingerprints - ADD CONSTRAINT vulnerability_finding_fingerprints_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_evidences + ADD CONSTRAINT vulnerability_finding_evidences_pkey PRIMARY KEY (id); ALTER TABLE ONLY vulnerability_finding_links ADD CONSTRAINT vulnerability_finding_links_pkey PRIMARY KEY (id); +ALTER TABLE ONLY vulnerability_finding_signatures + ADD CONSTRAINT vulnerability_finding_signatures_pkey PRIMARY KEY (id); + ALTER TABLE ONLY vulnerability_findings_remediations ADD CONSTRAINT vulnerability_findings_remediations_pkey PRIMARY KEY (id); @@ -21438,8 +22704,8 @@ ALTER TABLE ONLY vulnerability_statistics ALTER TABLE ONLY vulnerability_user_mentions ADD CONSTRAINT vulnerability_user_mentions_pkey PRIMARY KEY (id); -ALTER TABLE ONLY web_hook_logs - ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id); +ALTER TABLE ONLY web_hook_logs_archived + ADD CONSTRAINT web_hook_logs_archived_pkey PRIMARY KEY (id); ALTER TABLE ONLY web_hooks ADD CONSTRAINT web_hooks_pkey PRIMARY KEY (id); @@ -21465,6 +22731,78 @@ ALTER TABLE ONLY x509_issuers ALTER TABLE ONLY zoom_meetings ADD CONSTRAINT zoom_meetings_pkey PRIMARY KEY (id); +CREATE INDEX analytics_index_audit_events_part_on_created_at_and_author_id ON ONLY audit_events USING btree (created_at, author_id); + +CREATE INDEX audit_events_000000_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_000000 USING btree (created_at, author_id); + +CREATE INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ON ONLY audit_events USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_000000_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_000000 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202212_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202212 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202212_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202212 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202301_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202301 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202301_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202301 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202302_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202302 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202302_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202302 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202303_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202303 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202303_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202303 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202304_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202304 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202304_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202304 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202305_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202305 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202305_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202305 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +CREATE INDEX audit_events_202306_created_at_author_id_idx ON gitlab_partitions_dynamic.audit_events_202306 USING btree (created_at, author_id); + +CREATE INDEX audit_events_202306_entity_id_entity_type_id_author_id_crea_idx ON gitlab_partitions_dynamic.audit_events_202306 USING btree (entity_id, entity_type, id DESC, author_id, created_at); + +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); + +CREATE INDEX index_719c6187cb ON gitlab_partitions_dynamic.web_hook_logs_202212 USING btree (web_hook_id); + +CREATE INDEX index_80bf138a51 ON gitlab_partitions_dynamic.web_hook_logs_000000 USING btree (web_hook_id); + +CREATE INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ON ONLY web_hook_logs USING btree (created_at, web_hook_id); + +CREATE INDEX index_962081978f ON gitlab_partitions_dynamic.web_hook_logs_202212 USING btree (created_at, web_hook_id); + +CREATE INDEX index_eecfac613f ON gitlab_partitions_dynamic.web_hook_logs_000000 USING btree (created_at, web_hook_id); + +CREATE INDEX index_fdb8d5eeea ON gitlab_partitions_dynamic.web_hook_logs_202301 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202302_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202302 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202302_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202302 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202303_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202303 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202303_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202303 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202304_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202304 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202304_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202304 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202305_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202305 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202305_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202305 USING btree (web_hook_id); + +CREATE INDEX web_hook_logs_202306_created_at_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (created_at, web_hook_id); + +CREATE INDEX web_hook_logs_202306_web_hook_id_idx ON gitlab_partitions_dynamic.web_hook_logs_202306 USING btree (web_hook_id); + CREATE INDEX index_product_analytics_events_experimental_project_and_time ON ONLY product_analytics_events_experimental USING btree (project_id, collector_tstamp); CREATE INDEX product_analytics_events_expe_project_id_collector_tstamp_idx10 ON gitlab_partitions_static.product_analytics_events_experimental_10 USING btree (project_id, collector_tstamp); @@ -21597,10 +22935,6 @@ CREATE INDEX product_analytics_events_experi_project_id_collector_tstamp_idx ON CREATE INDEX active_billable_users ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[NULL::integer, 6, 4]))) AND ((user_type IS NULL) OR (user_type <> ALL ('{2,6,1,3,7,8}'::smallint[])))); -CREATE INDEX analytics_index_audit_events_on_created_at_and_author_id ON audit_events_archived USING btree (created_at, author_id); - -CREATE INDEX analytics_index_audit_events_part_on_created_at_and_author_id ON ONLY audit_events USING btree (created_at, author_id); - CREATE INDEX analytics_index_events_on_created_at_and_author_id ON events USING btree (created_at, author_id); CREATE INDEX analytics_repository_languages_on_project_id ON analytics_language_trend_repository_languages USING btree (project_id); @@ -21629,22 +22963,44 @@ 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 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_responses_on_finding_evidences_id ON vulnerability_finding_evidence_responses USING btree (vulnerability_finding_evidence_id); + +CREATE INDEX finding_evidences_on_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); -CREATE INDEX idx_audit_events_on_entity_id_desc_author_id_created_at ON audit_events_archived USING btree (entity_id, entity_type, id DESC, author_id, created_at); +CREATE UNIQUE INDEX i_ci_job_token_project_scope_links_on_source_and_target_project ON ci_job_token_project_scope_links USING btree (source_project_id, target_project_id); -CREATE INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ON ONLY audit_events USING btree (entity_id, entity_type, id DESC, author_id, created_at); +CREATE INDEX idx_analytics_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_id); + +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_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); + CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at_enabled ON container_expiration_policies USING btree (project_id, next_run_at, enabled); CREATE INDEX idx_container_repositories_on_exp_cleanup_status_and_start_date ON container_repositories USING btree (expiration_policy_cleanup_status, expiration_policy_started_at); 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); + +CREATE INDEX idx_devops_adoption_segments_namespace_recorded_at ON analytics_devops_adoption_snapshots USING btree (namespace_id, recorded_at); + +CREATE UNIQUE INDEX idx_devops_adoption_segments_namespaces_pair ON analytics_devops_adoption_segments USING btree (display_namespace_id, namespace_id); + CREATE INDEX idx_eaprpb_external_approval_rule_id ON external_approval_rules_protected_branches USING btree (external_approval_rule_id); +CREATE INDEX idx_elastic_reindexing_slices_on_elastic_reindexing_subtask_id ON elastic_reindexing_slices USING btree (elastic_reindexing_subtask_id); + CREATE UNIQUE INDEX idx_environment_merge_requests_unique_index ON deployment_merge_requests USING btree (environment_id, merge_request_id); CREATE INDEX idx_geo_con_rep_updated_events_on_container_repository_id ON geo_container_repository_updated_events USING btree (container_repository_id); @@ -21655,6 +23011,8 @@ CREATE INDEX idx_issues_on_project_id_and_created_at_and_id_and_state_id ON issu CREATE INDEX idx_issues_on_project_id_and_due_date_and_id_and_state_id ON issues USING btree (project_id, due_date, id, state_id) WHERE (due_date IS NOT NULL); +CREATE INDEX idx_issues_on_project_id_and_rel_asc_and_id ON issues USING btree (project_id, relative_position, id); + CREATE INDEX idx_issues_on_project_id_and_rel_position_and_state_id_and_id ON issues USING btree (project_id, relative_position, state_id, id DESC); CREATE INDEX idx_issues_on_project_id_and_updated_at_and_id_and_state_id ON issues USING btree (project_id, updated_at, id, state_id); @@ -21665,6 +23023,8 @@ CREATE INDEX idx_jira_connect_subscriptions_on_installation_id ON jira_connect_s CREATE UNIQUE INDEX idx_jira_connect_subscriptions_on_installation_id_namespace_id ON jira_connect_subscriptions USING btree (jira_connect_installation_id, namespace_id); +CREATE INDEX idx_keys_expires_at_and_before_expiry_notification_undelivered ON keys USING btree (date(timezone('UTC'::text, expires_at)), before_expiry_notification_delivered_at) WHERE (before_expiry_notification_delivered_at IS NULL); + CREATE INDEX idx_members_created_at_user_id_invite_token ON members USING btree (created_at) WHERE ((invite_token IS NOT NULL) AND (user_id IS NULL)); CREATE INDEX idx_merge_requests_on_id_and_merge_jid ON merge_requests USING btree (id, merge_jid) WHERE ((merge_jid IS NOT NULL) AND (state_id = 4)); @@ -21683,6 +23043,8 @@ CREATE UNIQUE INDEX idx_metrics_users_starred_dashboard_on_user_project_dashboar CREATE INDEX idx_mr_cc_diff_files_on_mr_cc_id_and_sha ON merge_request_context_commit_diff_files USING btree (merge_request_context_commit_id, sha); +CREATE INDEX idx_mrs_on_target_id_and_created_at_and_state_id ON merge_requests USING btree (target_project_id, state_id, created_at, id); + CREATE UNIQUE INDEX idx_on_compliance_management_frameworks_namespace_id_name ON compliance_management_frameworks USING btree (namespace_id, name); CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_external_url ON external_approval_rules USING btree (project_id, external_url); @@ -21697,9 +23059,9 @@ CREATE INDEX idx_packages_debian_project_component_files_on_architecture_id ON p 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_deb_grp_architectures_on_distribution_id ON packages_debian_group_architectures USING btree (distribution_id); +CREATE INDEX idx_pkgs_debian_group_distribution_keys_on_distribution_id ON packages_debian_group_distribution_keys USING btree (distribution_id); -CREATE INDEX idx_pkgs_deb_proj_architectures_on_distribution_id ON packages_debian_project_architectures USING btree (distribution_id); +CREATE INDEX idx_pkgs_debian_project_distribution_keys_on_distribution_id ON packages_debian_project_distribution_keys USING btree (distribution_id); CREATE UNIQUE INDEX idx_pkgs_dep_links_on_pkg_id_dependency_id_dependency_type ON packages_dependency_links USING btree (package_id, dependency_id, dependency_type); @@ -21735,9 +23097,9 @@ 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 UNIQUE INDEX idx_vuln_fingerprints_on_occurrences_id_and_fingerprint ON vulnerability_finding_fingerprints USING btree (finding_id, fingerprint_sha256); +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_fingerprints_uniqueness ON vulnerability_finding_fingerprints USING btree (finding_id, algorithm_type, fingerprint_sha256); +CREATE UNIQUE INDEX idx_vuln_signatures_uniqueness_signature_sha ON vulnerability_finding_signatures USING btree (finding_id, algorithm_type, signature_sha); CREATE UNIQUE INDEX idx_vulnerability_ext_issue_links_on_vulne_id_and_ext_issue ON vulnerability_external_issue_links USING btree (vulnerability_id, external_type, external_project_key, external_issue_key); @@ -21795,9 +23157,11 @@ CREATE INDEX index_analytics_ca_project_stages_on_relative_position ON analytics CREATE INDEX index_analytics_ca_project_stages_on_start_event_label_id ON analytics_cycle_analytics_project_stages USING btree (start_event_label_id); -CREATE INDEX index_analytics_cycle_analytics_group_stages_custom_only ON analytics_cycle_analytics_group_stages USING btree (id) WHERE (custom = true); +CREATE INDEX index_analytics_ca_project_stages_on_value_stream_id ON analytics_cycle_analytics_project_stages USING btree (project_value_stream_id); -CREATE UNIQUE INDEX index_analytics_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_id); +CREATE UNIQUE INDEX index_analytics_ca_project_value_streams_on_project_id_and_name ON analytics_cycle_analytics_project_value_streams USING btree (project_id, name); + +CREATE INDEX index_analytics_cycle_analytics_group_stages_custom_only ON analytics_cycle_analytics_group_stages USING btree (id) WHERE (custom = true); CREATE INDEX index_application_settings_on_custom_project_templates_group_id ON application_settings USING btree (custom_project_templates_group_id); @@ -21875,8 +23239,6 @@ CREATE INDEX index_authentication_events_on_user_id ON authentication_events USI CREATE INDEX index_award_emoji_on_awardable_type_and_awardable_id ON award_emoji USING btree (awardable_type, awardable_id); -CREATE INDEX index_award_emoji_on_user_id_and_name ON award_emoji USING btree (user_id, name); - CREATE UNIQUE INDEX index_aws_roles_on_role_external_id ON aws_roles USING btree (role_external_id); CREATE UNIQUE INDEX index_aws_roles_on_user_id ON aws_roles USING btree (user_id); @@ -21893,6 +23255,8 @@ CREATE INDEX index_badges_on_project_id ON badges USING btree (project_id); CREATE INDEX index_batched_jobs_by_batched_migration_id_and_id ON batched_background_migration_jobs USING btree (batched_background_migration_id, id); +CREATE INDEX index_batched_jobs_on_batched_migration_id_and_status ON batched_background_migration_jobs USING btree (batched_background_migration_id, status); + CREATE INDEX index_batched_migrations_on_job_table_and_column_name ON batched_background_migrations USING btree (job_class_name, table_name, column_name); CREATE INDEX index_board_assignees_on_assignee_id ON board_assignees USING btree (assignee_id); @@ -21935,6 +23299,12 @@ CREATE INDEX index_boards_epic_board_positions_on_epic_id ON boards_epic_board_p CREATE INDEX index_boards_epic_board_positions_on_scoped_relative_position ON boards_epic_board_positions USING btree (epic_board_id, epic_id, relative_position); +CREATE INDEX index_boards_epic_board_recent_visits_on_epic_board_id ON boards_epic_board_recent_visits USING btree (epic_board_id); + +CREATE INDEX index_boards_epic_board_recent_visits_on_group_id ON boards_epic_board_recent_visits USING btree (group_id); + +CREATE INDEX index_boards_epic_board_recent_visits_on_user_id ON boards_epic_board_recent_visits USING btree (user_id); + CREATE INDEX index_boards_epic_boards_on_group_id ON boards_epic_boards USING btree (group_id); CREATE INDEX index_boards_epic_list_user_preferences_on_epic_list_id ON boards_epic_list_user_preferences USING btree (epic_list_id); @@ -21973,6 +23343,8 @@ CREATE INDEX index_bulk_import_entities_on_parent_id ON bulk_import_entities USI CREATE INDEX index_bulk_import_entities_on_project_id ON bulk_import_entities USING btree (project_id); +CREATE INDEX index_bulk_import_export_uploads_on_export_id ON bulk_import_export_uploads USING btree (export_id); + CREATE INDEX index_bulk_import_failures_on_bulk_import_entity_id ON bulk_import_failures USING btree (bulk_import_entity_id); CREATE INDEX index_bulk_import_failures_on_correlation_id_value ON bulk_import_failures USING btree (correlation_id_value); @@ -22049,6 +23421,10 @@ CREATE INDEX index_ci_builds_on_user_id_and_created_at_and_type_eq_ci_build ON c CREATE INDEX index_ci_builds_project_id_and_status_for_live_jobs_partial2 ON ci_builds USING btree (project_id, status) WHERE (((type)::text = 'Ci::Build'::text) AND ((status)::text = ANY (ARRAY[('running'::character varying)::text, ('pending'::character varying)::text, ('created'::character varying)::text]))); +CREATE INDEX index_ci_builds_runner_id_pending_covering ON ci_builds USING btree (runner_id, id) INCLUDE (project_id) WHERE (((status)::text = 'pending'::text) AND ((type)::text = 'Ci::Build'::text)); + +CREATE INDEX index_ci_builds_runner_id_running ON ci_builds USING btree (runner_id) WHERE (((status)::text = 'running'::text) AND ((type)::text = 'Ci::Build'::text)); + CREATE UNIQUE INDEX index_ci_builds_runner_session_on_build_id ON ci_builds_runner_session USING btree (build_id); CREATE INDEX index_ci_daily_build_group_report_results_on_group_id ON ci_daily_build_group_report_results USING btree (group_id); @@ -22079,12 +23455,26 @@ CREATE INDEX index_ci_job_artifacts_on_project_id ON ci_job_artifacts USING btre CREATE INDEX index_ci_job_artifacts_on_project_id_for_security_reports ON ci_job_artifacts USING btree (project_id) WHERE (file_type = ANY (ARRAY[5, 6, 7, 8])); +CREATE INDEX index_ci_job_token_project_scope_links_on_added_by_id ON ci_job_token_project_scope_links USING btree (added_by_id); + +CREATE INDEX index_ci_job_token_project_scope_links_on_target_project_id ON ci_job_token_project_scope_links USING btree (target_project_id); + CREATE INDEX index_ci_job_variables_on_job_id ON ci_job_variables USING btree (job_id); CREATE UNIQUE INDEX index_ci_job_variables_on_key_and_job_id ON ci_job_variables USING btree (key, job_id); +CREATE INDEX index_ci_minutes_additional_packs_on_namespace_id_purchase_xid ON ci_minutes_additional_packs USING btree (namespace_id, purchase_xid); + CREATE UNIQUE INDEX index_ci_namespace_monthly_usages_on_namespace_id_and_date ON ci_namespace_monthly_usages USING btree (namespace_id, date); +CREATE UNIQUE INDEX index_ci_pending_builds_on_build_id ON ci_pending_builds USING btree (build_id); + +CREATE INDEX index_ci_pending_builds_on_project_id ON ci_pending_builds USING btree (project_id); + +CREATE INDEX index_ci_pipeline_artifacts_failed_verification ON ci_pipeline_artifacts USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_ci_pipeline_artifacts_needs_verification ON ci_pipeline_artifacts USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE INDEX index_ci_pipeline_artifacts_on_expire_at ON ci_pipeline_artifacts USING btree (expire_at); CREATE INDEX index_ci_pipeline_artifacts_on_pipeline_id ON ci_pipeline_artifacts USING btree (pipeline_id); @@ -22093,6 +23483,10 @@ CREATE UNIQUE INDEX index_ci_pipeline_artifacts_on_pipeline_id_and_file_type ON CREATE INDEX index_ci_pipeline_artifacts_on_project_id ON ci_pipeline_artifacts USING btree (project_id); +CREATE INDEX index_ci_pipeline_artifacts_pending_verification ON ci_pipeline_artifacts USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + +CREATE INDEX index_ci_pipeline_artifacts_verification_state ON ci_pipeline_artifacts USING btree (verification_state); + CREATE INDEX index_ci_pipeline_chat_data_on_chat_name_id ON ci_pipeline_chat_data USING btree (chat_name_id); CREATE UNIQUE INDEX index_ci_pipeline_chat_data_on_pipeline_id ON ci_pipeline_chat_data USING btree (pipeline_id); @@ -22105,6 +23499,8 @@ CREATE INDEX index_ci_pipeline_schedules_on_next_run_at_and_active ON ci_pipelin CREATE INDEX index_ci_pipeline_schedules_on_owner_id ON ci_pipeline_schedules USING btree (owner_id); +CREATE INDEX index_ci_pipeline_schedules_on_owner_id_and_id_and_active ON ci_pipeline_schedules USING btree (owner_id, id) WHERE (active = true); + CREATE INDEX index_ci_pipeline_schedules_on_project_id ON ci_pipeline_schedules USING btree (project_id); CREATE UNIQUE INDEX index_ci_pipeline_variables_on_pipeline_id_and_key ON ci_pipeline_variables USING btree (pipeline_id, key); @@ -22149,6 +23545,8 @@ CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_config_source ON c CREATE INDEX index_ci_pipelines_on_user_id_and_created_at_and_source ON ci_pipelines USING btree (user_id, created_at, source); +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 UNIQUE INDEX index_ci_project_monthly_usages_on_project_id_and_date ON ci_project_monthly_usages USING btree (project_id, date); CREATE UNIQUE INDEX index_ci_refs_on_project_id_and_ref_path ON ci_refs USING btree (project_id, ref_path); @@ -22167,7 +23565,15 @@ CREATE INDEX index_ci_runner_projects_on_project_id ON ci_runner_projects USING 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 ON ci_runners USING btree (contacted_at); +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_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_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); CREATE INDEX index_ci_runners_on_locked ON ci_runners USING btree (locked); @@ -22177,6 +23583,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 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_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); @@ -22193,6 +23605,8 @@ CREATE UNIQUE INDEX index_ci_sources_projects_on_source_project_id_and_pipeline_ CREATE INDEX index_ci_stages_on_pipeline_id ON ci_stages USING btree (pipeline_id); +CREATE INDEX index_ci_stages_on_pipeline_id_and_id ON ci_stages USING btree (pipeline_id, id) WHERE (status = ANY (ARRAY[0, 1, 2, 8, 9, 10])); + CREATE UNIQUE INDEX index_ci_stages_on_pipeline_id_and_name ON ci_stages USING btree (pipeline_id, name); CREATE INDEX index_ci_stages_on_pipeline_id_and_position ON ci_stages USING btree (pipeline_id, "position"); @@ -22215,11 +23629,15 @@ CREATE INDEX index_ci_triggers_on_owner_id ON ci_triggers USING btree (owner_id) CREATE INDEX index_ci_triggers_on_project_id ON ci_triggers USING btree (project_id); +CREATE INDEX index_ci_unit_test_failures_on_build_id ON ci_unit_test_failures USING btree (build_id); + +CREATE UNIQUE INDEX index_ci_unit_tests_on_project_id_and_key_hash ON ci_unit_tests USING btree (project_id, key_hash); + 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 ON cluster_agent_tokens USING btree (agent_id); +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); @@ -22323,12 +23741,16 @@ CREATE INDEX index_dast_profiles_on_dast_site_profile_id ON dast_profiles USING CREATE UNIQUE INDEX index_dast_profiles_on_project_id_and_name ON dast_profiles USING btree (project_id, name); +CREATE UNIQUE INDEX index_dast_profiles_pipelines_on_ci_pipeline_id ON dast_profiles_pipelines USING btree (ci_pipeline_id); + CREATE UNIQUE INDEX index_dast_scanner_profiles_on_project_id_and_name ON dast_scanner_profiles USING btree (project_id, name); CREATE INDEX index_dast_site_profiles_on_dast_site_id ON dast_site_profiles USING btree (dast_site_id); CREATE UNIQUE INDEX index_dast_site_profiles_on_project_id_and_name ON dast_site_profiles USING btree (project_id, name); +CREATE UNIQUE INDEX index_dast_site_profiles_pipelines_on_ci_pipeline_id ON dast_site_profiles_pipelines USING btree (ci_pipeline_id); + CREATE INDEX index_dast_site_tokens_on_project_id ON dast_site_tokens USING btree (project_id); CREATE INDEX index_dast_site_validations_on_dast_site_token_id ON dast_site_validations USING btree (dast_site_token_id); @@ -22371,12 +23793,18 @@ CREATE INDEX index_deployments_on_environment_id_and_id ON deployments USING btr CREATE INDEX index_deployments_on_environment_id_and_iid_and_project_id ON deployments USING btree (environment_id, iid, project_id); +CREATE INDEX index_deployments_on_environment_id_status_and_finished_at ON deployments USING btree (environment_id, status, finished_at); + +CREATE INDEX index_deployments_on_environment_id_status_and_id ON deployments USING btree (environment_id, status, id); + CREATE INDEX index_deployments_on_environment_status_sha ON deployments USING btree (environment_id, status, sha); CREATE INDEX index_deployments_on_id_and_status_and_created_at ON deployments USING btree (id, status, created_at); CREATE INDEX index_deployments_on_id_where_cluster_id_present ON deployments USING btree (id) WHERE (cluster_id IS NOT NULL); +CREATE INDEX index_deployments_on_project_and_environment_and_updated_at_id ON deployments USING btree (project_id, environment_id, updated_at, id); + CREATE INDEX index_deployments_on_project_and_finished ON deployments USING btree (project_id, finished_at) WHERE (status = 2); CREATE INDEX index_deployments_on_project_id_and_id ON deployments USING btree (project_id, id DESC); @@ -22433,6 +23861,8 @@ CREATE INDEX index_draft_notes_on_discussion_id ON draft_notes USING btree (disc CREATE INDEX index_draft_notes_on_merge_request_id ON draft_notes USING btree (merge_request_id); +CREATE UNIQUE INDEX index_elastic_index_settings_on_alias_name ON elastic_index_settings USING btree (alias_name); + CREATE INDEX index_elastic_reindexing_subtasks_on_elastic_reindexing_task_id ON elastic_reindexing_subtasks USING btree (elastic_reindexing_task_id); CREATE UNIQUE INDEX index_elastic_reindexing_tasks_on_in_progress ON elastic_reindexing_tasks USING btree (in_progress) WHERE in_progress; @@ -22455,12 +23885,16 @@ CREATE UNIQUE INDEX index_environments_on_project_id_and_name ON environments US CREATE UNIQUE INDEX index_environments_on_project_id_and_slug ON environments USING btree (project_id, slug); +CREATE INDEX index_environments_on_project_id_and_tier ON environments USING btree (project_id, tier) WHERE (tier IS NOT NULL); + CREATE INDEX index_environments_on_project_id_state_environment_type ON environments USING btree (project_id, state, environment_type); CREATE INDEX index_environments_on_state_and_auto_stop_at ON environments USING btree (state, auto_stop_at) WHERE ((auto_stop_at IS NOT NULL) AND ((state)::text = 'available'::text)); CREATE UNIQUE INDEX index_epic_board_list_preferences_on_user_and_list ON boards_epic_list_user_preferences USING btree (user_id, epic_list_id); +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); @@ -22485,8 +23919,6 @@ CREATE INDEX index_epics_on_due_date_sourcing_milestone_id ON epics USING btree CREATE INDEX index_epics_on_end_date ON epics USING btree (end_date); -CREATE INDEX index_epics_on_group_id ON epics USING btree (group_id); - CREATE UNIQUE INDEX index_epics_on_group_id_and_external_key ON epics USING btree (group_id, external_key) WHERE (external_key IS NOT NULL); CREATE UNIQUE INDEX index_epics_on_group_id_and_iid ON epics USING btree (group_id, iid); @@ -22531,7 +23963,7 @@ CREATE INDEX index_evidences_on_release_id ON evidences USING btree (release_id) CREATE INDEX index_experiment_subjects_on_experiment_id ON experiment_subjects USING btree (experiment_id); -CREATE INDEX index_experiment_subjects_on_group_id ON experiment_subjects USING btree (group_id); +CREATE INDEX index_experiment_subjects_on_namespace_id ON experiment_subjects USING btree (namespace_id); CREATE INDEX index_experiment_subjects_on_project_id ON experiment_subjects USING btree (project_id); @@ -22729,6 +24161,10 @@ CREATE INDEX index_import_failures_on_project_id_not_null ON import_failures USI CREATE INDEX index_imported_projects_on_import_type_creator_id_created_at ON projects USING btree (import_type, creator_id, created_at) WHERE (import_type IS NOT NULL); +CREATE INDEX index_in_product_marketing_emails_on_user_id ON in_product_marketing_emails USING btree (user_id); + +CREATE UNIQUE INDEX index_in_product_marketing_emails_on_user_track_series ON in_product_marketing_emails USING btree (user_id, track, series); + CREATE INDEX index_inc_mgmnt_oncall_participants_on_oncall_user_id ON incident_management_oncall_participants USING btree (user_id); CREATE UNIQUE INDEX index_inc_mgmnt_oncall_participants_on_user_id_and_rotation_id ON incident_management_oncall_participants USING btree (user_id, oncall_rotation_id); @@ -22837,6 +24273,8 @@ CREATE INDEX index_jira_imports_on_user_id ON jira_imports USING btree (user_id) CREATE INDEX index_jira_tracker_data_on_service_id ON jira_tracker_data USING btree (service_id); +CREATE INDEX index_keys_on_expires_at_and_expiry_notification_undelivered ON keys USING btree (date(timezone('UTC'::text, expires_at)), expiry_notification_delivered_at) WHERE (expiry_notification_delivered_at IS NULL); + CREATE UNIQUE INDEX index_keys_on_fingerprint ON keys USING btree (fingerprint); CREATE INDEX index_keys_on_fingerprint_sha256 ON keys USING btree (fingerprint_sha256); @@ -22915,10 +24353,12 @@ 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); -CREATE INDEX index_members_on_user_id ON members USING btree (user_id); +CREATE INDEX index_members_on_user_id_and_access_level_requested_at_is_null ON members USING btree (user_id, access_level) WHERE (requested_at IS NULL); CREATE INDEX index_members_on_user_id_created_at ON members USING btree (user_id, created_at) WHERE ((ldap = true) AND ((type)::text = 'GroupMember'::text) AND ((source_type)::text = 'Namespace'::text)); +CREATE INDEX index_members_on_user_id_source_id_source_type ON members USING btree (user_id, source_id, source_type); + CREATE INDEX index_merge_request_assignees_on_merge_request_id ON merge_request_assignees USING btree (merge_request_id); CREATE UNIQUE INDEX index_merge_request_assignees_on_merge_request_id_and_user_id ON merge_request_assignees USING btree (merge_request_id, user_id); @@ -22931,10 +24371,20 @@ CREATE UNIQUE INDEX index_merge_request_cleanup_schedules_on_merge_request_id ON 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); +CREATE INDEX index_merge_request_diff_details_failed_verification ON merge_request_diff_details USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_merge_request_diff_details_needs_verification ON merge_request_diff_details USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE INDEX index_merge_request_diff_details_on_merge_request_diff_id ON merge_request_diff_details USING btree (merge_request_diff_id); +CREATE INDEX index_merge_request_diff_details_on_verification_state ON merge_request_diff_details USING btree (verification_state); + +CREATE INDEX index_merge_request_diff_details_pending_verification ON merge_request_diff_details USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE INDEX index_merge_request_diffs_by_id_partial ON merge_request_diffs USING btree (id) WHERE ((files_count > 0) AND ((NOT stored_externally) OR (stored_externally IS NULL))); CREATE INDEX index_merge_request_diffs_on_external_diff_store ON merge_request_diffs USING btree (external_diff_store); @@ -23003,6 +24453,8 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_iid_and_state_id ON m CREATE INDEX index_merge_requests_on_target_project_id_and_iid_jira_title ON merge_requests USING btree (target_project_id, iid) WHERE ((title)::text ~ '[A-Z][A-Z_0-9]+-\d+'::text); +CREATE INDEX index_merge_requests_on_target_project_id_and_source_branch ON merge_requests USING btree (target_project_id, source_branch); + CREATE INDEX index_merge_requests_on_target_project_id_and_squash_commit_sha ON merge_requests USING btree (target_project_id, squash_commit_sha); CREATE INDEX index_merge_requests_on_target_project_id_and_target_branch ON merge_requests USING btree (target_project_id, target_branch) WHERE ((state_id = 1) AND (merge_when_pipeline_succeeds = true)); @@ -23031,6 +24483,8 @@ CREATE INDEX index_metrics_dashboard_annotations_on_timespan_end ON metrics_dash CREATE INDEX index_metrics_users_starred_dashboards_on_project_id ON metrics_users_starred_dashboards USING btree (project_id); +CREATE INDEX index_migration_jobs_on_migration_id_and_finished_at ON batched_background_migration_jobs USING btree (batched_background_migration_id, finished_at); + CREATE INDEX index_milestone_releases_on_release_id ON milestone_releases USING btree (release_id); CREATE INDEX index_milestones_on_description_trigram ON milestones USING gin (description gin_trgm_ops); @@ -23045,7 +24499,7 @@ CREATE INDEX index_milestones_on_title ON milestones USING btree (title); CREATE INDEX index_milestones_on_title_trigram ON milestones USING gin (title gin_trgm_ops); -CREATE INDEX index_mirror_data_on_next_execution_and_retry_count ON project_mirror_data USING btree (next_execution_timestamp, retry_count); +CREATE INDEX index_mirror_data_non_scheduled_or_started ON project_mirror_data USING btree (next_execution_timestamp, retry_count) WHERE ((status)::text <> ALL ('{scheduled,started}'::text[])); CREATE UNIQUE INDEX index_mr_blocks_on_blocking_and_blocked_mr_ids ON merge_request_blocks USING btree (blocking_merge_request_id, blocked_merge_request_id); @@ -23065,6 +24519,10 @@ CREATE UNIQUE INDEX index_namespace_root_storage_statistics_on_namespace_id ON n CREATE UNIQUE INDEX index_namespace_statistics_on_namespace_id ON namespace_statistics USING btree (namespace_id); +CREATE INDEX index_namespaces_id_parent_id_is_not_null ON namespaces USING btree (id) WHERE (parent_id IS NOT NULL); + +CREATE INDEX index_namespaces_id_parent_id_is_null ON namespaces USING btree (id) WHERE (parent_id IS NULL); + CREATE INDEX index_namespaces_on_created_at ON namespaces USING btree (created_at); CREATE INDEX index_namespaces_on_custom_project_templates_group_id_and_type ON namespaces USING btree (custom_project_templates_group_id, type) WHERE (custom_project_templates_group_id IS NOT NULL); @@ -23097,12 +24555,16 @@ CREATE UNIQUE INDEX index_namespaces_on_runners_token_encrypted ON namespaces US CREATE INDEX index_namespaces_on_shared_and_extra_runners_minutes_limit ON namespaces USING btree (shared_runners_minutes_limit, extra_shared_runners_minutes_limit); +CREATE INDEX index_namespaces_on_traversal_ids ON namespaces USING gin (traversal_ids); + CREATE INDEX index_namespaces_on_type_and_id_partial ON namespaces USING btree (type, id) WHERE (type IS NOT NULL); CREATE INDEX index_non_requested_project_members_on_source_id_and_type ON members USING btree (source_id, source_type) WHERE ((requested_at IS NULL) AND ((type)::text = 'ProjectMember'::text)); CREATE UNIQUE INDEX index_note_diff_files_on_diff_note_id ON note_diff_files USING btree (diff_note_id); +CREATE INDEX index_notes_for_cherry_picked_merge_requests ON notes USING btree (project_id, commit_id) WHERE ((noteable_type)::text = 'MergeRequest'::text); + CREATE INDEX index_notes_on_author_id_and_created_at_and_id ON notes USING btree (author_id, created_at, id); CREATE INDEX index_notes_on_commit_id ON notes USING btree (commit_id); @@ -23123,9 +24585,7 @@ CREATE INDEX index_notes_on_project_id_and_noteable_type ON notes USING btree (p CREATE INDEX index_notes_on_review_id ON notes USING btree (review_id); -CREATE INDEX index_notification_settings_on_source_id_and_source_type ON notification_settings USING btree (source_id, source_type); - -CREATE INDEX index_notification_settings_on_user_id ON notification_settings USING btree (user_id); +CREATE INDEX index_notification_settings_on_source_and_level_and_user ON notification_settings USING btree (source_id, source_type, level, user_id); CREATE UNIQUE INDEX index_notifications_on_user_id_and_source_id_and_source_type ON notification_settings USING btree (user_id, source_id, source_type); @@ -23149,11 +24609,9 @@ CREATE INDEX index_oauth_openid_requests_on_access_grant_id ON oauth_openid_requ CREATE UNIQUE INDEX index_on_deploy_keys_id_and_type_and_public ON keys USING btree (id, type) WHERE (public = true); -CREATE INDEX index_on_id_partial_with_legacy_storage ON projects USING btree (id) WHERE ((storage_version < 2) OR (storage_version IS NULL)); - CREATE INDEX index_on_identities_lower_extern_uid_and_provider ON identities USING btree (lower((extern_uid)::text), provider); -CREATE UNIQUE INDEX index_on_instance_statistics_recorded_at_and_identifier ON analytics_instance_statistics_measurements USING btree (identifier, recorded_at); +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_label_links_all_columns ON label_links USING btree (target_id, label_id, target_type); @@ -23165,15 +24623,17 @@ CREATE INDEX index_on_namespaces_lower_name ON namespaces USING btree (lower((na CREATE INDEX index_on_namespaces_lower_path ON namespaces USING btree (lower((path)::text)); -CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path)::text)); +CREATE INDEX index_on_oncall_schedule_escalation_rule ON incident_management_escalation_rules USING btree (oncall_schedule_id); -CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text)); +CREATE INDEX index_on_pages_metadata_not_migrated ON project_pages_metadata USING btree (project_id) WHERE ((deployed = true) AND (pages_deployment_id IS NULL)); -CREATE UNIQUE INDEX index_on_segment_selections_group_id_segment_id ON analytics_devops_adoption_segment_selections USING btree (group_id, segment_id); +CREATE UNIQUE INDEX index_on_policy_schedule_status_elapsed_time_escalation_rules ON incident_management_escalation_rules USING btree (policy_id, oncall_schedule_id, status, elapsed_time_seconds); -CREATE UNIQUE INDEX index_on_segment_selections_project_id_segment_id ON analytics_devops_adoption_segment_selections USING btree (project_id, segment_id); +CREATE UNIQUE INDEX index_on_project_id_escalation_policy_name_unique ON incident_management_escalation_policies USING btree (project_id, name); -CREATE INDEX index_on_segment_selections_segment_id ON analytics_devops_adoption_segment_selections USING btree (segment_id); +CREATE INDEX index_on_projects_lower_path ON projects USING btree (lower((path)::text)); + +CREATE INDEX index_on_routes_lower_path ON routes USING btree (lower((path)::text)); CREATE INDEX index_on_snapshots_segment_id_end_time ON analytics_devops_adoption_snapshots USING btree (segment_id, end_time); @@ -23251,8 +24711,12 @@ CREATE INDEX index_packages_dependency_links_on_dependency_id ON packages_depend CREATE INDEX index_packages_events_on_package_id ON packages_events USING btree (package_id); +CREATE INDEX index_packages_helm_file_metadata_on_channel ON packages_helm_file_metadata USING btree (channel); + CREATE INDEX index_packages_maven_metadata_on_package_id_and_path ON packages_maven_metadata USING btree (package_id, path); +CREATE INDEX index_packages_maven_metadata_on_path ON packages_maven_metadata USING btree (path); + 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); @@ -23291,6 +24755,8 @@ CREATE INDEX index_packages_tags_on_package_id_and_updated_at ON packages_tags U CREATE INDEX index_pages_deployments_on_ci_build_id ON pages_deployments USING btree (ci_build_id); +CREATE INDEX index_pages_deployments_on_file_store_and_id ON pages_deployments USING btree (file_store, id); + CREATE INDEX index_pages_deployments_on_project_id ON pages_deployments USING btree (project_id); CREATE INDEX index_pages_domain_acme_orders_on_challenge_token ON pages_domain_acme_orders USING btree (challenge_token); @@ -23579,6 +25045,8 @@ CREATE INDEX index_protected_environment_deploy_access_levels_on_group_id ON pro CREATE INDEX index_protected_environment_deploy_access_levels_on_user_id ON protected_environment_deploy_access_levels USING btree (user_id); +CREATE UNIQUE INDEX index_protected_environments_on_group_id_and_name ON protected_environments USING btree (group_id, name) WHERE (group_id IS NOT NULL); + CREATE INDEX index_protected_environments_on_project_id ON protected_environments USING btree (project_id); CREATE UNIQUE INDEX index_protected_environments_on_project_id_and_name ON protected_environments USING btree (project_id, name); @@ -23755,6 +25223,8 @@ CREATE INDEX index_service_desk_enabled_projects_on_id_creator_id_created_at ON CREATE INDEX index_services_on_inherit_from_id ON services USING btree (inherit_from_id); +CREATE INDEX index_services_on_project_and_type_where_inherit_null ON services USING btree (project_id, type) WHERE (inherit_from_id IS NULL); + CREATE UNIQUE INDEX index_services_on_project_id_and_type_unique ON services USING btree (project_id, type); CREATE INDEX index_services_on_template ON services USING btree (template); @@ -23771,6 +25241,8 @@ CREATE UNIQUE INDEX index_services_on_unique_group_id_and_type ON services USING CREATE UNIQUE INDEX index_shards_on_name ON shards USING btree (name); +CREATE UNIQUE INDEX index_site_profile_secret_variables_on_site_profile_id_and_key ON dast_site_profile_secret_variables USING btree (dast_site_profile_id, key); + CREATE INDEX index_slack_integrations_on_service_id ON slack_integrations USING btree (service_id); CREATE UNIQUE INDEX index_slack_integrations_on_team_id_and_alias ON slack_integrations USING btree (team_id, alias); @@ -23781,10 +25253,18 @@ CREATE INDEX index_smartcard_identities_on_user_id ON smartcard_identities USING CREATE INDEX index_snippet_on_id_and_project_id ON snippets USING btree (id, project_id); +CREATE INDEX index_snippet_repositories_failed_verification ON snippet_repositories USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_snippet_repositories_needs_verification ON snippet_repositories USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE UNIQUE INDEX index_snippet_repositories_on_disk_path ON snippet_repositories USING btree (disk_path); CREATE INDEX index_snippet_repositories_on_shard_id ON snippet_repositories USING btree (shard_id); +CREATE INDEX index_snippet_repositories_pending_verification ON snippet_repositories USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + +CREATE INDEX index_snippet_repositories_verification_state ON snippet_repositories USING btree (verification_state); + CREATE INDEX index_snippet_repository_storage_moves_on_snippet_id ON snippet_repository_storage_moves USING btree (snippet_id); CREATE UNIQUE INDEX index_snippet_user_mentions_on_note_id ON snippet_user_mentions USING btree (note_id) WHERE (note_id IS NOT NULL); @@ -23821,7 +25301,13 @@ CREATE UNIQUE INDEX index_software_licenses_on_unique_name ON software_licenses CREATE UNIQUE INDEX index_sop_configs_on_project_id ON security_orchestration_policy_configurations USING btree (project_id); -CREATE UNIQUE INDEX index_sop_configs_on_security_policy_management_project_id ON security_orchestration_policy_configurations USING btree (security_policy_management_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); + +CREATE INDEX index_sop_schedules_on_user_id ON security_orchestration_policy_rule_schedules USING btree (user_id); + +CREATE INDEX index_spam_logs_on_user_id ON spam_logs USING btree (user_id); CREATE INDEX index_sprints_iterations_cadence_id ON sprints USING btree (iterations_cadence_id); @@ -23831,7 +25317,7 @@ 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_group_id_and_title ON sprints USING btree (group_id, title) WHERE (group_id IS NOT NULL); +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); @@ -23841,6 +25327,10 @@ 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); +CREATE INDEX index_status_check_responses_on_external_approval_rule_id ON status_check_responses USING btree (external_approval_rule_id); + +CREATE INDEX index_status_check_responses_on_merge_request_id ON status_check_responses USING btree (merge_request_id); + CREATE UNIQUE INDEX index_status_page_published_incidents_on_issue_id ON status_page_published_incidents USING btree (issue_id); CREATE INDEX index_status_page_settings_on_project_id ON status_page_settings USING btree (project_id); @@ -23873,12 +25363,20 @@ CREATE INDEX index_term_agreements_on_term_id ON term_agreements USING btree (te CREATE INDEX index_term_agreements_on_user_id ON term_agreements USING btree (user_id); +CREATE INDEX index_terraform_state_versions_failed_verification ON terraform_state_versions USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_terraform_state_versions_needs_verification ON terraform_state_versions USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + CREATE INDEX index_terraform_state_versions_on_ci_build_id ON terraform_state_versions USING btree (ci_build_id); CREATE INDEX index_terraform_state_versions_on_created_by_user_id ON terraform_state_versions USING btree (created_by_user_id); CREATE UNIQUE INDEX index_terraform_state_versions_on_state_id_and_version ON terraform_state_versions USING btree (terraform_state_id, version); +CREATE INDEX index_terraform_state_versions_on_verification_state ON terraform_state_versions USING btree (verification_state); + +CREATE INDEX index_terraform_state_versions_pending_verification ON terraform_state_versions USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE INDEX index_terraform_states_on_file_store ON terraform_states USING btree (file_store); CREATE INDEX index_terraform_states_on_locked_by_user_id ON terraform_states USING btree (locked_by_user_id); @@ -23895,6 +25393,8 @@ CREATE INDEX index_timelogs_on_merge_request_id ON timelogs USING btree (merge_r CREATE INDEX index_timelogs_on_note_id ON timelogs USING btree (note_id); +CREATE INDEX index_timelogs_on_project_id_and_spent_at ON timelogs USING btree (project_id, spent_at); + CREATE INDEX index_timelogs_on_spent_at ON timelogs USING btree (spent_at) WHERE (spent_at IS NOT NULL); CREATE INDEX index_timelogs_on_user_id ON timelogs USING btree (user_id); @@ -23931,6 +25431,12 @@ CREATE INDEX index_u2f_registrations_on_user_id ON u2f_registrations USING btree CREATE UNIQUE INDEX index_unique_issue_metrics_issue_id ON issue_metrics USING btree (issue_id); +CREATE INDEX index_unit_test_failures_failed_at ON ci_unit_test_failures USING btree (failed_at DESC); + +CREATE UNIQUE INDEX index_unit_test_failures_unique_columns ON ci_unit_test_failures USING btree (unit_test_id, failed_at DESC, build_id); + +CREATE UNIQUE INDEX index_upcoming_reconciliations_on_namespace_id ON upcoming_reconciliations USING btree (namespace_id); + CREATE INDEX index_uploads_on_checksum ON uploads USING btree (checksum); CREATE INDEX index_uploads_on_model_id_and_model_type ON uploads USING btree (model_id, model_type); @@ -23991,6 +25497,8 @@ CREATE INDEX index_users_on_feed_token ON users USING btree (feed_token); CREATE INDEX index_users_on_group_view ON users USING btree (group_view); +CREATE INDEX index_users_on_id_and_last_activity_on_for_non_internal_active ON users USING btree (id, last_activity_on) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[NULL::integer, 6, 4])))); + CREATE INDEX index_users_on_incoming_email_token ON users USING btree (incoming_email_token); CREATE INDEX index_users_on_managing_group_id ON users USING btree (managing_group_id); @@ -24025,6 +25533,8 @@ CREATE INDEX index_users_ops_dashboard_projects_on_project_id ON users_ops_dashb CREATE UNIQUE INDEX index_users_ops_dashboard_projects_on_user_id_and_project_id ON users_ops_dashboard_projects USING btree (user_id, project_id); +CREATE INDEX index_users_require_two_factor_authentication_from_group_false ON users USING btree (require_two_factor_authentication_from_group) WHERE (require_two_factor_authentication_from_group = false); + CREATE INDEX index_users_security_dashboard_projects_on_user_id ON users_security_dashboard_projects USING btree (user_id); CREATE INDEX index_users_star_projects_on_project_id ON users_star_projects USING btree (project_id); @@ -24083,7 +25593,7 @@ CREATE INDEX index_vulnerability_feedback_on_merge_request_id ON vulnerability_f CREATE INDEX index_vulnerability_feedback_on_pipeline_id ON vulnerability_feedback USING btree (pipeline_id); -CREATE INDEX index_vulnerability_finding_fingerprints_on_finding_id ON vulnerability_finding_fingerprints USING btree (finding_id); +CREATE INDEX index_vulnerability_finding_signatures_on_finding_id ON vulnerability_finding_signatures USING btree (finding_id); CREATE INDEX index_vulnerability_findings_remediations_on_remediation_id ON vulnerability_findings_remediations USING btree (vulnerability_remediation_id); @@ -24101,6 +25611,8 @@ CREATE UNIQUE INDEX index_vulnerability_occurrence_identifiers_on_unique_keys ON CREATE INDEX index_vulnerability_occurrence_pipelines_on_pipeline_id ON vulnerability_occurrence_pipelines USING btree (pipeline_id); +CREATE INDEX index_vulnerability_occurrences_deduplication ON vulnerability_occurrences USING btree (project_id, report_type, project_fingerprint); + 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_primary_identifier_id ON vulnerability_occurrences USING btree (primary_identifier_id); @@ -24119,6 +25631,8 @@ CREATE UNIQUE INDEX index_vulnerability_remediations_on_project_id_and_checksum CREATE UNIQUE INDEX index_vulnerability_scanners_on_project_id_and_external_id ON vulnerability_scanners USING btree (project_id, external_id); +CREATE INDEX index_vulnerability_statistics_on_latest_pipeline_id ON vulnerability_statistics USING btree (latest_pipeline_id); + CREATE INDEX index_vulnerability_statistics_on_letter_grade ON vulnerability_statistics USING btree (letter_grade); CREATE UNIQUE INDEX index_vulnerability_statistics_on_unique_project_id ON vulnerability_statistics USING btree (project_id); @@ -24129,14 +25643,16 @@ CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id ON vulnerabili CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id_and_note_id ON vulnerability_user_mentions USING btree (vulnerability_id, note_id); -CREATE INDEX index_web_hook_logs_on_created_at_and_web_hook_id ON web_hook_logs USING btree (created_at, web_hook_id); +CREATE INDEX index_web_hook_logs_on_created_at_and_web_hook_id ON web_hook_logs_archived USING btree (created_at, web_hook_id); -CREATE INDEX index_web_hook_logs_on_web_hook_id ON web_hook_logs USING btree (web_hook_id); +CREATE INDEX index_web_hook_logs_on_web_hook_id ON web_hook_logs_archived USING btree (web_hook_id); CREATE INDEX index_web_hooks_on_group_id ON web_hooks USING btree (group_id) WHERE ((type)::text = 'GroupHook'::text); CREATE INDEX index_web_hooks_on_project_id ON web_hooks USING btree (project_id); +CREATE INDEX index_web_hooks_on_project_id_recent_failures ON web_hooks USING btree (project_id, recent_failures); + CREATE INDEX index_web_hooks_on_service_id ON web_hooks USING btree (service_id); CREATE INDEX index_web_hooks_on_type ON web_hooks USING btree (type); @@ -24203,6 +25719,10 @@ CREATE INDEX packages_packages_needs_verification ON packages_package_files USIN CREATE INDEX packages_packages_pending_verification ON packages_package_files USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); +CREATE UNIQUE INDEX partial_index_bulk_import_exports_on_group_id_and_relation ON bulk_import_exports USING btree (group_id, relation) WHERE (group_id IS NOT NULL); + +CREATE UNIQUE INDEX partial_index_bulk_import_exports_on_project_id_and_relation ON bulk_import_exports USING btree (project_id, relation) WHERE (project_id IS NOT NULL); + CREATE INDEX partial_index_ci_builds_on_scheduled_at_with_scheduled_jobs ON ci_builds USING btree (scheduled_at) WHERE ((scheduled_at IS NOT NULL) AND ((type)::text = 'Ci::Build'::text) AND ((status)::text = 'scheduled'::text)); CREATE INDEX partial_index_deployments_for_legacy_successful_deployments ON deployments USING btree (id) WHERE ((finished_at IS NULL) AND (status = 2)); @@ -24215,8 +25735,6 @@ CREATE UNIQUE INDEX snippet_user_mentions_on_snippet_id_index ON snippet_user_me CREATE UNIQUE INDEX taggings_idx ON taggings USING btree (tag_id, taggable_id, taggable_type, context, tagger_id, tagger_type); -CREATE INDEX temporary_index_vulnerabilities_on_id ON vulnerabilities USING btree (id) WHERE ((state = 2) AND ((dismissed_at IS NULL) OR (dismissed_by_id IS NULL))); - CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree (user_id, term_id); CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint, primary_identifier_id, id); @@ -24257,6 +25775,102 @@ 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); +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; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_000000_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202212_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202301_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202302_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202303_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202304_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202305_pkey; + +ALTER INDEX analytics_index_audit_events_part_on_created_at_and_author_id ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306_created_at_author_id_idx; + +ALTER INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306_entity_id_entity_type_id_author_id_crea_idx; + +ALTER INDEX audit_events_pkey ATTACH PARTITION gitlab_partitions_dynamic.audit_events_202306_pkey; + +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; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_80bf138a51; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_962081978f; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_eecfac613f; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.index_fdb8d5eeea; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_000000_pkey; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202212_pkey; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202301_pkey; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202302_web_hook_id_idx; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202303_web_hook_id_idx; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202304_web_hook_id_idx; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202305_web_hook_id_idx; + +ALTER INDEX index_web_hook_logs_part_on_created_at_and_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_created_at_web_hook_id_idx; + +ALTER INDEX web_hook_logs_pkey ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_pkey; + +ALTER INDEX index_web_hook_logs_part_on_web_hook_id ATTACH PARTITION gitlab_partitions_dynamic.web_hook_logs_202306_web_hook_id_idx; + 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; @@ -24513,7 +26127,33 @@ ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_p ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_63_pkey; -CREATE TRIGGER table_sync_trigger_ee39a25f9d AFTER INSERT OR DELETE OR UPDATE ON audit_events FOR EACH ROW EXECUTE FUNCTION table_sync_function_2be879775d(); +CREATE TRIGGER table_sync_trigger_b99eb6998c AFTER INSERT OR DELETE OR UPDATE ON web_hook_logs FOR EACH ROW EXECUTE FUNCTION table_sync_function_29bc99d6db(); + +CREATE TRIGGER trigger_07c94931164e BEFORE INSERT OR UPDATE ON push_event_payloads FOR EACH ROW EXECUTE FUNCTION trigger_07c94931164e(); + +CREATE TRIGGER trigger_21e7a2602957 BEFORE INSERT OR UPDATE ON ci_build_needs FOR EACH ROW EXECUTE FUNCTION trigger_21e7a2602957(); + +CREATE TRIGGER trigger_3f6129be01d2 BEFORE INSERT OR UPDATE ON ci_builds FOR EACH ROW EXECUTE FUNCTION trigger_3f6129be01d2(); + +CREATE TRIGGER trigger_51ab7cef8934 BEFORE INSERT OR UPDATE ON ci_builds_runner_session FOR EACH ROW EXECUTE FUNCTION trigger_51ab7cef8934(); + +CREATE TRIGGER trigger_69523443cc10 BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_69523443cc10(); + +CREATE TRIGGER trigger_77f5e1d20482 BEFORE INSERT OR UPDATE ON deployments FOR EACH ROW EXECUTE FUNCTION trigger_77f5e1d20482(); + +CREATE TRIGGER trigger_8485e97c00e3 BEFORE INSERT OR UPDATE ON ci_sources_pipelines FOR EACH ROW EXECUTE FUNCTION trigger_8485e97c00e3(); + +CREATE TRIGGER trigger_8487d4de3e7b BEFORE INSERT OR UPDATE ON ci_builds_metadata FOR EACH ROW EXECUTE FUNCTION trigger_8487d4de3e7b(); + +CREATE TRIGGER trigger_91dc388a5fe6 BEFORE INSERT OR UPDATE ON ci_build_trace_sections FOR EACH ROW EXECUTE FUNCTION trigger_91dc388a5fe6(); + +CREATE TRIGGER trigger_aebe8b822ad3 BEFORE INSERT OR UPDATE ON taggings FOR EACH ROW EXECUTE FUNCTION trigger_aebe8b822ad3(); + +CREATE TRIGGER trigger_be1804f21693 BEFORE INSERT OR UPDATE ON ci_job_artifacts FOR EACH ROW EXECUTE FUNCTION trigger_be1804f21693(); + +CREATE TRIGGER trigger_cf2f9e35f002 BEFORE INSERT OR UPDATE ON ci_build_trace_chunks FOR EACH ROW EXECUTE FUNCTION trigger_cf2f9e35f002(); + +CREATE TRIGGER trigger_f1ca8ec18d78 BEFORE INSERT OR UPDATE ON geo_job_artifact_deleted_events FOR EACH ROW EXECUTE FUNCTION trigger_f1ca8ec18d78(); CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker(); @@ -24566,9 +26206,15 @@ ALTER TABLE ONLY notification_settings ALTER TABLE ONLY lists ADD CONSTRAINT fk_0d3f677137 FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_unit_test_failures + ADD CONSTRAINT fk_0f09856e1f FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_pages_metadata ADD CONSTRAINT fk_0fd5b22688 FOREIGN KEY (pages_deployment_id) REFERENCES pages_deployments(id) ON DELETE SET NULL; +ALTER TABLE ONLY status_check_responses + ADD CONSTRAINT fk_116e7e7369 FOREIGN KEY (external_approval_rule_id) REFERENCES external_approval_rules(id) ON DELETE CASCADE; + ALTER TABLE ONLY group_deletion_schedules ADD CONSTRAINT fk_11e3ebfcdd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -24596,6 +26242,9 @@ ALTER TABLE ONLY project_features ALTER TABLE ONLY ci_pipelines ADD CONSTRAINT fk_190998ef09 FOREIGN KEY (external_pull_request_id) REFERENCES external_pull_requests(id) ON DELETE SET NULL; +ALTER TABLE ONLY analytics_devops_adoption_segments + ADD CONSTRAINT fk_190a24754d FOREIGN KEY (display_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY user_details ADD CONSTRAINT fk_190e4fcc88 FOREIGN KEY (provisioned_by_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; @@ -24647,6 +26296,9 @@ ALTER TABLE ONLY notes ALTER TABLE ONLY members ADD CONSTRAINT fk_2e88fb7ce9 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY lfs_objects_projects + ADD CONSTRAINT fk_2eb33f7a78 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE NOT VALID; + ALTER TABLE ONLY lists ADD CONSTRAINT fk_30f2a831f4 FOREIGN KEY (iteration_id) REFERENCES sprints(id) ON DELETE CASCADE; @@ -24656,15 +26308,15 @@ 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 merge_requests - ADD CONSTRAINT fk_3308fe130c FOREIGN KEY (source_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; +ALTER TABLE ONLY in_product_marketing_emails + ADD CONSTRAINT fk_35c9101b63 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY epics ADD CONSTRAINT fk_3654b61b03 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; @@ -24674,11 +26326,14 @@ ALTER TABLE ONLY sprints ALTER TABLE ONLY push_event_payloads ADD CONSTRAINT fk_36c74129da FOREIGN KEY (event_id) REFERENCES events(id) ON DELETE CASCADE; +ALTER TABLE ONLY bulk_import_exports + ADD CONSTRAINT fk_39c726d3b5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_3a9eaa254d FOREIGN KEY (stage_id) REFERENCES ci_stages(id) ON DELETE CASCADE; ALTER TABLE ONLY issues - ADD CONSTRAINT fk_3b8c72ea56 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE CASCADE; + ADD CONSTRAINT fk_3b8c72ea56 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE SET NULL; ALTER TABLE ONLY epics ADD CONSTRAINT fk_3c1fd1cccc FOREIGN KEY (due_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -24713,6 +26368,12 @@ 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; + ALTER TABLE ONLY merge_request_metrics ADD CONSTRAINT fk_56067dcb44 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24794,9 +26455,15 @@ ALTER TABLE ONLY users ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_78a6492f68 FOREIGN KEY (repository_updated_event_id) REFERENCES geo_repository_updated_events(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_devops_adoption_snapshots + ADD CONSTRAINT fk_78c9eac821 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + 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; @@ -24810,7 +26477,7 @@ ALTER TABLE ONLY labels ADD CONSTRAINT fk_7de4989a69 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY merge_requests - ADD CONSTRAINT fk_7e85395a64 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE CASCADE; + ADD CONSTRAINT fk_7e85395a64 FOREIGN KEY (sprint_id) REFERENCES sprints(id) ON DELETE SET NULL; ALTER TABLE ONLY merge_request_metrics ADD CONSTRAINT fk_7f28d925f3 FOREIGN KEY (merged_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -24827,6 +26494,9 @@ ALTER TABLE ONLY import_export_uploads ALTER TABLE ONLY push_rules ADD CONSTRAINT fk_83b29894de FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY experiment_subjects + ADD CONSTRAINT fk_842649f2f5 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_request_diffs ADD CONSTRAINT fk_8483f3258f FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; @@ -24842,9 +26512,6 @@ ALTER TABLE ONLY packages_package_files ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_87f4cefcda FOREIGN KEY (upstream_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; -ALTER TABLE ONLY experiment_subjects - ADD CONSTRAINT fk_88489af1b1 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_88b4d546ef FOREIGN KEY (start_date_sourcing_milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -24857,8 +26524,8 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY protected_branch_merge_access_levels ADD CONSTRAINT fk_8a3072ccb3 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; -ALTER TABLE ONLY timelogs - ADD CONSTRAINT fk_8d058cd571 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; +ALTER TABLE ONLY bulk_import_exports + ADD CONSTRAINT fk_8c6f33cebe FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY releases ADD CONSTRAINT fk_8e4456f90f FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -24911,6 +26578,9 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY epics ADD CONSTRAINT fk_9d480c64b2 FOREIGN KEY (start_date_sourcing_epic_id) REFERENCES epics(id) ON DELETE SET NULL; +ALTER TABLE ONLY protected_environments + ADD CONSTRAINT fk_9e112565b7 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY alert_management_alerts ADD CONSTRAINT fk_9e49e5c2b7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24944,6 +26614,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 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; @@ -25034,6 +26710,9 @@ ALTER TABLE ONLY geo_event_log ALTER TABLE ONLY vulnerability_exports ADD CONSTRAINT fk_c3d3cb5d0f FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY timelogs + ADD CONSTRAINT fk_c49c83dd77 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_c4b1c1f66e FOREIGN KEY (repository_deleted_event_id) REFERENCES geo_repository_deleted_events(id) ON DELETE CASCADE; @@ -25049,12 +26728,18 @@ ALTER TABLE ONLY external_approval_rules_protected_branches ALTER TABLE ONLY external_approval_rules_protected_branches ADD CONSTRAINT fk_ca2ffb55e6 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; +ALTER TABLE ONLY dast_profiles_pipelines + ADD CONSTRAINT fk_cc206a8c13 FOREIGN KEY (dast_profile_id) REFERENCES dast_profiles(id) ON DELETE CASCADE; + ALTER TABLE ONLY experiment_subjects ADD CONSTRAINT fk_ccc28f8ceb FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; ALTER TABLE ONLY todos ADD CONSTRAINT fk_ccf0373936 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY dast_site_profiles_pipelines + ADD CONSTRAINT fk_cf05cf8fe1 FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles(id) ON DELETE CASCADE; + ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_cff7185ad2 FOREIGN KEY (reset_checksum_event_id) REFERENCES geo_reset_checksum_events(id) ON DELETE CASCADE; @@ -25071,7 +26756,7 @@ ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_d3130c9a7f FOREIGN KEY (commit_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; ALTER TABLE ONLY web_hooks - ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE NOT VALID; + ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT fk_d4e29af7d7 FOREIGN KEY (source_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; @@ -25106,9 +26791,6 @@ ALTER TABLE ONLY dependency_proxy_blobs ALTER TABLE ONLY epics ADD CONSTRAINT fk_dccd3f98fc FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL; -ALTER TABLE ONLY analytics_devops_adoption_segment_selections - ADD CONSTRAINT fk_ded7fe0344 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY issues ADD CONSTRAINT fk_df75a7c8b8 FOREIGN KEY (promoted_to_epic_id) REFERENCES epics(id) ON DELETE SET NULL; @@ -25148,6 +26830,9 @@ 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; @@ -25178,9 +26863,6 @@ ALTER TABLE ONLY vulnerability_external_issue_links ALTER TABLE ONLY epics ADD CONSTRAINT fk_f081aa4489 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY analytics_devops_adoption_segment_selections - ADD CONSTRAINT fk_f1472b95f3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; - ALTER TABLE ONLY boards ADD CONSTRAINT fk_f15266b5f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -25190,6 +26872,9 @@ ALTER TABLE ONLY jira_connect_subscriptions ALTER TABLE ONLY ci_pipeline_variables ADD CONSTRAINT fk_f29c5f4380 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; +ALTER TABLE ONLY status_check_responses + ADD CONSTRAINT fk_f3953d86c6 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + ALTER TABLE ONLY design_management_designs_versions ADD CONSTRAINT fk_f4d25ba00c FOREIGN KEY (version_id) REFERENCES design_management_versions(id) ON DELETE CASCADE; @@ -25271,9 +26956,6 @@ 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 analytics_devops_adoption_segment_selections - ADD CONSTRAINT fk_rails_053f00a9da FOREIGN KEY (segment_id) REFERENCES analytics_devops_adoption_segments(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; @@ -25379,6 +27061,12 @@ ALTER TABLE ONLY analytics_cycle_analytics_project_stages ALTER TABLE ONLY packages_build_infos ADD CONSTRAINT fk_rails_17a9a0dffc FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; +ALTER TABLE ONLY security_orchestration_policy_rule_schedules + ADD CONSTRAINT fk_rails_17ade83f17 FOREIGN KEY (security_orchestration_policy_configuration_id) REFERENCES security_orchestration_policy_configurations(id) ON DELETE CASCADE; + +ALTER TABLE ONLY incident_management_escalation_rules + ADD CONSTRAINT fk_rails_17dbea07a6 FOREIGN KEY (policy_id) REFERENCES incident_management_escalation_policies(id) ON DELETE CASCADE; + ALTER TABLE ONLY clusters_applications_jupyter ADD CONSTRAINT fk_rails_17df21c98c FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -25457,6 +27145,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; @@ -25466,6 +27157,9 @@ ALTER TABLE ONLY group_custom_attributes ALTER TABLE ONLY incident_management_oncall_rotations ADD CONSTRAINT fk_rails_256e0bc604 FOREIGN KEY (oncall_schedule_id) REFERENCES incident_management_oncall_schedules(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_unit_test_failures + ADD CONSTRAINT fk_rails_259da3e79c FOREIGN KEY (unit_test_id) REFERENCES ci_unit_tests(id) ON DELETE CASCADE; + ALTER TABLE ONLY analytics_devops_adoption_snapshots ADD CONSTRAINT fk_rails_25da9a92c0 FOREIGN KEY (segment_id) REFERENCES analytics_devops_adoption_segments(id) ON DELETE CASCADE; @@ -25484,6 +27178,9 @@ ALTER TABLE ONLY lfs_file_locks ALTER TABLE ONLY project_alerting_settings ADD CONSTRAINT fk_rails_27a84b407d FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_credit_card_validations + ADD CONSTRAINT fk_rails_27ebc03cbf FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_site_validations ADD CONSTRAINT fk_rails_285c617324 FOREIGN KEY (dast_site_token_id) REFERENCES dast_site_tokens(id) ON DELETE CASCADE; @@ -25562,6 +27259,9 @@ ALTER TABLE ONLY metrics_dashboard_annotations 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; @@ -25577,6 +27277,9 @@ ALTER TABLE ONLY group_merge_request_approval_settings ALTER TABLE ONLY analytics_cycle_analytics_project_stages ADD CONSTRAINT fk_rails_3829e49b66 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_debian_project_distribution_keys + ADD CONSTRAINT fk_rails_3834a11264 FOREIGN KEY (distribution_id) REFERENCES packages_debian_project_distributions(id) ON DELETE CASCADE; + ALTER TABLE ONLY issue_user_mentions ADD CONSTRAINT fk_rails_3861d9fefa FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; @@ -25658,6 +27361,9 @@ ALTER TABLE ONLY remote_mirrors ALTER TABLE ONLY lfs_file_locks ADD CONSTRAINT fk_rails_43df7a0412 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY dast_site_profile_secret_variables + ADD CONSTRAINT fk_rails_43e2897950 FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_request_assignees ADD CONSTRAINT fk_rails_443443ce6f FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; @@ -25685,9 +27391,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; @@ -25760,9 +27475,6 @@ ALTER TABLE ONLY clusters_applications_knative ALTER TABLE ONLY clusters_applications_prometheus ADD CONSTRAINT fk_rails_557e773639 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; -ALTER TABLE ONLY terraform_states - ADD CONSTRAINT fk_rails_558901b030 FOREIGN KEY (locked_by_user_id) REFERENCES users(id); - ALTER TABLE ONLY issuable_metric_images ADD CONSTRAINT fk_rails_56417a5a7f FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -25817,6 +27529,9 @@ ALTER TABLE ONLY vulnerability_scanners ALTER TABLE ONLY reviews ADD CONSTRAINT fk_rails_5ca11d8c31 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT fk_rails_5ca491d360 FOREIGN KEY (runner_id) REFERENCES ci_runners(id) ON DELETE CASCADE; + ALTER TABLE ONLY epic_issues ADD CONSTRAINT fk_rails_5d942936b4 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; @@ -25886,9 +27601,12 @@ ALTER TABLE ONLY operations_feature_flags_clients ALTER TABLE ONLY namespace_admin_notes ADD CONSTRAINT fk_rails_666166ea7b FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY web_hook_logs +ALTER TABLE ONLY web_hook_logs_archived ADD CONSTRAINT fk_rails_666826e111 FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams + ADD CONSTRAINT fk_rails_669f4ba293 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY jira_imports ADD CONSTRAINT fk_rails_675d38c03b FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE SET NULL; @@ -25898,9 +27616,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; @@ -25934,6 +27658,9 @@ ALTER TABLE ONLY project_custom_attributes ALTER TABLE ONLY user_interacted_projects ADD CONSTRAINT fk_rails_722ceba4f7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_pending_builds + ADD CONSTRAINT fk_rails_725a2644a3 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + ALTER TABLE ONLY security_findings ADD CONSTRAINT fk_rails_729b763a54 FOREIGN KEY (scanner_id) REFERENCES vulnerability_scanners(id) ON DELETE CASCADE; @@ -25943,6 +27670,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 services(id) ON DELETE CASCADE; @@ -25985,12 +27715,18 @@ ALTER TABLE ONLY packages_debian_publications ALTER TABLE ONLY boards_epic_user_preferences ADD CONSTRAINT fk_rails_76c4e9732d FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE CASCADE; +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 software_license_policies ADD CONSTRAINT fk_rails_7a7a2a92de FOREIGN KEY (software_license_id) REFERENCES software_licenses(id) ON DELETE CASCADE; @@ -26132,6 +27868,9 @@ ALTER TABLE ONLY packages_rubygems_metadata ALTER TABLE ONLY packages_pypi_metadata ADD CONSTRAINT fk_rails_9698717cdd FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_board_recent_visits + ADD CONSTRAINT fk_rails_96c2c18642 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY packages_dependency_links ADD CONSTRAINT fk_rails_96ef1c00d3 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; @@ -26174,6 +27913,9 @@ ALTER TABLE ONLY analytics_language_trend_repository_languages ALTER TABLE ONLY badges ADD CONSTRAINT fk_rails_9df4a56538 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_signatures + ADD CONSTRAINT fk_rails_9e0baf9dcd FOREIGN KEY (finding_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; + ALTER TABLE ONLY clusters_applications_cert_managers ADD CONSTRAINT fk_rails_9e4f2cb4b2 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -26183,6 +27925,9 @@ ALTER TABLE ONLY resource_milestone_events ALTER TABLE ONLY namespace_root_storage_statistics ADD CONSTRAINT fk_rails_a0702c430b FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY elastic_reindexing_slices + ADD CONSTRAINT fk_rails_a17d86aeb9 FOREIGN KEY (elastic_reindexing_subtask_id) REFERENCES elastic_reindexing_subtasks(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_aliases ADD CONSTRAINT fk_rails_a1804f74a7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -26201,6 +27946,9 @@ ALTER TABLE ONLY fork_network_members ALTER TABLE ONLY operations_feature_flag_scopes ADD CONSTRAINT fk_rails_a50a04d0a4 FOREIGN KEY (feature_flag_id) REFERENCES operations_feature_flags(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_helm_file_metadata + ADD CONSTRAINT fk_rails_a559865345 FOREIGN KEY (package_file_id) REFERENCES packages_package_files(id) ON DELETE CASCADE; + ALTER TABLE ONLY cluster_projects ADD CONSTRAINT fk_rails_a5a958bca1 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -26291,6 +28039,9 @@ ALTER TABLE ONLY issues_prometheus_alert_events ALTER TABLE ONLY merge_trains ADD CONSTRAINT fk_rails_b374b5225d FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY incident_management_escalation_rules + ADD CONSTRAINT fk_rails_b3c9c17bd4 FOREIGN KEY (oncall_schedule_id) REFERENCES incident_management_oncall_schedules(id) ON DELETE CASCADE; + ALTER TABLE ONLY application_settings ADD CONSTRAINT fk_rails_b53e481273 FOREIGN KEY (custom_project_templates_group_id) REFERENCES namespaces(id) ON DELETE SET NULL; @@ -26315,6 +28066,9 @@ ALTER TABLE ONLY approval_project_rules_users ALTER TABLE ONLY lists ADD CONSTRAINT fk_rails_baed5f39b7 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE CASCADE; +ALTER TABLE web_hook_logs + ADD CONSTRAINT fk_rails_bb3355782d FOREIGN KEY (web_hook_id) REFERENCES web_hooks(id) ON DELETE CASCADE; + ALTER TABLE ONLY security_findings ADD CONSTRAINT fk_rails_bb63863cf1 FOREIGN KEY (scan_id) REFERENCES security_scans(id) ON DELETE CASCADE; @@ -26378,6 +28132,9 @@ ALTER TABLE ONLY pages_deployments 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 boards_epic_board_recent_visits + ADD CONSTRAINT fk_rails_c4dcba4a3e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_job_artifacts ADD CONSTRAINT fk_rails_c5137cb2c1 FOREIGN KEY (job_id) REFERENCES ci_builds(id) ON DELETE CASCADE; @@ -26420,6 +28177,9 @@ ALTER TABLE ONLY boards_epic_board_positions ALTER TABLE ONLY vulnerability_finding_links ADD CONSTRAINT fk_rails_cbdfde27ce FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; +ALTER TABLE ONLY clusters_integration_elasticstack + ADD CONSTRAINT fk_rails_cc5ba8f658 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + ALTER TABLE ONLY issues_self_managed_prometheus_alert_events ADD CONSTRAINT fk_rails_cc5d88bbb0 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -26429,6 +28189,9 @@ ALTER TABLE ONLY operations_strategies_user_lists ALTER TABLE ONLY issue_tracker_data ADD CONSTRAINT fk_rails_ccc0840427 FOREIGN KEY (service_id) REFERENCES services(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; @@ -26456,6 +28219,9 @@ ALTER TABLE ONLY requirements_management_test_reports ALTER TABLE ONLY pool_repositories ADD CONSTRAINT fk_rails_d2711daad4 FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL; +ALTER TABLE ONLY web_hooks + ADD CONSTRAINT fk_rails_d35697648e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY group_group_links ADD CONSTRAINT fk_rails_d3a0488427 FOREIGN KEY (shared_group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -26471,6 +28237,9 @@ ALTER TABLE ONLY geo_hashed_storage_attachments_events ALTER TABLE ONLY merge_request_reviewers ADD CONSTRAINT fk_rails_d9fec24b9d FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_running_builds + ADD CONSTRAINT fk_rails_da45cfa165 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; + ALTER TABLE ONLY jira_imports ADD CONSTRAINT fk_rails_da617096ce FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -26480,6 +28249,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; @@ -26504,6 +28276,12 @@ ALTER TABLE ONLY incident_management_oncall_shifts ALTER TABLE ONLY analytics_cycle_analytics_group_stages ADD CONSTRAINT fk_rails_dfb37c880d FOREIGN KEY (end_event_label_id) REFERENCES labels(id) ON DELETE CASCADE; +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; @@ -26516,12 +28294,21 @@ ALTER TABLE ONLY cluster_platforms_kubernetes ALTER TABLE ONLY ci_builds_metadata ADD CONSTRAINT fk_rails_e20479742e FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; +ALTER TABLE ONLY vulnerability_finding_evidences + ADD CONSTRAINT fk_rails_e3205a0c65 FOREIGN KEY (vulnerability_occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; + +ALTER TABLE ONLY clusters_integration_prometheus + ADD CONSTRAINT fk_rails_e44472034c FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_occurrence_identifiers ADD CONSTRAINT fk_rails_e4ef6d027c FOREIGN KEY (occurrence_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; ALTER TABLE ONLY serverless_domain_cluster ADD CONSTRAINT fk_rails_e59e868733 FOREIGN KEY (clusters_applications_knative_id) REFERENCES clusters_applications_knative(id) ON DELETE CASCADE; +ALTER TABLE ONLY incident_management_escalation_policies + ADD CONSTRAINT fk_rails_e5b513daa7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_external_issue_links ADD CONSTRAINT fk_rails_e5ba7f7b13 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -26543,6 +28330,9 @@ ALTER TABLE ONLY draft_notes ALTER TABLE ONLY namespace_package_settings ADD CONSTRAINT fk_rails_e773444769 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_board_recent_visits + ADD CONSTRAINT fk_rails_e77911cf03 FOREIGN KEY (epic_board_id) REFERENCES boards_epic_boards(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_site_tokens ADD CONSTRAINT fk_rails_e84f721a8e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -26597,6 +28387,9 @@ ALTER TABLE ONLY label_priorities ALTER TABLE ONLY fork_network_members ADD CONSTRAINT fk_rails_efccadc4ec FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY security_orchestration_policy_rule_schedules + ADD CONSTRAINT fk_rails_efe1d9b133 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY prometheus_alerts ADD CONSTRAINT fk_rails_f0e8db86aa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -26654,9 +28447,6 @@ ALTER TABLE ONLY merge_trains ALTER TABLE ONLY ci_runner_namespaces ADD CONSTRAINT fk_rails_f9d9ed3308 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY vulnerability_finding_fingerprints - ADD CONSTRAINT fk_rails_fa411253b2 FOREIGN KEY (finding_id) REFERENCES vulnerability_occurrences(id) ON DELETE CASCADE; - ALTER TABLE ONLY requirements_management_test_reports ADD CONSTRAINT fk_rails_fb3308ad55 FOREIGN KEY (requirement_id) REFERENCES requirements(id) ON DELETE CASCADE; @@ -26696,12 +28486,18 @@ ALTER TABLE ONLY ci_builds_metadata ALTER TABLE ONLY services ADD CONSTRAINT fk_services_inherit_from_id FOREIGN KEY (inherit_from_id) REFERENCES services(id) ON DELETE CASCADE; +ALTER TABLE ONLY merge_requests + ADD CONSTRAINT fk_source_project FOREIGN KEY (source_project_id) REFERENCES projects(id) ON DELETE SET NULL; + ALTER TABLE ONLY timelogs ADD CONSTRAINT fk_timelogs_issues_issue_id FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; ALTER TABLE ONLY timelogs ADD CONSTRAINT fk_timelogs_merge_requests_merge_request_id FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY timelogs + ADD CONSTRAINT fk_timelogs_note_id FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE SET NULL; + ALTER TABLE ONLY u2f_registrations ADD CONSTRAINT fk_u2f_registrations_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; |