diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-01-18 19:00:14 +0000 |
commit | 05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2 (patch) | |
tree | 11d0f2a6ec31c7793c184106cedc2ded3d9a2cc5 /db/structure.sql | |
parent | ec73467c23693d0db63a797d10194da9e72a74af (diff) | |
download | gitlab-ce-05f0ebba3a2c8ddf39e436f412dc2ab5bf1353b2.tar.gz |
Add latest changes from gitlab-org/gitlab@15-8-stable-eev15.8.0-rc42
Diffstat (limited to 'db/structure.sql')
-rw-r--r-- | db/structure.sql | 338 |
1 files changed, 245 insertions, 93 deletions
diff --git a/db/structure.sql b/db/structure.sql index 72d9c94be49..ec8f3362c40 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -225,24 +225,6 @@ RETURN NULL; END $$; -CREATE FUNCTION sync_namespaces_amount_used_columns() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."new_amount_used" := NEW."amount_used"; - RETURN NEW; -END; -$$; - -CREATE FUNCTION sync_projects_amount_used_columns() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."new_amount_used" := NEW."amount_used"; - RETURN NEW; -END; -$$; - CREATE FUNCTION trigger_1a857e8db6cd() RETURNS trigger LANGUAGE plpgsql AS $$ @@ -10602,7 +10584,10 @@ CREATE TABLE abuse_reports ( created_at timestamp without time zone, updated_at timestamp without time zone, message_html text, - cached_markdown_version integer + cached_markdown_version integer, + category smallint DEFAULT 1 NOT NULL, + reported_from_url text DEFAULT ''::text NOT NULL, + CONSTRAINT check_ab1260fa6c CHECK ((char_length(reported_from_url) <= 512)) ); CREATE SEQUENCE abuse_reports_id_seq @@ -10966,6 +10951,21 @@ CREATE SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq ALTER SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq OWNED BY analytics_cycle_analytics_stage_event_hashes.id; +CREATE TABLE analytics_dashboards_pointers ( + id bigint NOT NULL, + namespace_id bigint NOT NULL, + project_id bigint NOT NULL +); + +CREATE SEQUENCE analytics_dashboards_pointers_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE analytics_dashboards_pointers_id_seq OWNED BY analytics_dashboards_pointers.id; + CREATE TABLE analytics_devops_adoption_segments ( id bigint NOT NULL, last_recorded_at timestamp with time zone, @@ -11063,9 +11063,11 @@ CREATE TABLE appearances ( email_header_and_footer_enabled boolean DEFAULT false NOT NULL, profile_image_guidelines text, profile_image_guidelines_html text, - short_title text, + pwa_short_name text, + pwa_icon text, CONSTRAINT appearances_profile_image_guidelines CHECK ((char_length(profile_image_guidelines) <= 4096)), - CONSTRAINT check_fdf3064682 CHECK ((char_length(short_title) <= 255)) + CONSTRAINT check_5c3fd63577 CHECK ((char_length(pwa_short_name) <= 255)), + CONSTRAINT check_5e5b7ac344 CHECK ((char_length(pwa_icon) <= 1024)) ); CREATE SEQUENCE appearances_id_seq @@ -11557,6 +11559,8 @@ CREATE TABLE application_settings ( disable_personal_access_tokens boolean DEFAULT false NOT NULL, max_terraform_state_size_bytes integer DEFAULT 0 NOT NULL, bulk_import_enabled boolean DEFAULT false NOT NULL, + allow_runner_registration_token boolean DEFAULT true NOT NULL, + user_defaults_to_private_profile boolean DEFAULT false 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_container_registry_pre_import_tags_rate_positive CHECK ((container_registry_pre_import_tags_rate >= (0)::numeric)), CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)), @@ -11881,7 +11885,7 @@ CREATE TABLE atlassian_identities ( encrypted_refresh_token bytea, encrypted_refresh_token_iv bytea, CONSTRAINT atlassian_identities_refresh_token_iv_length_constraint CHECK ((octet_length(encrypted_refresh_token_iv) <= 12)), - CONSTRAINT atlassian_identities_refresh_token_length_constraint CHECK ((octet_length(encrypted_refresh_token) <= 512)), + CONSTRAINT atlassian_identities_refresh_token_length_constraint CHECK ((octet_length(encrypted_refresh_token) <= 5000)), CONSTRAINT atlassian_identities_token_iv_length_constraint CHECK ((octet_length(encrypted_token_iv) <= 12)), CONSTRAINT atlassian_identities_token_length_constraint CHECK ((octet_length(encrypted_token) <= 2048)), CONSTRAINT check_32f5779763 CHECK ((char_length(extern_uid) <= 255)) @@ -12440,6 +12444,7 @@ CREATE TABLE bulk_import_entities ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, source_xid integer, + migrate_projects boolean DEFAULT true NOT NULL, CONSTRAINT check_13f279f7da CHECK ((char_length(source_full_path) <= 255)), CONSTRAINT check_715d725ea2 CHECK ((char_length(destination_name) <= 255)), CONSTRAINT check_796a4d9cc6 CHECK ((char_length(jid) <= 255)), @@ -12576,8 +12581,7 @@ CREATE TABLE chat_names ( last_used_at timestamp without time zone, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, - integration_id integer, - CONSTRAINT check_2b0a0d0f0f CHECK ((integration_id IS NOT NULL)) + integration_id integer ); CREATE SEQUENCE chat_names_id_seq @@ -12757,7 +12761,8 @@ CREATE TABLE p_ci_builds_metadata ( runtime_runner_features jsonb DEFAULT '{}'::jsonb NOT NULL, id_tokens jsonb DEFAULT '{}'::jsonb NOT NULL, partition_id bigint DEFAULT 100 NOT NULL, - debug_trace_enabled boolean DEFAULT false NOT NULL + debug_trace_enabled boolean DEFAULT false NOT NULL, + runner_machine_id bigint ) PARTITION BY LIST (partition_id); @@ -12786,7 +12791,8 @@ CREATE TABLE ci_builds_metadata ( runtime_runner_features jsonb DEFAULT '{}'::jsonb NOT NULL, id_tokens jsonb DEFAULT '{}'::jsonb NOT NULL, partition_id bigint DEFAULT 100 NOT NULL, - debug_trace_enabled boolean DEFAULT false NOT NULL + debug_trace_enabled boolean DEFAULT false NOT NULL, + runner_machine_id bigint ); ALTER TABLE ONLY p_ci_builds_metadata ATTACH PARTITION ci_builds_metadata FOR VALUES IN ('100'); @@ -12945,6 +12951,7 @@ CREATE TABLE ci_job_artifacts ( locked smallint DEFAULT 2, original_filename text, partition_id bigint DEFAULT 100 NOT NULL, + accessibility smallint DEFAULT 0 NOT NULL, CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)), CONSTRAINT check_85573000db CHECK ((char_length(original_filename) <= 512)) ); @@ -13036,11 +13043,10 @@ CREATE TABLE ci_namespace_monthly_usages ( id bigint NOT NULL, namespace_id bigint NOT NULL, date date NOT NULL, - amount_used numeric(18,2) DEFAULT 0.0 NOT NULL, notification_level smallint DEFAULT 100 NOT NULL, shared_runners_duration integer DEFAULT 0 NOT NULL, created_at timestamp with time zone, - new_amount_used numeric(18,4) DEFAULT 0.0 NOT NULL, + amount_used numeric(18,4) DEFAULT 0.0 NOT NULL, CONSTRAINT ci_namespace_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone))) ); @@ -13319,10 +13325,9 @@ CREATE TABLE ci_project_monthly_usages ( id bigint NOT NULL, project_id bigint NOT NULL, date date NOT NULL, - amount_used numeric(18,2) DEFAULT 0.0 NOT NULL, shared_runners_duration integer DEFAULT 0 NOT NULL, created_at timestamp with time zone, - new_amount_used numeric(18,4) DEFAULT 0.0 NOT NULL, + amount_used numeric(18,4) DEFAULT 0.0 NOT NULL, CONSTRAINT ci_project_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone))) ); @@ -13388,6 +13393,37 @@ CREATE SEQUENCE ci_resources_id_seq ALTER SEQUENCE ci_resources_id_seq OWNED BY ci_resources.id; +CREATE TABLE ci_runner_machines ( + id bigint NOT NULL, + runner_id bigint NOT NULL, + executor_type smallint, + machine_xid text NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + contacted_at timestamp with time zone, + version text, + revision text, + platform text, + architecture text, + ip_address text, + config jsonb DEFAULT '{}'::jsonb NOT NULL, + CONSTRAINT check_1537c1f66f CHECK ((char_length(platform) <= 255)), + CONSTRAINT check_6f45a91da7 CHECK ((char_length(version) <= 2048)), + CONSTRAINT check_84ed5d8703 CHECK ((char_length(machine_xid) <= 64)), + CONSTRAINT check_9b521b3105 CHECK ((char_length(architecture) <= 255)), + CONSTRAINT check_afb8efc1a2 CHECK ((char_length(revision) <= 255)), + CONSTRAINT check_f214590856 CHECK ((char_length(ip_address) <= 1024)) +); + +CREATE SEQUENCE ci_runner_machines_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ci_runner_machines_id_seq OWNED BY ci_runner_machines.id; + CREATE TABLE ci_runner_namespaces ( id integer NOT NULL, runner_id integer, @@ -13453,6 +13489,8 @@ CREATE TABLE ci_runners ( maintainer_note text, token_expires_at timestamp with time zone, allowed_plans text[] DEFAULT '{}'::text[] NOT NULL, + registration_type smallint DEFAULT 0 NOT NULL, + creator_id bigint, CONSTRAINT check_ce275cee06 CHECK ((char_length(maintainer_note) <= 1024)) ); @@ -15134,6 +15172,14 @@ CREATE SEQUENCE draft_notes_id_seq ALTER SEQUENCE draft_notes_id_seq OWNED BY draft_notes.id; +CREATE TABLE elastic_group_index_statuses ( + namespace_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + wiki_indexed_at timestamp with time zone, + last_wiki_commit bytea +); + CREATE TABLE elastic_index_settings ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -15667,20 +15713,6 @@ CREATE SEQUENCE geo_cache_invalidation_events_id_seq ALTER SEQUENCE geo_cache_invalidation_events_id_seq OWNED BY geo_cache_invalidation_events.id; -CREATE TABLE geo_container_repository_updated_events ( - id bigint NOT NULL, - container_repository_id integer NOT NULL -); - -CREATE SEQUENCE geo_container_repository_updated_events_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE geo_container_repository_updated_events_id_seq OWNED BY geo_container_repository_updated_events.id; - CREATE TABLE geo_event_log ( id bigint NOT NULL, created_at timestamp without time zone NOT NULL, @@ -15693,7 +15725,6 @@ CREATE TABLE geo_event_log ( hashed_storage_attachments_event_id bigint, reset_checksum_event_id bigint, cache_invalidation_event_id bigint, - container_repository_updated_event_id bigint, geo_event_id integer ); @@ -16714,6 +16745,7 @@ CREATE TABLE integrations ( archive_trace_events boolean DEFAULT false NOT NULL, encrypted_properties bytea, encrypted_properties_iv bytea, + incident_events boolean DEFAULT false NOT NULL, CONSTRAINT check_a948a0aa7e CHECK ((char_length(type_new) <= 255)) ); @@ -18016,7 +18048,9 @@ CREATE TABLE ml_candidates ( user_id bigint, start_time bigint, end_time bigint, - status smallint DEFAULT 0 NOT NULL + status smallint DEFAULT 0 NOT NULL, + name text, + CONSTRAINT check_25e6c65051 CHECK ((char_length(name) <= 255)) ); CREATE SEQUENCE ml_candidates_id_seq @@ -18214,6 +18248,7 @@ CREATE TABLE namespace_settings ( only_allow_merge_if_all_discussions_are_resolved boolean DEFAULT false NOT NULL, default_compliance_framework_id bigint, runner_registration_enabled boolean DEFAULT true, + allow_runner_registration_token boolean DEFAULT true NOT NULL, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)), CONSTRAINT namespace_settings_unique_project_download_limit_allowlist_size CHECK ((cardinality(unique_project_download_limit_allowlist) <= 100)) ); @@ -19551,7 +19586,10 @@ CREATE TABLE plan_limits ( ci_max_artifact_size_cyclonedx integer DEFAULT 1 NOT NULL, rpm_max_file_size bigint DEFAULT '5368709120'::bigint NOT NULL, ci_max_artifact_size_requirements_v2 integer DEFAULT 0 NOT NULL, - pipeline_hierarchy_size integer DEFAULT 1000 NOT NULL + pipeline_hierarchy_size integer DEFAULT 1000 NOT NULL, + enforcement_limit integer DEFAULT 0 NOT NULL, + notification_limit integer DEFAULT 0 NOT NULL, + dashboard_limit_enabled_at timestamp with time zone ); CREATE SEQUENCE plan_limits_id_seq @@ -19705,12 +19743,24 @@ CREATE VIEW postgres_foreign_keys AS SELECT pg_constraint.oid, pg_constraint.conname AS name, (((constrained_namespace.nspname)::text || '.'::text) || (constrained_table.relname)::text) AS constrained_table_identifier, - (((referenced_namespace.nspname)::text || '.'::text) || (referenced_table.relname)::text) AS referenced_table_identifier - FROM ((((pg_constraint + (((referenced_namespace.nspname)::text || '.'::text) || (referenced_table.relname)::text) AS referenced_table_identifier, + (constrained_table.relname)::text AS constrained_table_name, + (referenced_table.relname)::text AS referenced_table_name, + constrained_cols.constrained_columns, + referenced_cols.referenced_columns, + pg_constraint.confdeltype AS on_delete_action, + (pg_constraint.coninhcount > 0) AS is_inherited + FROM ((((((pg_constraint JOIN pg_class constrained_table ON ((constrained_table.oid = pg_constraint.conrelid))) JOIN pg_class referenced_table ON ((referenced_table.oid = pg_constraint.confrelid))) JOIN pg_namespace constrained_namespace ON ((constrained_table.relnamespace = constrained_namespace.oid))) JOIN pg_namespace referenced_namespace ON ((referenced_table.relnamespace = referenced_namespace.oid))) + CROSS JOIN LATERAL ( SELECT array_agg(pg_attribute.attname ORDER BY conkey.idx) AS array_agg + FROM (unnest(pg_constraint.conkey) WITH ORDINALITY conkey(attnum, idx) + JOIN pg_attribute ON (((pg_attribute.attnum = conkey.attnum) AND (pg_attribute.attrelid = constrained_table.oid))))) constrained_cols(constrained_columns)) + CROSS JOIN LATERAL ( SELECT array_agg(pg_attribute.attname ORDER BY confkey.idx) AS array_agg + FROM (unnest(pg_constraint.confkey) WITH ORDINALITY confkey(attnum, idx) + JOIN pg_attribute ON (((pg_attribute.attnum = confkey.attnum) AND (pg_attribute.attrelid = referenced_table.oid))))) referenced_cols(referenced_columns)) WHERE (pg_constraint.contype = 'f'::"char"); CREATE VIEW postgres_index_bloat_estimates AS @@ -21115,7 +21165,8 @@ CREATE TABLE requirements_management_test_reports ( author_id bigint, state smallint NOT NULL, build_id bigint, - issue_id bigint + issue_id bigint, + uses_legacy_iid boolean DEFAULT true NOT NULL ); CREATE SEQUENCE requirements_management_test_reports_id_seq @@ -21376,7 +21427,8 @@ CREATE TABLE sbom_occurrences ( pipeline_id bigint, source_id bigint, commit_sha bytea NOT NULL, - component_id bigint NOT NULL + component_id bigint NOT NULL, + uuid uuid NOT NULL ); CREATE SEQUENCE sbom_occurrences_id_seq @@ -21929,7 +21981,9 @@ CREATE TABLE ssh_signatures ( project_id bigint NOT NULL, key_id bigint, verification_status smallint DEFAULT 0 NOT NULL, - commit_sha bytea NOT NULL + commit_sha bytea NOT NULL, + user_id bigint, + key_fingerprint_sha256 bytea ); CREATE SEQUENCE ssh_signatures_id_seq @@ -22380,6 +22434,26 @@ CREATE SEQUENCE uploads_id_seq ALTER SEQUENCE uploads_id_seq OWNED BY uploads.id; +CREATE TABLE user_achievements ( + id bigint NOT NULL, + achievement_id bigint NOT NULL, + user_id bigint NOT NULL, + awarded_by_user_id bigint, + revoked_by_user_id bigint, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + revoked_at timestamp with time zone +); + +CREATE SEQUENCE user_achievements_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE user_achievements_id_seq OWNED BY user_achievements.id; + CREATE TABLE user_agent_details ( id integer NOT NULL, user_agent character varying NOT NULL, @@ -23710,6 +23784,8 @@ ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams ALTER COLUMN id ALTER TABLE ONLY analytics_cycle_analytics_stage_event_hashes ALTER COLUMN id SET DEFAULT nextval('analytics_cycle_analytics_stage_event_hashes_id_seq'::regclass); +ALTER TABLE ONLY analytics_dashboards_pointers ALTER COLUMN id SET DEFAULT nextval('analytics_dashboards_pointers_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); @@ -23876,6 +23952,8 @@ ALTER TABLE ONLY ci_resource_groups ALTER COLUMN id SET DEFAULT nextval('ci_reso ALTER TABLE ONLY ci_resources ALTER COLUMN id SET DEFAULT nextval('ci_resources_id_seq'::regclass); +ALTER TABLE ONLY ci_runner_machines ALTER COLUMN id SET DEFAULT nextval('ci_runner_machines_id_seq'::regclass); + ALTER TABLE ONLY ci_runner_namespaces ALTER COLUMN id SET DEFAULT nextval('ci_runner_namespaces_id_seq'::regclass); ALTER TABLE ONLY ci_runner_projects ALTER COLUMN id SET DEFAULT nextval('ci_runner_projects_id_seq'::regclass); @@ -24074,8 +24152,6 @@ ALTER TABLE ONLY fork_networks ALTER COLUMN id SET DEFAULT nextval('fork_network ALTER TABLE ONLY geo_cache_invalidation_events ALTER COLUMN id SET DEFAULT nextval('geo_cache_invalidation_events_id_seq'::regclass); -ALTER TABLE ONLY geo_container_repository_updated_events ALTER COLUMN id SET DEFAULT nextval('geo_container_repository_updated_events_id_seq'::regclass); - ALTER TABLE ONLY geo_event_log ALTER COLUMN id SET DEFAULT nextval('geo_event_log_id_seq'::regclass); ALTER TABLE ONLY geo_events ALTER COLUMN id SET DEFAULT nextval('geo_events_id_seq'::regclass); @@ -24634,6 +24710,8 @@ ALTER TABLE ONLY upload_states ALTER COLUMN upload_id SET DEFAULT nextval('uploa ALTER TABLE ONLY uploads ALTER COLUMN id SET DEFAULT nextval('uploads_id_seq'::regclass); +ALTER TABLE ONLY user_achievements ALTER COLUMN id SET DEFAULT nextval('user_achievements_id_seq'::regclass); + ALTER TABLE ONLY user_agent_details ALTER COLUMN id SET DEFAULT nextval('user_agent_details_id_seq'::regclass); ALTER TABLE ONLY user_callouts ALTER COLUMN id SET DEFAULT nextval('user_callouts_id_seq'::regclass); @@ -25377,6 +25455,9 @@ ALTER TABLE ONLY analytics_cycle_analytics_project_value_streams ALTER TABLE ONLY analytics_cycle_analytics_stage_event_hashes ADD CONSTRAINT analytics_cycle_analytics_stage_event_hashes_pkey PRIMARY KEY (id); +ALTER TABLE ONLY analytics_dashboards_pointers + ADD CONSTRAINT analytics_dashboards_pointers_pkey PRIMARY KEY (id); + ALTER TABLE ONLY analytics_devops_adoption_segments ADD CONSTRAINT analytics_devops_adoption_segments_pkey PRIMARY KEY (id); @@ -25677,6 +25758,9 @@ ALTER TABLE ONLY ci_resource_groups ALTER TABLE ONLY ci_resources ADD CONSTRAINT ci_resources_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_runner_machines + ADD CONSTRAINT ci_runner_machines_pkey PRIMARY KEY (id); + ALTER TABLE ONLY ci_runner_namespaces ADD CONSTRAINT ci_runner_namespaces_pkey PRIMARY KEY (id); @@ -25935,6 +26019,9 @@ ALTER TABLE ONLY dora_daily_metrics ALTER TABLE ONLY draft_notes ADD CONSTRAINT draft_notes_pkey PRIMARY KEY (id); +ALTER TABLE ONLY elastic_group_index_statuses + ADD CONSTRAINT elastic_group_index_statuses_pkey PRIMARY KEY (namespace_id); + ALTER TABLE ONLY elastic_index_settings ADD CONSTRAINT elastic_index_settings_pkey PRIMARY KEY (id); @@ -26016,9 +26103,6 @@ ALTER TABLE ONLY fork_networks ALTER TABLE ONLY geo_cache_invalidation_events ADD CONSTRAINT geo_cache_invalidation_events_pkey PRIMARY KEY (id); -ALTER TABLE ONLY geo_container_repository_updated_events - ADD CONSTRAINT geo_container_repository_updated_events_pkey PRIMARY KEY (id); - ALTER TABLE ONLY geo_event_log ADD CONSTRAINT geo_event_log_pkey PRIMARY KEY (id); @@ -26997,6 +27081,9 @@ ALTER TABLE ONLY upload_states ALTER TABLE ONLY uploads ADD CONSTRAINT uploads_pkey PRIMARY KEY (id); +ALTER TABLE ONLY user_achievements + ADD CONSTRAINT user_achievements_pkey PRIMARY KEY (id); + ALTER TABLE ONLY user_agent_details ADD CONSTRAINT user_agent_details_pkey PRIMARY KEY (id); @@ -28209,8 +28296,6 @@ CREATE UNIQUE INDEX idx_environment_merge_requests_unique_index ON deployment_me CREATE UNIQUE INDEX idx_external_audit_event_destination_id_key_uniq ON audit_events_streaming_headers USING btree (key, external_audit_event_destination_id); -CREATE INDEX idx_geo_con_rep_updated_events_on_container_repository_id ON geo_container_repository_updated_events USING btree (container_repository_id); - CREATE INDEX idx_installable_conan_pkgs_on_project_id_id ON packages_packages USING btree (project_id, id) WHERE ((package_type = 3) AND (status = ANY (ARRAY[0, 1]))); CREATE INDEX idx_installable_helm_pkgs_on_project_id_id ON packages_packages USING btree (project_id, id); @@ -28237,6 +28322,8 @@ CREATE INDEX idx_keys_expires_at_and_before_expiry_notification_undelivered ON k 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_members_on_user_and_source_and_source_type_and_member_role ON members USING btree (user_id, source_id, source_type, member_role_id); + 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)); CREATE INDEX idx_merge_requests_on_merged_state ON merge_requests USING btree (id) WHERE (state_id = 3); @@ -28429,6 +28516,10 @@ CREATE UNIQUE INDEX index_analytics_ca_project_value_streams_on_project_id_and_n CREATE INDEX index_analytics_cycle_analytics_group_stages_custom_only ON analytics_cycle_analytics_group_stages USING btree (id) WHERE (custom = true); +CREATE UNIQUE INDEX index_analytics_dashboards_pointers_on_namespace_id ON analytics_dashboards_pointers USING btree (namespace_id); + +CREATE INDEX index_analytics_dashboards_pointers_on_project_id ON analytics_dashboards_pointers USING btree (project_id); + CREATE INDEX index_application_settings_on_custom_project_templates_group_id ON application_settings USING btree (custom_project_templates_group_id); CREATE INDEX index_application_settings_on_file_template_project_id ON application_settings USING btree (file_template_project_id); @@ -28631,11 +28722,9 @@ CREATE INDEX index_bulk_import_failures_on_correlation_id_value ON bulk_import_f CREATE INDEX index_bulk_imports_on_user_id ON bulk_imports USING btree (user_id); -CREATE UNIQUE INDEX index_chat_names_on_integration_id_and_team_id_and_chat_id ON chat_names USING btree (integration_id, team_id, chat_id); - CREATE INDEX index_chat_names_on_team_id_and_chat_id ON chat_names USING btree (team_id, chat_id); -CREATE UNIQUE INDEX index_chat_names_on_user_id_and_integration_id ON chat_names USING btree (user_id, integration_id); +CREATE INDEX index_chat_names_on_user_id ON chat_names USING btree (user_id); CREATE UNIQUE INDEX index_chat_teams_on_namespace_id ON chat_teams USING btree (namespace_id); @@ -28643,10 +28732,14 @@ CREATE UNIQUE INDEX index_ci_build_needs_on_build_id_and_name ON ci_build_needs CREATE UNIQUE INDEX index_ci_build_pending_states_on_build_id ON ci_build_pending_states USING btree (build_id); +CREATE INDEX index_ci_build_pending_states_on_partition_id_build_id ON ci_build_pending_states USING btree (partition_id, build_id); + CREATE INDEX index_ci_build_report_results_on_project_id ON ci_build_report_results USING btree (project_id); CREATE UNIQUE INDEX index_ci_build_trace_chunks_on_build_id_and_chunk_index ON ci_build_trace_chunks USING btree (build_id, chunk_index); +CREATE INDEX index_ci_build_trace_chunks_on_partition_id_build_id ON ci_build_trace_chunks USING btree (partition_id, build_id); + CREATE INDEX index_ci_build_trace_metadata_on_trace_artifact_id ON ci_build_trace_metadata USING btree (trace_artifact_id); CREATE INDEX p_ci_builds_metadata_build_id_idx ON ONLY p_ci_builds_metadata USING btree (build_id) WHERE (has_exposed_artifacts IS TRUE); @@ -28803,6 +28896,8 @@ CREATE INDEX index_ci_pipeline_metadata_on_project_id ON ci_pipeline_metadata US CREATE UNIQUE INDEX index_ci_pipeline_schedule_variables_on_schedule_id_and_key ON ci_pipeline_schedule_variables USING btree (pipeline_schedule_id, key); +CREATE INDEX index_ci_pipeline_schedules_on_id_and_next_run_at_and_active ON ci_pipeline_schedules USING btree (id, next_run_at) WHERE (active = true); + CREATE INDEX index_ci_pipeline_schedules_on_next_run_at_and_active ON ci_pipeline_schedules USING btree (next_run_at, active); CREATE INDEX index_ci_pipeline_schedules_on_owner_id ON ci_pipeline_schedules USING btree (owner_id); @@ -28871,6 +28966,14 @@ CREATE INDEX index_ci_resources_on_build_id ON ci_resources USING btree (build_i CREATE UNIQUE INDEX index_ci_resources_on_resource_group_id_and_build_id ON ci_resources USING btree (resource_group_id, build_id); +CREATE INDEX index_ci_runner_machines_on_contacted_at_desc_and_id_desc ON ci_runner_machines USING btree (contacted_at DESC, id DESC); + +CREATE INDEX index_ci_runner_machines_on_created_at_and_id_desc ON ci_runner_machines USING btree (created_at, id DESC); + +CREATE UNIQUE INDEX index_ci_runner_machines_on_runner_id_and_machine_xid ON ci_runner_machines USING btree (runner_id, machine_xid); + +CREATE INDEX index_ci_runner_machines_on_version ON ci_runner_machines USING btree (version); + CREATE INDEX index_ci_runner_namespaces_on_namespace_id ON ci_runner_namespaces USING btree (namespace_id); CREATE UNIQUE INDEX index_ci_runner_namespaces_on_runner_id_and_namespace_id ON ci_runner_namespaces USING btree (runner_id, namespace_id); @@ -28893,11 +28996,13 @@ CREATE INDEX index_ci_runners_on_created_at_and_id_where_inactive ON ci_runners 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_creator_id_where_creator_id_not_null ON ci_runners USING btree (creator_id) WHERE (creator_id IS NOT NULL); + 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); -CREATE INDEX index_ci_runners_on_runner_type ON ci_runners USING btree (runner_type); +CREATE INDEX index_ci_runners_on_runner_type_and_id ON ci_runners USING btree (runner_type, id); CREATE INDEX index_ci_runners_on_token_expires_at_and_id_desc ON ci_runners USING btree (token_expires_at, id DESC); @@ -28963,6 +29068,8 @@ CREATE INDEX index_ci_triggers_on_project_id ON ci_triggers USING btree (project CREATE INDEX index_ci_unit_test_failures_on_build_id ON ci_unit_test_failures USING btree (build_id); +CREATE INDEX index_ci_unit_test_failures_on_partition_id_build_id ON ci_unit_test_failures USING btree (partition_id, 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); @@ -29299,6 +29406,8 @@ CREATE INDEX index_environments_on_merge_request_id ON environments USING btree CREATE INDEX index_environments_on_name_varchar_pattern_ops ON environments USING btree (name varchar_pattern_ops); +CREATE INDEX index_environments_on_project_id_and_id ON environments USING btree (project_id, id); + CREATE UNIQUE INDEX index_environments_on_project_id_and_name ON environments USING btree (project_id, name); CREATE UNIQUE INDEX index_environments_on_project_id_and_slug ON environments USING btree (project_id, slug); @@ -29383,6 +29492,12 @@ CREATE INDEX index_et_errors_on_project_id_and_status_last_seen_at_id_desc ON er CREATE INDEX index_events_author_id_project_id_action_target_type_created_at ON events USING btree (author_id, project_id, action, target_type, created_at); +CREATE INDEX index_events_for_followed_users ON events USING btree (author_id, target_type, action, id); + +CREATE INDEX index_events_for_group_activity ON events USING btree (group_id, target_type, action, id) WHERE (group_id IS NOT NULL); + +CREATE INDEX index_events_for_project_activity ON events USING btree (project_id, target_type, action, id); + CREATE INDEX index_events_on_action ON events USING btree (action); CREATE INDEX index_events_on_author_id_and_created_at ON events USING btree (author_id, created_at); @@ -29393,6 +29508,8 @@ CREATE INDEX index_events_on_author_id_and_id ON events USING btree (author_id, CREATE INDEX index_events_on_created_at_and_id ON events USING btree (created_at, id) WHERE (created_at > '2021-08-27 00:00:00+00'::timestamp with time zone); +CREATE INDEX index_events_on_group_id_and_id ON events USING btree (group_id, id) WHERE (group_id IS NOT NULL); + CREATE INDEX index_events_on_group_id_partial ON events USING btree (group_id) WHERE (group_id IS NOT NULL); CREATE INDEX index_events_on_project_id_and_created_at ON events USING btree (project_id, created_at); @@ -29431,8 +29548,6 @@ CREATE UNIQUE INDEX index_fork_networks_on_root_project_id ON fork_networks USIN CREATE INDEX index_geo_event_log_on_cache_invalidation_event_id ON geo_event_log USING btree (cache_invalidation_event_id) WHERE (cache_invalidation_event_id IS NOT NULL); -CREATE INDEX index_geo_event_log_on_container_repository_updated_event_id ON geo_event_log USING btree (container_repository_updated_event_id); - CREATE INDEX index_geo_event_log_on_geo_event_id ON geo_event_log USING btree (geo_event_id) WHERE (geo_event_id IS NOT NULL); CREATE INDEX index_geo_event_log_on_hashed_storage_attachments_event_id ON geo_event_log USING btree (hashed_storage_attachments_event_id) WHERE (hashed_storage_attachments_event_id IS NOT NULL); @@ -29575,6 +29690,8 @@ CREATE INDEX index_group_wiki_repositories_on_shard_id ON group_wiki_repositorie CREATE INDEX index_groups_on_parent_id_id ON namespaces USING btree (parent_id, id) WHERE ((type)::text = 'Group'::text); +CREATE INDEX index_groups_on_path_and_id ON namespaces USING btree (path, id) WHERE ((type)::text = 'Group'::text); + CREATE INDEX index_historical_data_on_recorded_at ON historical_data USING btree (recorded_at); CREATE UNIQUE INDEX index_http_integrations_on_active_and_project_and_endpoint ON alert_management_http_integrations USING btree (active, project_id, endpoint_identifier) WHERE active; @@ -29905,6 +30022,8 @@ CREATE UNIQUE INDEX index_members_on_invite_token ON members USING btree (invite CREATE INDEX index_members_on_member_namespace_id ON members USING btree (member_namespace_id); +CREATE INDEX index_members_on_member_namespace_id_compound ON members USING btree (member_namespace_id, type, requested_at, id); + CREATE INDEX index_members_on_member_role_id ON members USING btree (member_role_id); CREATE INDEX index_members_on_requested_at ON members USING btree (requested_at); @@ -29917,8 +30036,6 @@ CREATE INDEX index_members_on_user_id_and_access_level_requested_at_is_null ON m 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); @@ -30141,6 +30258,8 @@ CREATE UNIQUE INDEX index_namespaces_on_parent_id_and_id ON namespaces USING btr CREATE INDEX index_namespaces_on_path ON namespaces USING btree (path); +CREATE INDEX index_namespaces_on_path_for_top_level_non_projects ON namespaces USING btree (lower((path)::text)) WHERE ((parent_id IS NULL) AND ((type)::text <> 'Project'::text)); + CREATE INDEX index_namespaces_on_path_trigram ON namespaces USING gin (path gin_trgm_ops); CREATE UNIQUE INDEX index_namespaces_on_push_rule_id ON namespaces USING btree (push_rule_id); @@ -30907,14 +31026,14 @@ CREATE INDEX index_sbom_occurrences_on_component_id ON sbom_occurrences USING bt CREATE INDEX index_sbom_occurrences_on_component_version_id ON sbom_occurrences USING btree (component_version_id); -CREATE UNIQUE INDEX index_sbom_occurrences_on_ingestion_attributes ON sbom_occurrences USING btree (project_id, component_id, component_version_id, source_id, commit_sha); - CREATE INDEX index_sbom_occurrences_on_pipeline_id ON sbom_occurrences USING btree (pipeline_id); CREATE INDEX index_sbom_occurrences_on_project_id ON sbom_occurrences USING btree (project_id); CREATE INDEX index_sbom_occurrences_on_source_id ON sbom_occurrences USING btree (source_id); +CREATE UNIQUE INDEX index_sbom_occurrences_on_uuid ON sbom_occurrences USING btree (uuid); + CREATE UNIQUE INDEX index_sbom_sources_on_source_type_and_source ON sbom_sources USING btree (source_type, source); CREATE INDEX index_scim_identities_on_group_id ON scim_identities USING btree (group_id); @@ -31061,6 +31180,8 @@ CREATE INDEX index_ssh_signatures_on_key_id ON ssh_signatures USING btree (key_i CREATE INDEX index_ssh_signatures_on_project_id ON ssh_signatures USING btree (project_id); +CREATE INDEX index_ssh_signatures_on_user_id ON ssh_signatures USING btree (user_id); + 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_external_status_check_id ON status_check_responses USING btree (external_status_check_id); @@ -31213,6 +31334,14 @@ CREATE INDEX index_uploads_on_store ON uploads USING btree (store); CREATE INDEX index_uploads_on_uploader_and_path ON uploads USING btree (uploader, path); +CREATE INDEX index_user_achievements_on_achievement_id_revoked_by_is_null ON user_achievements USING btree (achievement_id, ((revoked_by_user_id IS NULL))); + +CREATE INDEX index_user_achievements_on_awarded_by_revoked_by_is_null ON user_achievements USING btree (awarded_by_user_id, ((revoked_by_user_id IS NULL))); + +CREATE INDEX index_user_achievements_on_revoked_by_user_id ON user_achievements USING btree (revoked_by_user_id); + +CREATE INDEX index_user_achievements_on_user_id_revoked_by_is_null ON user_achievements USING btree (user_id, ((revoked_by_user_id IS NULL))); + CREATE INDEX index_user_agent_details_on_subject_id_and_subject_type ON user_agent_details USING btree (subject_id, subject_type); CREATE INDEX index_user_callouts_on_user_id ON user_callouts USING btree (user_id); @@ -31267,7 +31396,7 @@ CREATE INDEX index_user_statuses_on_user_id ON user_statuses USING btree (user_i CREATE UNIQUE INDEX index_user_synced_attributes_metadata_on_user_id ON user_synced_attributes_metadata USING btree (user_id); -CREATE INDEX index_users_for_active_billable 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 ('{1,2,3,4,5,6,7,8,9,11}'::smallint[])))); +CREATE INDEX index_users_for_billable_users ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[6, 4]))) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[4, 5])))); CREATE INDEX index_users_on_accepted_term_id ON users USING btree (accepted_term_id); @@ -31337,14 +31466,14 @@ COMMENT ON INDEX index_verification_codes_on_phone_and_visitor_id_code IS 'JiHu- CREATE UNIQUE INDEX index_vuln_historical_statistics_on_project_id_and_date ON vulnerability_historical_statistics USING btree (project_id, date); +CREATE INDEX index_vuln_reads_common_query_on_resolved_on_default_branch ON vulnerability_reads USING btree (project_id, state, report_type, vulnerability_id DESC) WHERE (resolved_on_default_branch IS TRUE); + CREATE INDEX index_vuln_reads_on_casted_cluster_agent_id_where_it_is_null ON vulnerability_reads USING btree (casted_cluster_agent_id) WHERE (casted_cluster_agent_id IS NOT NULL); CREATE INDEX index_vuln_reads_on_namespace_id_state_severity_and_vuln_id ON vulnerability_reads USING btree (namespace_id, state, severity, vulnerability_id DESC); CREATE INDEX index_vuln_reads_on_project_id_state_severity_and_vuln_id ON vulnerability_reads USING btree (project_id, state, severity, vulnerability_id DESC); -CREATE INDEX index_vuln_reads_on_resolved_on_default_branch ON vulnerability_reads USING btree (project_id, state, id) WHERE (resolved_on_default_branch IS TRUE); - CREATE INDEX index_vulnerabilities_common_finder_query_on_default_branch ON vulnerabilities USING btree (project_id, state, report_type, present_on_default_branch, severity, id); CREATE INDEX index_vulnerabilities_on_author_id ON vulnerabilities USING btree (author_id); @@ -31633,10 +31762,6 @@ CREATE INDEX tmp_idx_for_feedback_comment_processing ON vulnerability_feedback U CREATE INDEX tmp_idx_for_vulnerability_feedback_migration ON vulnerability_feedback USING btree (id) WHERE ((migrated_to_state_transition = false) AND (feedback_type = 0)); -CREATE INDEX tmp_idx_vulnerabilities_on_id_where_report_type_7_99 ON vulnerabilities USING btree (id) WHERE (report_type = ANY (ARRAY[7, 99])); - -CREATE INDEX tmp_idx_where_user_details_fields_filled ON users USING btree (id) WHERE (((COALESCE(linkedin, ''::character varying))::text IS DISTINCT FROM ''::text) OR ((COALESCE(twitter, ''::character varying))::text IS DISTINCT FROM ''::text) OR ((COALESCE(skype, ''::character varying))::text IS DISTINCT FROM ''::text) OR ((COALESCE(website_url, ''::character varying))::text IS DISTINCT FROM ''::text) OR ((COALESCE(location, ''::character varying))::text IS DISTINCT FROM ''::text) OR ((COALESCE(organization, ''::character varying))::text IS DISTINCT FROM ''::text)); - CREATE INDEX tmp_index_ci_job_artifacts_on_expire_at_where_locked_unknown ON ci_job_artifacts USING btree (expire_at, job_id) WHERE ((locked = 2) AND (expire_at IS NOT NULL)); CREATE INDEX tmp_index_ci_job_artifacts_on_id_expire_at_file_type_trace ON ci_job_artifacts USING btree (id) WHERE (((date_part('day'::text, timezone('UTC'::text, expire_at)) = ANY (ARRAY[(21)::double precision, (22)::double precision, (23)::double precision])) AND (date_part('minute'::text, timezone('UTC'::text, expire_at)) = ANY (ARRAY[(0)::double precision, (30)::double precision, (45)::double precision])) AND (date_part('second'::text, timezone('UTC'::text, expire_at)) = (0)::double precision)) OR (file_type = 3)); @@ -31655,11 +31780,13 @@ CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (st CREATE INDEX tmp_index_migrated_container_registries ON container_repositories USING btree (project_id) WHERE ((migration_state = 'import_done'::text) OR (created_at >= '2022-01-23 00:00:00'::timestamp without time zone)); +CREATE INDEX tmp_index_oauth_access_tokens_on_id_where_expires_in_null ON oauth_access_tokens USING btree (id) WHERE (expires_in IS NULL); + CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2); CREATE INDEX tmp_index_project_statistics_cont_registry_size ON project_statistics USING btree (project_id) WHERE (container_registry_size = 0); -CREATE INDEX tmp_index_project_statistics_uploads_size ON project_statistics USING btree (project_id) WHERE (uploads_size <> 0); +CREATE INDEX tmp_index_vulnerability_overlong_title_html ON vulnerabilities USING btree (id) WHERE (length(title_html) > 800); CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name); @@ -31677,6 +31804,8 @@ CREATE UNIQUE INDEX uniq_pkgs_debian_project_distributions_project_id_and_codena CREATE UNIQUE INDEX uniq_pkgs_debian_project_distributions_project_id_and_suite ON packages_debian_project_distributions USING btree (project_id, suite); +CREATE UNIQUE INDEX unique_ci_builds_token_encrypted_and_partition_id ON ci_builds USING btree (token_encrypted, partition_id) WHERE (token_encrypted IS NOT NULL); + CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON merge_request_metrics USING btree (merge_request_id); CREATE UNIQUE INDEX unique_projects_on_name_namespace_id ON projects USING btree (name, namespace_id); @@ -33003,10 +33132,6 @@ CREATE TRIGGER nullify_merge_request_metrics_build_data_on_update BEFORE UPDATE CREATE TRIGGER projects_loose_fk_trigger AFTER DELETE ON projects REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); -CREATE TRIGGER sync_namespaces_amount_used_columns BEFORE INSERT OR UPDATE ON ci_namespace_monthly_usages FOR EACH ROW EXECUTE FUNCTION sync_namespaces_amount_used_columns(); - -CREATE TRIGGER sync_projects_amount_used_columns BEFORE INSERT OR UPDATE ON ci_project_monthly_usages FOR EACH ROW EXECUTE FUNCTION sync_projects_amount_used_columns(); - CREATE TRIGGER trigger_1a857e8db6cd BEFORE INSERT OR UPDATE ON vulnerability_occurrences FOR EACH ROW EXECUTE FUNCTION trigger_1a857e8db6cd(); CREATE TRIGGER trigger_delete_project_namespace_on_project_delete AFTER DELETE ON projects FOR EACH ROW WHEN ((old.project_namespace_id IS NOT NULL)) EXECUTE FUNCTION delete_associated_project_namespace(); @@ -33086,6 +33211,9 @@ ALTER TABLE ONLY dast_sites ALTER TABLE ONLY issue_customer_relations_contacts ADD CONSTRAINT fk_0c0037f723 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY ssh_signatures + ADD CONSTRAINT fk_0c83baaa5f FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY web_hooks ADD CONSTRAINT fk_0c8ca6d9d1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33098,6 +33226,9 @@ ALTER TABLE ONLY lists 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 ci_unit_test_failures + ADD CONSTRAINT fk_0f09856e1f_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON DELETE CASCADE; + ALTER TABLE ONLY deployment_approvals ADD CONSTRAINT fk_0f58311058 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -33167,9 +33298,6 @@ ALTER TABLE ONLY coverage_fuzzing_corpuses ALTER TABLE ONLY namespace_settings ADD CONSTRAINT fk_20cf0eb2f9 FOREIGN KEY (default_compliance_framework_id) REFERENCES compliance_management_frameworks(id) ON DELETE SET NULL; -ALTER TABLE ONLY geo_container_repository_updated_events - ADD CONSTRAINT fk_212c89c706 FOREIGN KEY (container_repository_id) REFERENCES container_repositories(id) ON DELETE CASCADE; - ALTER TABLE ONLY ci_build_trace_metadata ADD CONSTRAINT fk_21d25cac1a FOREIGN KEY (trace_artifact_id) REFERENCES ci_job_artifacts(id) ON DELETE CASCADE; @@ -33323,6 +33451,9 @@ ALTER TABLE ONLY sbom_occurrences ALTER TABLE ONLY namespace_commit_emails ADD CONSTRAINT fk_4d6ba63ba5 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_achievements + ADD CONSTRAINT fk_4efde02858 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_reads ADD CONSTRAINT fk_4f593f6c62 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -33377,6 +33508,9 @@ ALTER TABLE ONLY csv_issue_imports ALTER TABLE ONLY project_access_tokens ADD CONSTRAINT fk_5f7e8450e1 FOREIGN KEY (personal_access_token_id) REFERENCES personal_access_tokens(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_achievements + ADD CONSTRAINT fk_60b12fcda3 FOREIGN KEY (awarded_by_user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_6149611a04 FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL; @@ -33407,9 +33541,6 @@ ALTER TABLE ONLY project_wiki_repository_states ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_6a5165a692 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; -ALTER TABLE ONLY geo_event_log - ADD CONSTRAINT fk_6ada82d42a FOREIGN KEY (container_repository_updated_event_id) REFERENCES geo_container_repository_updated_events(id) ON DELETE CASCADE; - ALTER TABLE ONLY projects ADD CONSTRAINT fk_6ca23af0a3 FOREIGN KEY (project_namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -33578,9 +33709,6 @@ ALTER TABLE ONLY vulnerability_occurrences ALTER TABLE ONLY protected_branch_merge_access_levels ADD CONSTRAINT fk_98f3d044fe FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY chat_names - ADD CONSTRAINT fk_99a1348daf FOREIGN KEY (integration_id) REFERENCES integrations(id) ON DELETE CASCADE; - ALTER TABLE ONLY notes ADD CONSTRAINT fk_99e097b079 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33632,6 +33760,9 @@ ALTER TABLE ONLY lfs_objects_projects ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_a6963e8447 FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ssh_signatures + ADD CONSTRAINT fk_aa1efbe865 FOREIGN KEY (key_id) REFERENCES keys(id) ON DELETE SET NULL; + ALTER TABLE ONLY epics ADD CONSTRAINT fk_aa5798e761 FOREIGN KEY (closed_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -33833,6 +33964,9 @@ ALTER TABLE ONLY agent_activity_events ALTER TABLE ONLY sbom_vulnerable_component_versions ADD CONSTRAINT fk_d720a1959a FOREIGN KEY (vulnerability_advisory_id) REFERENCES vulnerability_advisories(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_achievements + ADD CONSTRAINT fk_d7653ef780 FOREIGN KEY (revoked_by_user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY metrics_users_starred_dashboards ADD CONSTRAINT fk_d76a2b9a8c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33947,9 +34081,6 @@ ALTER TABLE ONLY epics ALTER TABLE ONLY boards ADD CONSTRAINT fk_f15266b5f9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY ssh_signatures - ADD CONSTRAINT fk_f177ea6aa5 FOREIGN KEY (key_id) REFERENCES keys(id) ON DELETE CASCADE; - ALTER TABLE ONLY ci_pipeline_variables ADD CONSTRAINT fk_f29c5f4380 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; @@ -34061,6 +34192,9 @@ ALTER TABLE ONLY related_epic_links ALTER TABLE ONLY ci_build_pending_states ADD CONSTRAINT fk_rails_0bbbfeaf9d FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_build_pending_states + ADD CONSTRAINT fk_rails_0bbbfeaf9d_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON DELETE CASCADE; + ALTER TABLE ONLY audit_events_external_audit_event_destinations ADD CONSTRAINT fk_rails_0bc80a4edc FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -34091,6 +34225,9 @@ ALTER TABLE ONLY merge_request_context_commits ALTER TABLE ONLY ci_build_trace_chunks ADD CONSTRAINT fk_rails_1013b761f2 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_build_trace_chunks + ADD CONSTRAINT fk_rails_1013b761f2_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_exports ADD CONSTRAINT fk_rails_1019162882 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; @@ -34541,6 +34678,9 @@ ALTER TABLE ONLY project_repository_storage_moves ALTER TABLE ONLY ml_candidate_metadata ADD CONSTRAINT fk_rails_5117dddf22 FOREIGN KEY (candidate_id) REFERENCES ml_candidates(id) ON DELETE CASCADE; +ALTER TABLE ONLY elastic_group_index_statuses + ADD CONSTRAINT fk_rails_52b9969b12 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY bulk_import_configurations ADD CONSTRAINT fk_rails_536b96bff1 FOREIGN KEY (bulk_import_id) REFERENCES bulk_imports(id) ON DELETE CASCADE; @@ -34697,6 +34837,9 @@ 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 ci_runner_machines + ADD CONSTRAINT fk_rails_666b61f04f FOREIGN KEY (runner_id) REFERENCES ci_runners(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; @@ -34739,6 +34882,9 @@ ALTER TABLE ONLY users_security_dashboard_projects ALTER TABLE ONLY dast_sites ADD CONSTRAINT fk_rails_6febb6ea9c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_dashboards_pointers + ADD CONSTRAINT fk_rails_7027b7eaa9 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_builds_runner_session ADD CONSTRAINT fk_rails_70707857d3 FOREIGN KEY (build_id) REFERENCES ci_builds(id) ON DELETE CASCADE; @@ -35291,6 +35437,9 @@ ALTER TABLE ONLY project_wiki_repositories 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 user_achievements + ADD CONSTRAINT fk_rails_c44f5b3b25 FOREIGN KEY (achievement_id) REFERENCES achievements(id) ON DELETE CASCADE; + ALTER TABLE ONLY related_epic_links ADD CONSTRAINT fk_rails_c464534def FOREIGN KEY (source_id) REFERENCES epics(id) ON DELETE CASCADE; @@ -35576,6 +35725,9 @@ ALTER TABLE ONLY security_orchestration_policy_rule_schedules ALTER TABLE ONLY dast_pre_scan_verifications ADD CONSTRAINT fk_rails_f08d9312a8 FOREIGN KEY (dast_profile_id) REFERENCES dast_profiles(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_dashboards_pointers + ADD CONSTRAINT fk_rails_f0e7c640c3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY prometheus_alerts ADD CONSTRAINT fk_rails_f0e8db86aa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; |