diff options
Diffstat (limited to 'db/structure.sql')
-rw-r--r-- | db/structure.sql | 486 |
1 files changed, 409 insertions, 77 deletions
diff --git a/db/structure.sql b/db/structure.sql index c6b3b7ea997..8936087bd2b 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -41,6 +41,62 @@ RETURN NULL; END $$; +CREATE FUNCTION table_sync_function_29bc99d6db() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN +IF (TG_OP = 'DELETE') THEN + DELETE FROM web_hook_logs_part_0c5294f417 where id = OLD.id; +ELSIF (TG_OP = 'UPDATE') THEN + UPDATE web_hook_logs_part_0c5294f417 + 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, + updated_at = NEW.updated_at, + created_at = NEW.created_at + WHERE web_hook_logs_part_0c5294f417.id = NEW.id; +ELSIF (TG_OP = 'INSERT') THEN + INSERT INTO web_hook_logs_part_0c5294f417 (id, + web_hook_id, + trigger, + url, + request_headers, + request_data, + response_headers, + response_body, + response_status, + execution_duration, + internal_error_message, + updated_at, + created_at) + VALUES (NEW.id, + 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.updated_at, + NEW.created_at); +END IF; +RETURN NULL; + +END +$$; + +COMMENT ON FUNCTION table_sync_function_29bc99d6db() IS 'Partitioning migration: table sync for web_hook_logs table'; + CREATE FUNCTION table_sync_function_2be879775d() RETURNS trigger LANGUAGE plpgsql AS $$ @@ -114,6 +170,23 @@ CREATE TABLE audit_events ( ) PARTITION BY RANGE (created_at); +CREATE TABLE web_hook_logs_part_0c5294f417 ( + 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 TABLE product_analytics_events_experimental ( id bigint NOT NULL, project_id integer NOT NULL, @@ -9398,6 +9471,7 @@ CREATE TABLE application_settings ( notes_create_limit integer DEFAULT 300 NOT NULL, notes_create_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL, kroki_formats jsonb DEFAULT '{}'::jsonb NOT NULL, + in_product_marketing_emails_enabled boolean DEFAULT true NOT NULL, asset_proxy_whitelist text, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), CONSTRAINT app_settings_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)), @@ -9746,23 +9820,6 @@ CREATE SEQUENCE background_migration_jobs_id_seq ALTER SEQUENCE background_migration_jobs_id_seq OWNED BY background_migration_jobs.id; -CREATE TABLE backup_labels ( - id integer NOT NULL, - title character varying, - color character varying, - project_id integer, - created_at timestamp without time zone, - updated_at timestamp without time zone, - template boolean DEFAULT false, - description character varying, - description_html text, - type character varying, - group_id integer, - cached_markdown_version integer, - restore_action integer, - new_title character varying -); - CREATE TABLE badges ( id integer NOT NULL, link_url character varying NOT NULL, @@ -9784,6 +9841,64 @@ CREATE SEQUENCE badges_id_seq ALTER SEQUENCE badges_id_seq OWNED BY badges.id; +CREATE TABLE batched_background_migration_jobs ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + started_at timestamp with time zone, + finished_at timestamp with time zone, + batched_background_migration_id bigint NOT NULL, + min_value bigint NOT NULL, + max_value bigint NOT NULL, + batch_size integer NOT NULL, + sub_batch_size integer NOT NULL, + status smallint DEFAULT 0 NOT NULL, + attempts smallint DEFAULT 0 NOT NULL +); + +CREATE SEQUENCE batched_background_migration_jobs_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE batched_background_migration_jobs_id_seq OWNED BY batched_background_migration_jobs.id; + +CREATE TABLE batched_background_migrations ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + min_value bigint DEFAULT 1 NOT NULL, + max_value bigint NOT NULL, + batch_size integer NOT NULL, + sub_batch_size integer NOT NULL, + "interval" smallint NOT NULL, + status smallint DEFAULT 0 NOT NULL, + job_class_name 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, + 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)), + CONSTRAINT check_e6c75b1e29 CHECK ((char_length(job_class_name) <= 100)), + CONSTRAINT check_fe10674721 CHECK ((char_length(batch_class_name) <= 100)), + CONSTRAINT check_max_value_in_range CHECK ((max_value >= min_value)), + CONSTRAINT check_positive_min_value CHECK ((min_value > 0)), + CONSTRAINT check_positive_sub_batch_size CHECK ((sub_batch_size > 0)) +); + +CREATE SEQUENCE batched_background_migrations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE batched_background_migrations_id_seq OWNED BY batched_background_migrations.id; + CREATE TABLE board_assignees ( id integer NOT NULL, board_id integer NOT NULL, @@ -9935,6 +10050,24 @@ CREATE SEQUENCE boards_epic_boards_id_seq ALTER SEQUENCE boards_epic_boards_id_seq OWNED BY boards_epic_boards.id; +CREATE TABLE boards_epic_list_user_preferences ( + id bigint NOT NULL, + user_id bigint NOT NULL, + epic_list_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + collapsed boolean DEFAULT false NOT NULL +); + +CREATE SEQUENCE boards_epic_list_user_preferences_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE boards_epic_list_user_preferences_id_seq OWNED BY boards_epic_list_user_preferences.id; + CREATE TABLE boards_epic_lists ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -10086,8 +10219,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))) ); @@ -10162,7 +10299,8 @@ CREATE TABLE ci_build_needs ( id integer NOT NULL, build_id integer NOT NULL, name text NOT NULL, - artifacts boolean DEFAULT true NOT NULL + artifacts boolean DEFAULT true NOT NULL, + optional boolean DEFAULT false NOT NULL ); CREATE SEQUENCE ci_build_needs_id_seq @@ -10264,7 +10402,6 @@ CREATE TABLE ci_builds ( runner_id integer, coverage double precision, commit_id integer, - commands text, name character varying, options text, allow_failure boolean DEFAULT false NOT NULL, @@ -10277,14 +10414,11 @@ CREATE TABLE ci_builds ( type character varying, target_url character varying, description character varying, - artifacts_file text, project_id integer, - artifacts_metadata text, erased_by_id integer, erased_at timestamp without time zone, artifacts_expire_at timestamp without time zone, environment character varying, - artifacts_size bigint, "when" character varying, yaml_variables text, queued_at timestamp without time zone, @@ -10294,8 +10428,6 @@ CREATE TABLE ci_builds ( auto_canceled_by_id integer, retried boolean, stage_id integer, - artifacts_file_store integer, - artifacts_metadata_store integer, protected boolean, failure_reason integer, scheduled_at timestamp with time zone, @@ -10428,7 +10560,9 @@ CREATE TABLE ci_group_variables ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, masked boolean DEFAULT false NOT NULL, - variable_type smallint DEFAULT 1 NOT NULL + variable_type smallint DEFAULT 1 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 @@ -10830,7 +10964,6 @@ CREATE TABLE ci_runners ( description character varying, contacted_at timestamp without time zone, active boolean DEFAULT true NOT NULL, - is_shared boolean DEFAULT false, name character varying, version character varying, revision character varying, @@ -11026,6 +11159,11 @@ CREATE TABLE cluster_agent_tokens ( agent_id bigint NOT NULL, token_encrypted text NOT NULL, created_by_user_id bigint, + description text, + name text, + last_used_at timestamp with time zone, + 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)) ); @@ -11607,6 +11745,7 @@ CREATE TABLE custom_emoji ( name text NOT NULL, file text NOT NULL, external boolean DEFAULT true NOT NULL, + creator_id bigint NOT NULL, CONSTRAINT check_8c586dd507 CHECK ((char_length(name) <= 36)), CONSTRAINT check_dd5d60f1fb CHECK ((char_length(file) <= 255)) ); @@ -11629,7 +11768,9 @@ CREATE TABLE dast_profiles ( updated_at timestamp with time zone NOT NULL, name text NOT NULL, description text NOT NULL, + branch_name text, CONSTRAINT check_5fcf73bf61 CHECK ((char_length(name) <= 255)), + CONSTRAINT check_6c9d775949 CHECK ((char_length(branch_name) <= 255)), CONSTRAINT check_c34e505c24 CHECK ((char_length(description) <= 255)) ); @@ -12016,6 +12157,25 @@ CREATE SEQUENCE diff_note_positions_id_seq ALTER SEQUENCE diff_note_positions_id_seq OWNED BY diff_note_positions.id; +CREATE TABLE dora_daily_metrics ( + id bigint NOT NULL, + environment_id bigint NOT NULL, + date date NOT NULL, + deployment_frequency integer, + lead_time_for_changes_in_seconds integer, + CONSTRAINT dora_daily_metrics_deployment_frequency_positive CHECK ((deployment_frequency >= 0)), + CONSTRAINT dora_daily_metrics_lead_time_for_changes_in_seconds_positive CHECK ((lead_time_for_changes_in_seconds >= 0)) +); + +CREATE SEQUENCE dora_daily_metrics_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE dora_daily_metrics_id_seq OWNED BY dora_daily_metrics.id; + CREATE TABLE draft_notes ( id bigint NOT NULL, merge_request_id integer NOT NULL, @@ -12135,7 +12295,8 @@ CREATE TABLE environments ( state character varying DEFAULT 'available'::character varying NOT NULL, slug character varying NOT NULL, auto_stop_at timestamp with time zone, - auto_delete_at timestamp with time zone + auto_delete_at timestamp with time zone, + tier smallint ); CREATE SEQUENCE environments_id_seq @@ -12342,6 +12503,41 @@ CREATE SEQUENCE experiments_id_seq ALTER SEQUENCE experiments_id_seq OWNED BY experiments.id; +CREATE TABLE external_approval_rules ( + id bigint NOT NULL, + project_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + external_url text NOT NULL, + name text NOT NULL, + CONSTRAINT check_1c64b53ea5 CHECK ((char_length(name) <= 255)), + CONSTRAINT check_b634ca168d CHECK ((char_length(external_url) <= 255)) +); + +CREATE SEQUENCE external_approval_rules_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE external_approval_rules_id_seq OWNED BY external_approval_rules.id; + +CREATE TABLE external_approval_rules_protected_branches ( + id bigint NOT NULL, + external_approval_rule_id bigint NOT NULL, + protected_branch_id bigint NOT NULL +); + +CREATE SEQUENCE external_approval_rules_protected_branches_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE external_approval_rules_protected_branches_id_seq OWNED BY external_approval_rules_protected_branches.id; + CREATE TABLE external_pull_requests ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -13075,7 +13271,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 ( @@ -13191,7 +13391,8 @@ CREATE TABLE incident_management_oncall_participants ( oncall_rotation_id bigint NOT NULL, user_id bigint NOT NULL, color_palette smallint NOT NULL, - color_weight smallint NOT NULL + color_weight smallint NOT NULL, + is_removed boolean DEFAULT false NOT NULL ); CREATE SEQUENCE incident_management_oncall_participants_id_seq @@ -13212,6 +13413,9 @@ CREATE TABLE incident_management_oncall_rotations ( length_unit smallint NOT NULL, starts_at timestamp with time zone NOT NULL, name text NOT NULL, + ends_at timestamp with time zone, + active_period_start time without time zone, + active_period_end time without time zone, CONSTRAINT check_5209fb5d02 CHECK ((char_length(name) <= 200)) ); @@ -13544,6 +13748,30 @@ CREATE TABLE issues_self_managed_prometheus_alert_events ( updated_at timestamp with time zone NOT NULL ); +CREATE TABLE iterations_cadences ( + 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, + start_date date NOT NULL, + last_run_date date, + duration_in_weeks integer, + iterations_in_advance integer, + active boolean DEFAULT true NOT NULL, + automatic boolean DEFAULT true NOT NULL, + title text NOT NULL, + CONSTRAINT check_fedff82d3b CHECK ((char_length(title) <= 255)) +); + +CREATE SEQUENCE iterations_cadences_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE iterations_cadences_id_seq OWNED BY iterations_cadences.id; + CREATE TABLE jira_connect_installations ( id bigint NOT NULL, client_key character varying, @@ -14339,6 +14567,7 @@ 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, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)) ); @@ -14346,7 +14575,9 @@ CREATE TABLE namespace_statistics ( id integer NOT NULL, namespace_id integer NOT NULL, shared_runners_seconds integer DEFAULT 0 NOT NULL, - shared_runners_seconds_last_reset timestamp without time zone + shared_runners_seconds_last_reset timestamp without time zone, + storage_size bigint DEFAULT 0 NOT NULL, + wiki_size bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE namespace_statistics_id_seq @@ -14467,7 +14698,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 @@ -14506,7 +14738,8 @@ CREATE TABLE notification_settings ( fixed_pipeline boolean, new_release boolean, moved_project boolean DEFAULT true NOT NULL, - change_reviewer_merge_request boolean + change_reviewer_merge_request boolean, + merge_when_pipeline_succeeds boolean DEFAULT false NOT NULL ); CREATE SEQUENCE notification_settings_id_seq @@ -14621,7 +14854,8 @@ CREATE TABLE onboarding_progresses ( security_scan_enabled_at timestamp with time zone, issue_auto_closed_at timestamp with time zone, repository_imported_at timestamp with time zone, - repository_mirrored_at timestamp with time zone + repository_mirrored_at timestamp with time zone, + issue_created_at timestamp with time zone ); CREATE SEQUENCE onboarding_progresses_id_seq @@ -15529,7 +15763,8 @@ CREATE TABLE plan_limits ( ci_pipeline_deployments integer DEFAULT 500 NOT NULL, pull_mirror_interval_seconds integer DEFAULT 300 NOT NULL, daily_invites integer DEFAULT 0 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 ); CREATE SEQUENCE plan_limits_id_seq @@ -15977,7 +16212,8 @@ CREATE TABLE project_features ( requirements_access_level integer DEFAULT 20 NOT NULL, operations_access_level integer DEFAULT 20 NOT NULL, analytics_access_level integer DEFAULT 20 NOT NULL, - security_and_compliance_access_level integer DEFAULT 10 NOT NULL + security_and_compliance_access_level integer DEFAULT 10 NOT NULL, + container_registry_access_level integer DEFAULT 0 NOT NULL ); CREATE SEQUENCE project_features_id_seq @@ -16179,6 +16415,7 @@ CREATE TABLE project_settings ( has_vulnerabilities boolean DEFAULT false NOT NULL, allow_editing_commit_messages boolean DEFAULT false NOT NULL, prevent_merge_without_jira_issue boolean DEFAULT false NOT NULL, + cve_id_request_enabled boolean DEFAULT true NOT NULL, CONSTRAINT check_bde223416c CHECK ((show_default_award_emojis IS NOT NULL)) ); @@ -16449,7 +16686,8 @@ CREATE TABLE protected_branches ( name character varying NOT NULL, created_at timestamp without time zone, updated_at timestamp without time zone, - code_owner_approval_required boolean DEFAULT false NOT NULL + code_owner_approval_required boolean DEFAULT false NOT NULL, + allow_force_push boolean DEFAULT false NOT NULL ); CREATE SEQUENCE protected_branches_id_seq @@ -17017,7 +17255,8 @@ CREATE TABLE security_scans ( 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 @@ -17357,6 +17596,7 @@ CREATE TABLE sprints ( description text, description_html text, state_enum smallint DEFAULT 1 NOT NULL, + iterations_cadence_id integer, CONSTRAINT sprints_must_belong_to_project_or_group CHECK ((((project_id <> NULL::bigint) AND (group_id IS NULL)) OR ((group_id <> NULL::bigint) AND (project_id IS NULL)))), CONSTRAINT sprints_title CHECK ((char_length(title) <= 255)) ); @@ -17562,7 +17802,7 @@ CREATE TABLE terraform_states ( locked_at timestamp with time zone, locked_by_user_id bigint, uuid character varying(32) NOT NULL, - name character varying(255), + name character varying(255) NOT NULL, versioning_enabled boolean DEFAULT true NOT NULL ); @@ -17851,7 +18091,8 @@ CREATE TABLE user_preferences ( tab_width smallint, experience_level smallint, view_diffs_file_by_file boolean DEFAULT false NOT NULL, - gitpod_enabled boolean DEFAULT false NOT NULL + gitpod_enabled boolean DEFAULT false NOT NULL, + markdown_surround_selection boolean DEFAULT true NOT NULL ); CREATE SEQUENCE user_preferences_id_seq @@ -18180,7 +18421,7 @@ CREATE TABLE vulnerability_finding_fingerprints ( finding_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - algorithm_type integer NOT NULL, + algorithm_type smallint NOT NULL, fingerprint_sha256 bytea NOT NULL ); @@ -18718,6 +18959,10 @@ ALTER TABLE ONLY background_migration_jobs ALTER COLUMN id SET DEFAULT nextval(' ALTER TABLE ONLY badges ALTER COLUMN id SET DEFAULT nextval('badges_id_seq'::regclass); +ALTER TABLE ONLY batched_background_migration_jobs ALTER COLUMN id SET DEFAULT nextval('batched_background_migration_jobs_id_seq'::regclass); + +ALTER TABLE ONLY batched_background_migrations ALTER COLUMN id SET DEFAULT nextval('batched_background_migrations_id_seq'::regclass); + ALTER TABLE ONLY board_assignees ALTER COLUMN id SET DEFAULT nextval('board_assignees_id_seq'::regclass); ALTER TABLE ONLY board_group_recent_visits ALTER COLUMN id SET DEFAULT nextval('board_group_recent_visits_id_seq'::regclass); @@ -18736,6 +18981,8 @@ ALTER TABLE ONLY boards_epic_board_positions ALTER COLUMN id SET DEFAULT nextval 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); + ALTER TABLE ONLY boards_epic_lists ALTER COLUMN id SET DEFAULT nextval('boards_epic_lists_id_seq'::regclass); ALTER TABLE ONLY boards_epic_user_preferences ALTER COLUMN id SET DEFAULT nextval('boards_epic_user_preferences_id_seq'::regclass); @@ -18926,6 +19173,8 @@ ALTER TABLE ONLY design_user_mentions ALTER COLUMN id SET DEFAULT nextval('desig ALTER TABLE ONLY diff_note_positions ALTER COLUMN id SET DEFAULT nextval('diff_note_positions_id_seq'::regclass); +ALTER TABLE ONLY dora_daily_metrics ALTER COLUMN id SET DEFAULT nextval('dora_daily_metrics_id_seq'::regclass); + ALTER TABLE ONLY draft_notes ALTER COLUMN id SET DEFAULT nextval('draft_notes_id_seq'::regclass); ALTER TABLE ONLY elastic_reindexing_subtasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_subtasks_id_seq'::regclass); @@ -18954,6 +19203,10 @@ ALTER TABLE ONLY experiment_users ALTER COLUMN id SET DEFAULT nextval('experimen ALTER TABLE ONLY experiments ALTER COLUMN id SET DEFAULT nextval('experiments_id_seq'::regclass); +ALTER TABLE ONLY external_approval_rules ALTER COLUMN id SET DEFAULT nextval('external_approval_rules_id_seq'::regclass); + +ALTER TABLE ONLY external_approval_rules_protected_branches ALTER COLUMN id SET DEFAULT nextval('external_approval_rules_protected_branches_id_seq'::regclass); + ALTER TABLE ONLY external_pull_requests ALTER COLUMN id SET DEFAULT nextval('external_pull_requests_id_seq'::regclass); ALTER TABLE ONLY feature_gates ALTER COLUMN id SET DEFAULT nextval('feature_gates_id_seq'::regclass); @@ -19068,6 +19321,8 @@ ALTER TABLE ONLY issue_user_mentions ALTER COLUMN id SET DEFAULT nextval('issue_ ALTER TABLE ONLY issues ALTER COLUMN id SET DEFAULT nextval('issues_id_seq'::regclass); +ALTER TABLE ONLY iterations_cadences ALTER COLUMN id SET DEFAULT nextval('iterations_cadences_id_seq'::regclass); + ALTER TABLE ONLY jira_connect_installations ALTER COLUMN id SET DEFAULT nextval('jira_connect_installations_id_seq'::regclass); ALTER TABLE ONLY jira_connect_subscriptions ALTER COLUMN id SET DEFAULT nextval('jira_connect_subscriptions_id_seq'::regclass); @@ -19786,12 +20041,15 @@ ALTER TABLE ONLY aws_roles ALTER TABLE ONLY background_migration_jobs ADD CONSTRAINT background_migration_jobs_pkey PRIMARY KEY (id); -ALTER TABLE ONLY backup_labels - ADD CONSTRAINT backup_labels_pkey PRIMARY KEY (id); - ALTER TABLE ONLY badges ADD CONSTRAINT badges_pkey PRIMARY KEY (id); +ALTER TABLE ONLY batched_background_migration_jobs + ADD CONSTRAINT batched_background_migration_jobs_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY batched_background_migrations + ADD CONSTRAINT batched_background_migrations_pkey PRIMARY KEY (id); + ALTER TABLE ONLY board_assignees ADD CONSTRAINT board_assignees_pkey PRIMARY KEY (id); @@ -19816,6 +20074,9 @@ ALTER TABLE ONLY boards_epic_board_positions ALTER TABLE ONLY boards_epic_boards ADD CONSTRAINT boards_epic_boards_pkey PRIMARY KEY (id); +ALTER TABLE ONLY boards_epic_list_user_preferences + ADD CONSTRAINT boards_epic_list_user_preferences_pkey PRIMARY KEY (id); + ALTER TABLE ONLY boards_epic_lists ADD CONSTRAINT boards_epic_lists_pkey PRIMARY KEY (id); @@ -19849,12 +20110,24 @@ ALTER TABLE ONLY chat_names ALTER TABLE ONLY chat_teams ADD CONSTRAINT chat_teams_pkey PRIMARY KEY (id); +ALTER TABLE cluster_agent_tokens + ADD CONSTRAINT check_0fb634d04d CHECK ((name IS NOT NULL)) NOT VALID; + ALTER TABLE vulnerability_scanners ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID; +ALTER TABLE gitlab_subscriptions + ADD CONSTRAINT check_77fea3f0e7 CHECK ((namespace_id IS NOT NULL)) NOT VALID; + +ALTER TABLE sprints + ADD CONSTRAINT check_ccd8a1eae0 CHECK ((start_date IS NOT NULL)) NOT VALID; + ALTER TABLE group_import_states ADD CONSTRAINT check_cda75c7c3f CHECK ((user_id IS NOT NULL)) NOT VALID; +ALTER TABLE sprints + ADD CONSTRAINT check_df3816aed7 CHECK ((due_date IS NOT NULL)) NOT VALID; + ALTER TABLE ONLY ci_build_needs ADD CONSTRAINT ci_build_needs_pkey PRIMARY KEY (id); @@ -20122,6 +20395,9 @@ ALTER TABLE ONLY design_user_mentions ALTER TABLE ONLY diff_note_positions ADD CONSTRAINT diff_note_positions_pkey PRIMARY KEY (id); +ALTER TABLE ONLY dora_daily_metrics + ADD CONSTRAINT dora_daily_metrics_pkey PRIMARY KEY (id); + ALTER TABLE ONLY draft_notes ADD CONSTRAINT draft_notes_pkey PRIMARY KEY (id); @@ -20170,6 +20446,12 @@ ALTER TABLE ONLY experiment_users ALTER TABLE ONLY experiments ADD CONSTRAINT experiments_pkey PRIMARY KEY (id); +ALTER TABLE ONLY external_approval_rules + ADD CONSTRAINT external_approval_rules_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY external_approval_rules_protected_branches + ADD CONSTRAINT external_approval_rules_protected_branches_pkey PRIMARY KEY (id); + ALTER TABLE ONLY external_pull_requests ADD CONSTRAINT external_pull_requests_pkey PRIMARY KEY (id); @@ -20363,11 +20645,14 @@ ALTER TABLE ONLY issues_self_managed_prometheus_alert_events ADD CONSTRAINT issues_self_managed_prometheus_alert_events_pkey PRIMARY KEY (issue_id, self_managed_prometheus_alert_event_id); ALTER TABLE ONLY sprints - ADD CONSTRAINT iteration_start_and_due_daterange_group_id_constraint EXCLUDE USING gist (group_id WITH =, daterange(start_date, due_date, '[]'::text) WITH &&) WHERE ((group_id IS NOT NULL)); + ADD CONSTRAINT iteration_start_and_due_date_iterations_cadence_id_constraint EXCLUDE USING gist (iterations_cadence_id WITH =, daterange(start_date, due_date, '[]'::text) WITH &&) WHERE ((group_id IS NOT NULL)); ALTER TABLE ONLY sprints ADD CONSTRAINT iteration_start_and_due_daterange_project_id_constraint EXCLUDE USING gist (project_id WITH =, daterange(start_date, due_date, '[]'::text) WITH &&) WHERE ((project_id IS NOT NULL)); +ALTER TABLE ONLY iterations_cadences + ADD CONSTRAINT iterations_cadences_pkey PRIMARY KEY (id); + ALTER TABLE ONLY jira_connect_installations ADD CONSTRAINT jira_connect_installations_pkey PRIMARY KEY (id); @@ -21058,6 +21343,9 @@ 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_part_0c5294f417 + ADD CONSTRAINT web_hook_logs_part_0c5294f417_pkey PRIMARY KEY (id, created_at); + ALTER TABLE ONLY web_hook_logs ADD CONSTRAINT web_hook_logs_pkey PRIMARY KEY (id); @@ -21231,18 +21519,6 @@ CREATE UNIQUE INDEX any_approver_project_rule_type_unique_index ON approval_proj CREATE INDEX approval_mr_rule_index_merge_request_id ON approval_merge_request_rules USING btree (merge_request_id); -CREATE UNIQUE INDEX backup_labels_group_id_project_id_title_idx ON backup_labels USING btree (group_id, project_id, title); - -CREATE INDEX backup_labels_group_id_title_idx ON backup_labels USING btree (group_id, title) WHERE (project_id = NULL::integer); - -CREATE INDEX backup_labels_project_id_idx ON backup_labels USING btree (project_id); - -CREATE INDEX backup_labels_template_idx ON backup_labels USING btree (template) WHERE template; - -CREATE INDEX backup_labels_title_idx ON backup_labels USING btree (title); - -CREATE INDEX backup_labels_type_project_id_idx ON backup_labels USING btree (type, project_id); - CREATE UNIQUE INDEX bulk_import_trackers_uniq_relation_by_entity ON bulk_import_trackers USING btree (bulk_import_entity_id, relation); CREATE INDEX ci_builds_gitlab_monitor_metrics ON ci_builds USING btree (status, created_at, project_id) WHERE ((type)::text = 'Ci::Build'::text); @@ -21277,6 +21553,8 @@ CREATE INDEX idx_container_repositories_on_exp_cleanup_status_and_start_date ON CREATE INDEX idx_deployment_clusters_on_cluster_id_and_kubernetes_namespace ON deployment_clusters USING btree (cluster_id, kubernetes_namespace); +CREATE INDEX idx_eaprpb_external_approval_rule_id ON external_approval_rules_protected_branches USING btree (external_approval_rule_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); @@ -21317,7 +21595,9 @@ CREATE INDEX idx_mr_cc_diff_files_on_mr_cc_id_and_sha ON merge_request_context_c CREATE UNIQUE INDEX idx_on_compliance_management_frameworks_namespace_id_name ON compliance_management_frameworks USING btree (namespace_id, name); -CREATE INDEX idx_on_issues_where_service_desk_reply_to_is_not_null ON issues USING btree (id) WHERE (service_desk_reply_to IS NOT NULL); +CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_external_url ON external_approval_rules USING btree (project_id, external_url); + +CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_name ON external_approval_rules USING btree (project_id, name); CREATE INDEX idx_packages_build_infos_on_package_id ON packages_build_infos USING btree (package_id); @@ -21347,6 +21627,8 @@ CREATE INDEX idx_projects_id_created_at_disable_overriding_approvers_true ON pro CREATE INDEX idx_projects_on_repository_storage_last_repository_updated_at ON projects USING btree (id, repository_storage, last_repository_updated_at); +CREATE UNIQUE INDEX idx_protected_branch_id_external_approval_rule_id ON external_approval_rules_protected_branches USING btree (protected_branch_id, external_approval_rule_id); + CREATE INDEX idx_repository_states_on_last_repository_verification_ran_at ON project_repository_states USING btree (project_id, last_repository_verification_ran_at) WHERE ((repository_verification_checksum IS NOT NULL) AND (last_repository_verification_failure IS NULL)); CREATE INDEX idx_repository_states_on_last_wiki_verification_ran_at ON project_repository_states USING btree (project_id, last_wiki_verification_ran_at) WHERE ((wiki_verification_checksum IS NOT NULL) AND (last_wiki_verification_failure IS NULL)); @@ -21363,9 +21645,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_fingerprints_on_occurrences_id_and_fingerprint_sha256 ON vulnerability_finding_fingerprints USING btree (finding_id, fingerprint_sha256); -CREATE UNIQUE INDEX idx_vuln_fingerprints_uniqueness ON vulnerability_finding_fingerprints USING btree (finding_id, algorithm_type, fingerprint_sha256); +CREATE UNIQUE INDEX idx_vuln_fingerprints_uniqueness_fingerprint_sha256 ON vulnerability_finding_fingerprints USING btree (finding_id, algorithm_type, fingerprint_sha256); 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); @@ -21519,6 +21801,10 @@ CREATE INDEX index_badges_on_group_id ON badges USING btree (group_id); 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_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); CREATE UNIQUE INDEX index_board_assignees_on_board_id_and_assignee_id ON board_assignees USING btree (board_id, assignee_id); @@ -21561,6 +21847,8 @@ CREATE INDEX index_boards_epic_board_positions_on_scoped_relative_position ON bo 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); + CREATE INDEX index_boards_epic_lists_on_epic_board_id ON boards_epic_lists USING btree (epic_board_id); CREATE UNIQUE INDEX index_boards_epic_lists_on_epic_board_id_and_label_id ON boards_epic_lists USING btree (epic_board_id, label_id) WHERE (list_type = 1); @@ -21629,8 +21917,6 @@ CREATE INDEX index_ci_builds_metadata_on_build_id_and_id_and_interruptible ON ci CREATE INDEX index_ci_builds_metadata_on_project_id ON ci_builds_metadata USING btree (project_id); -CREATE INDEX index_ci_builds_on_artifacts_expire_at ON ci_builds USING btree (artifacts_expire_at) WHERE (artifacts_file <> ''::text); - CREATE INDEX index_ci_builds_on_auto_canceled_by_id ON ci_builds USING btree (auto_canceled_by_id); CREATE INDEX index_ci_builds_on_commit_id_and_stage_idx_and_created_at ON ci_builds USING btree (commit_id, stage_idx, created_at); @@ -21685,7 +21971,7 @@ CREATE INDEX index_ci_deleted_objects_on_pick_up_at ON ci_deleted_objects USING CREATE INDEX index_ci_freeze_periods_on_project_id ON ci_freeze_periods USING btree (project_id); -CREATE UNIQUE INDEX index_ci_group_variables_on_group_id_and_key ON ci_group_variables USING btree (group_id, key); +CREATE UNIQUE INDEX index_ci_group_variables_on_group_id_and_key_and_environment ON ci_group_variables USING btree (group_id, key, environment_scope); CREATE UNIQUE INDEX index_ci_instance_variables_on_key ON ci_instance_variables USING btree (key); @@ -21793,8 +22079,6 @@ CREATE INDEX index_ci_runner_projects_on_runner_id ON ci_runner_projects USING b CREATE INDEX index_ci_runners_on_contacted_at ON ci_runners USING btree (contacted_at); -CREATE INDEX index_ci_runners_on_is_shared ON ci_runners USING btree (is_shared); - 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); @@ -21937,6 +22221,8 @@ CREATE INDEX index_csv_issue_imports_on_project_id ON csv_issue_imports USING bt CREATE INDEX index_csv_issue_imports_on_user_id ON csv_issue_imports USING btree (user_id); +CREATE INDEX index_custom_emoji_on_creator_id ON custom_emoji USING btree (creator_id); + CREATE UNIQUE INDEX index_custom_emoji_on_namespace_id_and_name ON custom_emoji USING btree (namespace_id, name); CREATE UNIQUE INDEX index_daily_build_group_report_results_unique_columns ON ci_daily_build_group_report_results USING btree (project_id, ref_path, date, group_name); @@ -21995,6 +22281,8 @@ 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_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); @@ -22049,6 +22337,8 @@ CREATE UNIQUE INDEX index_design_user_mentions_on_note_id ON design_user_mention CREATE UNIQUE INDEX index_diff_note_positions_on_note_id_and_diff_type ON diff_note_positions USING btree (note_id, diff_type); +CREATE UNIQUE INDEX index_dora_daily_metrics_on_environment_id_and_date ON dora_daily_metrics USING btree (environment_id, date); + CREATE INDEX index_draft_notes_on_author_id ON draft_notes USING btree (author_id); CREATE INDEX index_draft_notes_on_discussion_id ON draft_notes USING btree (discussion_id); @@ -22079,12 +22369,18 @@ 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 INDEX index_epic_issues_on_epic_id ON epic_issues USING btree (epic_id); +CREATE INDEX index_epic_issues_on_epic_id_and_issue_id ON epic_issues USING btree (epic_id, issue_id); + CREATE UNIQUE INDEX index_epic_issues_on_issue_id ON epic_issues USING btree (issue_id); CREATE INDEX index_epic_metrics ON epic_metrics USING btree (epic_id); @@ -22347,12 +22643,12 @@ 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_inc_mgmnt_oncall_participants_on_oncall_rotation_id ON incident_management_oncall_participants USING btree (oncall_rotation_id); - 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); +CREATE INDEX index_inc_mgmnt_oncall_pcpnt_on_oncall_rotation_id_is_removed ON incident_management_oncall_participants USING btree (oncall_rotation_id, is_removed); + CREATE UNIQUE INDEX index_inc_mgmnt_oncall_rotations_on_oncall_schedule_id_and_id ON incident_management_oncall_rotations USING btree (oncall_schedule_id, id); CREATE UNIQUE INDEX index_inc_mgmnt_oncall_rotations_on_oncall_schedule_id_and_name ON incident_management_oncall_rotations USING btree (oncall_schedule_id, name); @@ -22385,7 +22681,7 @@ CREATE UNIQUE INDEX index_issuable_slas_on_issue_id ON issuable_slas USING btree CREATE INDEX index_issue_assignees_on_user_id ON issue_assignees USING btree (user_id); -CREATE UNIQUE INDEX index_issue_email_participants_on_issue_id_and_email ON issue_email_participants USING btree (issue_id, email); +CREATE UNIQUE INDEX index_issue_email_participants_on_issue_id_and_lower_email ON issue_email_participants USING btree (issue_id, lower(email)); CREATE INDEX index_issue_links_on_source_id ON issue_links USING btree (source_id); @@ -22441,6 +22737,8 @@ CREATE INDEX index_issues_on_updated_at ON issues USING btree (updated_at); CREATE INDEX index_issues_on_updated_by_id ON issues USING btree (updated_by_id) WHERE (updated_by_id IS NOT NULL); +CREATE INDEX index_iterations_cadences_on_group_id ON iterations_cadences USING btree (group_id); + CREATE UNIQUE INDEX index_jira_connect_installations_on_client_key ON jira_connect_installations USING btree (client_key); CREATE INDEX index_jira_connect_subscriptions_on_namespace_id ON jira_connect_subscriptions USING btree (namespace_id); @@ -22775,6 +23073,8 @@ 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_pages_metadata_not_migrated ON project_pages_metadata USING btree (project_id) WHERE ((deployed = true) AND (pages_deployment_id IS NULL)); + 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)); @@ -23429,7 +23729,9 @@ 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_sprints_iterations_cadence_id ON sprints USING btree (iterations_cadence_id); CREATE INDEX index_sprints_on_description_trigram ON sprints USING gin (description gin_trgm_ops); @@ -23703,6 +24005,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); @@ -23823,6 +24127,8 @@ CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree CREATE INDEX tmp_idx_deduplicate_vulnerability_occurrences ON vulnerability_occurrences USING btree (project_id, report_type, location_fingerprint, primary_identifier_id, id); +CREATE INDEX tmp_idx_on_namespaces_delayed_project_removal ON namespaces USING btree (id) WHERE (delayed_project_removal = true); + CREATE INDEX tmp_index_on_security_findings_scan_id ON security_findings USING btree (scan_id) WHERE (uuid IS NULL); CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2); @@ -24107,6 +24413,8 @@ 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_b99eb6998c AFTER INSERT OR DELETE OR UPDATE ON web_hook_logs FOR EACH ROW EXECUTE PROCEDURE table_sync_function_29bc99d6db(); + CREATE TRIGGER table_sync_trigger_ee39a25f9d AFTER INSERT OR DELETE OR UPDATE ON audit_events FOR EACH ROW EXECUTE PROCEDURE table_sync_function_2be879775d(); 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 PROCEDURE set_has_external_issue_tracker(); @@ -24268,6 +24576,9 @@ ALTER TABLE ONLY namespaces ALTER TABLE ONLY epics ADD CONSTRAINT fk_3654b61b03 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY sprints + ADD CONSTRAINT fk_365d1db505 FOREIGN KEY (iterations_cadence_id) REFERENCES iterations_cadences(id) ON DELETE CASCADE; + ALTER TABLE ONLY push_event_payloads ADD CONSTRAINT fk_36c74129da FOREIGN KEY (event_id) REFERENCES events(id) ON DELETE CASCADE; @@ -24316,6 +24627,9 @@ ALTER TABLE ONLY path_locks ALTER TABLE ONLY clusters_applications_prometheus ADD CONSTRAINT fk_557e773639 FOREIGN KEY (cluster_id) REFERENCES clusters(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; @@ -24412,9 +24726,6 @@ ALTER TABLE ONLY vulnerabilities ALTER TABLE ONLY labels ADD CONSTRAINT fk_7de4989a69 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY backup_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; @@ -24487,6 +24798,9 @@ ALTER TABLE ONLY milestones ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_959d40ad0a FOREIGN KEY (confirmed_by_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY boards_epic_list_user_preferences + ADD CONSTRAINT fk_95eac55851 FOREIGN KEY (epic_list_id) REFERENCES boards_epic_lists(id) ON DELETE CASCADE; + ALTER TABLE ONLY application_settings ADD CONSTRAINT fk_964370041d FOREIGN KEY (usage_stats_set_by_user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -24640,6 +24954,12 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY issue_links ADD CONSTRAINT fk_c900194ff2 FOREIGN KEY (source_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY external_approval_rules_protected_branches + ADD CONSTRAINT fk_c9a037a926 FOREIGN KEY (external_approval_rule_id) REFERENCES external_approval_rules(id) ON DELETE CASCADE; + +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 experiment_subjects ADD CONSTRAINT fk_ccc28f8ceb FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24649,6 +24969,9 @@ ALTER TABLE ONLY todos 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; +ALTER TABLE ONLY custom_emoji + ADD CONSTRAINT fk_custom_emoji_creator_id FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY bulk_import_entities ADD CONSTRAINT fk_d06d023c30 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24784,6 +25107,9 @@ ALTER TABLE ONLY design_management_designs_versions ALTER TABLE ONLY analytics_devops_adoption_segments ADD CONSTRAINT fk_f5aa768998 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_list_user_preferences + ADD CONSTRAINT fk_f5f2fe5c1f FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY cluster_agents ADD CONSTRAINT fk_f7d43dee13 FOREIGN KEY (created_by_user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -25012,6 +25338,9 @@ ALTER TABLE ONLY boards_epic_board_positions ALTER TABLE ONLY geo_repository_created_events ADD CONSTRAINT fk_rails_1f49e46a61 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY dora_daily_metrics + ADD CONSTRAINT fk_rails_1fd07aff6f FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE; + ALTER TABLE ONLY boards_epic_lists ADD CONSTRAINT fk_rails_1fe6b54909 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; @@ -25222,6 +25551,9 @@ ALTER TABLE ONLY ci_resources ALTER TABLE ONLY clusters_applications_fluentd ADD CONSTRAINT fk_rails_4319b1dcd2 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; +ALTER TABLE ONLY batched_background_migration_jobs + ADD CONSTRAINT fk_rails_432153b86d FOREIGN KEY (batched_background_migration_id) REFERENCES batched_background_migrations(id) ON DELETE CASCADE; + ALTER TABLE ONLY operations_strategies_user_lists ADD CONSTRAINT fk_rails_43241e8d29 FOREIGN KEY (strategy_id) REFERENCES operations_strategies(id) ON DELETE CASCADE; @@ -25327,9 +25659,6 @@ ALTER TABLE ONLY geo_node_namespace_links ALTER TABLE ONLY clusters_applications_knative ADD CONSTRAINT fk_rails_54fc91e0a0 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; @@ -25927,9 +26256,6 @@ ALTER TABLE ONLY serverless_domain_cluster ALTER TABLE ONLY labels ADD CONSTRAINT fk_rails_c1ac5161d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; -ALTER TABLE ONLY backup_labels - ADD CONSTRAINT fk_rails_c1ac5161d8 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; - ALTER TABLE ONLY project_feature_usages ADD CONSTRAINT fk_rails_c22a50024b FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -26143,6 +26469,9 @@ ALTER TABLE ONLY alert_management_alert_user_mentions ALTER TABLE ONLY snippet_statistics ADD CONSTRAINT fk_rails_ebc283ccf1 FOREIGN KEY (snippet_id) REFERENCES snippets(id) ON DELETE CASCADE; +ALTER TABLE ONLY iterations_cadences + ADD CONSTRAINT fk_rails_ece400c55a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_profiles ADD CONSTRAINT fk_rails_ed1e66fbbf FOREIGN KEY (dast_site_profile_id) REFERENCES dast_site_profiles(id) ON DELETE CASCADE; @@ -26248,6 +26577,9 @@ ALTER TABLE ONLY ci_job_variables ALTER TABLE ONLY packages_nuget_metadata ADD CONSTRAINT fk_rails_fc0c19f5b4 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY external_approval_rules + ADD CONSTRAINT fk_rails_fd4f9ac573 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY experiment_users ADD CONSTRAINT fk_rails_fd805f771a FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; |