diff options
Diffstat (limited to 'db/structure.sql')
-rw-r--r-- | db/structure.sql | 474 |
1 files changed, 440 insertions, 34 deletions
diff --git a/db/structure.sql b/db/structure.sql index 9bf6799dc85..de4218ed405 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -10,51 +10,62 @@ CREATE EXTENSION IF NOT EXISTS btree_gist; CREATE EXTENSION IF NOT EXISTS pg_trgm; +CREATE FUNCTION set_has_external_wiki() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN +UPDATE projects SET has_external_wiki = COALESCE(NEW.active, FALSE) +WHERE projects.id = COALESCE(NEW.project_id, OLD.project_id); +RETURN NULL; + +END +$$; + CREATE FUNCTION table_sync_function_2be879775d() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN IF (TG_OP = 'DELETE') THEN - DELETE FROM audit_events_part_5fc467ac26 where id = OLD.id; + DELETE FROM audit_events_archived where id = OLD.id; ELSIF (TG_OP = 'UPDATE') THEN - UPDATE audit_events_part_5fc467ac26 + UPDATE audit_events_archived SET author_id = NEW.author_id, entity_id = NEW.entity_id, entity_type = NEW.entity_type, details = NEW.details, + created_at = NEW.created_at, ip_address = NEW.ip_address, author_name = NEW.author_name, entity_path = NEW.entity_path, target_details = NEW.target_details, target_type = NEW.target_type, - target_id = NEW.target_id, - created_at = NEW.created_at - WHERE audit_events_part_5fc467ac26.id = NEW.id; + target_id = NEW.target_id + WHERE audit_events_archived.id = NEW.id; ELSIF (TG_OP = 'INSERT') THEN - INSERT INTO audit_events_part_5fc467ac26 (id, + INSERT INTO audit_events_archived (id, author_id, entity_id, entity_type, details, + created_at, ip_address, author_name, entity_path, target_details, target_type, - target_id, - created_at) + target_id) VALUES (NEW.id, NEW.author_id, NEW.entity_id, NEW.entity_type, NEW.details, + NEW.created_at, NEW.ip_address, NEW.author_name, NEW.entity_path, NEW.target_details, NEW.target_type, - NEW.target_id, - NEW.created_at); + NEW.target_id); END IF; RETURN NULL; @@ -63,7 +74,7 @@ $$; COMMENT ON FUNCTION table_sync_function_2be879775d() IS 'Partitioning migration: table sync for audit_events table'; -CREATE TABLE audit_events_part_5fc467ac26 ( +CREATE TABLE audit_events ( id bigint NOT NULL, author_id integer NOT NULL, entity_id integer NOT NULL, @@ -9003,7 +9014,8 @@ CREATE TABLE analytics_devops_adoption_snapshots ( runner_configured boolean NOT NULL, pipeline_succeeded boolean NOT NULL, deploy_succeeded boolean NOT NULL, - security_scan_succeeded boolean NOT NULL + security_scan_succeeded boolean NOT NULL, + end_time timestamp with time zone NOT NULL ); CREATE SEQUENCE analytics_devops_adoption_snapshots_id_seq @@ -9328,7 +9340,7 @@ CREATE TABLE application_settings ( spam_check_endpoint_enabled boolean DEFAULT false NOT NULL, elasticsearch_pause_indexing boolean DEFAULT false NOT NULL, repository_storages_weighted jsonb DEFAULT '{}'::jsonb NOT NULL, - max_import_size integer DEFAULT 50 NOT NULL, + max_import_size integer DEFAULT 0 NOT NULL, enforce_pat_expiration boolean DEFAULT true NOT NULL, compliance_frameworks smallint[] DEFAULT '{}'::smallint[] NOT NULL, notify_on_unknown_sign_in boolean DEFAULT true NOT NULL, @@ -9375,12 +9387,17 @@ CREATE TABLE application_settings ( cloud_license_enabled boolean DEFAULT false NOT NULL, disable_feed_token boolean DEFAULT false NOT NULL, personal_access_token_prefix text, + rate_limiting_response_text text, + invisible_captcha_enabled boolean DEFAULT false NOT NULL, + container_registry_cleanup_tags_service_max_list_size integer DEFAULT 200 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_registry_exp_policies_worker_capacity_positive CHECK ((container_registry_expiration_policies_worker_capacity >= 0)), CONSTRAINT check_17d9558205 CHECK ((char_length((kroki_url)::text) <= 1024)), CONSTRAINT check_2dba05b802 CHECK ((char_length(gitpod_url) <= 255)), CONSTRAINT check_51700b31b5 CHECK ((char_length(default_branch_name) <= 255)), CONSTRAINT check_57123c9593 CHECK ((char_length(help_page_documentation_base_url) <= 255)), CONSTRAINT check_718b4458ae CHECK ((char_length(personal_access_token_prefix) <= 20)), + CONSTRAINT check_7227fad848 CHECK ((char_length(rate_limiting_response_text) <= 255)), CONSTRAINT check_85a39b68ff CHECK ((char_length(encrypted_ci_jwt_signing_key_iv) <= 255)), CONSTRAINT check_9a719834eb CHECK ((char_length(secret_detection_token_revocation_url) <= 255)), CONSTRAINT check_9c6c447a13 CHECK ((char_length(maintenance_mode_message) <= 255)), @@ -9623,7 +9640,7 @@ CREATE SEQUENCE atlassian_identities_user_id_seq ALTER SEQUENCE atlassian_identities_user_id_seq OWNED BY atlassian_identities.user_id; -CREATE TABLE audit_events ( +CREATE TABLE audit_events_archived ( id integer NOT NULL, author_id integer NOT NULL, entity_id integer NOT NULL, @@ -9909,6 +9926,26 @@ CREATE SEQUENCE boards_epic_boards_id_seq ALTER SEQUENCE boards_epic_boards_id_seq OWNED BY boards_epic_boards.id; +CREATE TABLE boards_epic_lists ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + epic_board_id bigint NOT NULL, + label_id bigint, + "position" integer, + list_type smallint DEFAULT 1 NOT NULL, + CONSTRAINT boards_epic_lists_position_constraint CHECK (((list_type <> 1) OR (("position" IS NOT NULL) AND ("position" >= 0)))) +); + +CREATE SEQUENCE boards_epic_lists_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE boards_epic_lists_id_seq OWNED BY boards_epic_lists.id; + CREATE TABLE boards_epic_user_preferences ( id bigint NOT NULL, board_id bigint NOT NULL, @@ -11105,7 +11142,7 @@ CREATE TABLE clusters ( management_project_id integer, cleanup_status smallint DEFAULT 1 NOT NULL, cleanup_status_reason text, - helm_major_version integer DEFAULT 2 NOT NULL + helm_major_version integer DEFAULT 3 NOT NULL ); CREATE TABLE clusters_applications_cert_managers ( @@ -11395,7 +11432,6 @@ ALTER SEQUENCE commit_user_mentions_id_seq OWNED BY commit_user_mentions.id; CREATE TABLE compliance_management_frameworks ( id bigint NOT NULL, - group_id bigint, name text NOT NULL, description text NOT NULL, color text NOT NULL, @@ -11925,6 +11961,32 @@ CREATE SEQUENCE draft_notes_id_seq ALTER SEQUENCE draft_notes_id_seq OWNED BY draft_notes.id; +CREATE TABLE elastic_reindexing_subtasks ( + id bigint NOT NULL, + elastic_reindexing_task_id bigint NOT NULL, + alias_name text NOT NULL, + index_name_from text NOT NULL, + index_name_to text NOT NULL, + elastic_task text NOT NULL, + documents_count_target integer, + documents_count integer, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + CONSTRAINT check_4910adc798 CHECK ((char_length(elastic_task) <= 255)), + CONSTRAINT check_88f56216a4 CHECK ((char_length(alias_name) <= 255)), + CONSTRAINT check_a1fbd9faa9 CHECK ((char_length(index_name_from) <= 255)), + CONSTRAINT check_f456494bd8 CHECK ((char_length(index_name_to) <= 255)) +); + +CREATE SEQUENCE elastic_reindexing_subtasks_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE elastic_reindexing_subtasks_id_seq OWNED BY elastic_reindexing_subtasks.id; + CREATE TABLE elastic_reindexing_tasks ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -12929,6 +12991,13 @@ CREATE SEQUENCE group_import_states_group_id_seq ALTER SEQUENCE group_import_states_group_id_seq OWNED BY group_import_states.group_id; +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 +); + CREATE TABLE group_wiki_repositories ( shard_id bigint NOT NULL, group_id bigint NOT NULL, @@ -13077,6 +13146,23 @@ CREATE SEQUENCE incident_management_oncall_schedules_id_seq ALTER SEQUENCE incident_management_oncall_schedules_id_seq OWNED BY incident_management_oncall_schedules.id; +CREATE TABLE incident_management_oncall_shifts ( + id bigint NOT NULL, + rotation_id bigint NOT NULL, + participant_id bigint NOT NULL, + starts_at timestamp with time zone NOT NULL, + ends_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE incident_management_oncall_shifts_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE incident_management_oncall_shifts_id_seq OWNED BY incident_management_oncall_shifts.id; + CREATE TABLE index_statuses ( id integer NOT NULL, project_id integer NOT NULL, @@ -13972,7 +14058,7 @@ CREATE TABLE merge_requests ( merge_jid character varying, discussion_locked boolean, latest_merge_request_diff_id integer, - allow_maintainer_to_push boolean, + allow_maintainer_to_push boolean DEFAULT true, state_id smallint DEFAULT 1 NOT NULL, rebase_jid character varying, squash_commit_sha bytea, @@ -14127,6 +14213,13 @@ CREATE SEQUENCE namespace_onboarding_actions_id_seq ALTER SEQUENCE namespace_onboarding_actions_id_seq OWNED BY namespace_onboarding_actions.id; +CREATE TABLE namespace_package_settings ( + namespace_id bigint NOT NULL, + maven_duplicates_allowed boolean DEFAULT true NOT NULL, + maven_duplicate_exception_regex text DEFAULT ''::text NOT NULL, + CONSTRAINT check_d63274b2b6 CHECK ((char_length(maven_duplicate_exception_regex) <= 255)) +); + CREATE TABLE namespace_root_storage_statistics ( namespace_id integer NOT NULL, updated_at timestamp with time zone NOT NULL, @@ -14336,7 +14429,11 @@ CREATE TABLE oauth_access_grants ( redirect_uri text NOT NULL, created_at timestamp without time zone NOT NULL, revoked_at timestamp without time zone, - scopes character varying + scopes character varying, + code_challenge text, + code_challenge_method text, + CONSTRAINT oauth_access_grants_code_challenge CHECK ((char_length(code_challenge) <= 128)), + CONSTRAINT oauth_access_grants_code_challenge_method CHECK ((char_length(code_challenge_method) <= 5)) ); CREATE SEQUENCE oauth_access_grants_id_seq @@ -14408,6 +14505,36 @@ CREATE SEQUENCE oauth_openid_requests_id_seq ALTER SEQUENCE oauth_openid_requests_id_seq OWNED BY oauth_openid_requests.id; +CREATE TABLE onboarding_progresses ( + id bigint NOT NULL, + namespace_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + git_pull_at timestamp with time zone, + git_write_at timestamp with time zone, + merge_request_created_at timestamp with time zone, + pipeline_created_at timestamp with time zone, + user_added_at timestamp with time zone, + trial_started_at timestamp with time zone, + subscription_created_at timestamp with time zone, + required_mr_approvals_enabled_at timestamp with time zone, + code_owners_enabled_at timestamp with time zone, + scoped_label_created_at timestamp with time zone, + 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 +); + +CREATE SEQUENCE onboarding_progresses_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE onboarding_progresses_id_seq OWNED BY onboarding_progresses.id; + CREATE TABLE open_project_tracker_data ( id bigint NOT NULL, service_id integer NOT NULL, @@ -14585,7 +14712,8 @@ ALTER SEQUENCE packages_build_infos_id_seq OWNED BY packages_build_infos.id; CREATE TABLE packages_composer_metadata ( package_id bigint NOT NULL, target_sha bytea NOT NULL, - composer_json jsonb DEFAULT '{}'::jsonb NOT NULL + composer_json jsonb DEFAULT '{}'::jsonb NOT NULL, + version_cache_sha bytea ); CREATE TABLE packages_conan_file_metadata ( @@ -14626,6 +14754,136 @@ CREATE SEQUENCE packages_conan_metadata_id_seq ALTER SEQUENCE packages_conan_metadata_id_seq OWNED BY packages_conan_metadata.id; +CREATE TABLE packages_debian_file_metadata ( + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + package_file_id bigint NOT NULL, + file_type smallint NOT NULL, + component text, + architecture text, + fields jsonb, + CONSTRAINT check_2ebedda4b6 CHECK ((char_length(component) <= 255)), + CONSTRAINT check_e6e1fffcca CHECK ((char_length(architecture) <= 255)) +); + +CREATE TABLE packages_debian_group_architectures ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + distribution_id bigint NOT NULL, + name text NOT NULL, + CONSTRAINT check_ddb220164a CHECK ((char_length(name) <= 255)) +); + +CREATE SEQUENCE packages_debian_group_architectures_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_debian_group_architectures_id_seq OWNED BY packages_debian_group_architectures.id; + +CREATE TABLE packages_debian_group_distributions ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + group_id bigint NOT NULL, + creator_id bigint, + valid_time_duration_seconds integer, + file_store smallint DEFAULT 1 NOT NULL, + automatic boolean DEFAULT true NOT NULL, + automatic_upgrades boolean DEFAULT false NOT NULL, + codename text NOT NULL, + suite text, + origin text, + label text, + version text, + description text, + encrypted_signing_keys text, + encrypted_signing_keys_iv text, + file text, + file_signature text, + CONSTRAINT check_310ac457b8 CHECK ((char_length(description) <= 255)), + CONSTRAINT check_3d6f87fc31 CHECK ((char_length(file_signature) <= 4096)), + CONSTRAINT check_3fdadf4a0c CHECK ((char_length(version) <= 255)), + CONSTRAINT check_590e18405a CHECK ((char_length(codename) <= 255)), + CONSTRAINT check_9b90bc0f07 CHECK ((char_length(encrypted_signing_keys_iv) <= 255)), + CONSTRAINT check_b057cd840a CHECK ((char_length(origin) <= 255)), + CONSTRAINT check_b811ec1218 CHECK ((char_length(encrypted_signing_keys) <= 2048)), + CONSTRAINT check_be5ed8d307 CHECK ((char_length(file) <= 255)), + CONSTRAINT check_d3244bfc0b CHECK ((char_length(label) <= 255)), + CONSTRAINT check_e7c928a24b CHECK ((char_length(suite) <= 255)) +); + +CREATE SEQUENCE packages_debian_group_distributions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_debian_group_distributions_id_seq OWNED BY packages_debian_group_distributions.id; + +CREATE TABLE packages_debian_project_architectures ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + distribution_id bigint NOT NULL, + name text NOT NULL, + CONSTRAINT check_9c2e1c99d8 CHECK ((char_length(name) <= 255)) +); + +CREATE SEQUENCE packages_debian_project_architectures_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_debian_project_architectures_id_seq OWNED BY packages_debian_project_architectures.id; + +CREATE TABLE packages_debian_project_distributions ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id bigint NOT NULL, + creator_id bigint, + valid_time_duration_seconds integer, + file_store smallint DEFAULT 1 NOT NULL, + automatic boolean DEFAULT true NOT NULL, + automatic_upgrades boolean DEFAULT false NOT NULL, + codename text NOT NULL, + suite text, + origin text, + label text, + version text, + description text, + encrypted_signing_keys text, + encrypted_signing_keys_iv text, + file text, + file_signature text, + CONSTRAINT check_6177ccd4a6 CHECK ((char_length(origin) <= 255)), + CONSTRAINT check_6f6b55a4c4 CHECK ((char_length(label) <= 255)), + CONSTRAINT check_834dabadb6 CHECK ((char_length(codename) <= 255)), + CONSTRAINT check_96965792c2 CHECK ((char_length(version) <= 255)), + CONSTRAINT check_a56ae58a17 CHECK ((char_length(suite) <= 255)), + CONSTRAINT check_a5a2ac6af2 CHECK ((char_length(file_signature) <= 4096)), + CONSTRAINT check_b93154339f CHECK ((char_length(description) <= 255)), + CONSTRAINT check_c25603a25b CHECK ((char_length(encrypted_signing_keys) <= 2048)), + CONSTRAINT check_cb4ac9599e CHECK ((char_length(file) <= 255)), + CONSTRAINT check_d488f8cce3 CHECK ((char_length(encrypted_signing_keys_iv) <= 255)) +); + +CREATE SEQUENCE packages_debian_project_distributions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_debian_project_distributions_id_seq OWNED BY packages_debian_project_distributions.id; + CREATE TABLE packages_dependencies ( id bigint NOT NULL, name character varying(255) NOT NULL, @@ -15313,7 +15571,9 @@ CREATE TABLE project_ci_cd_settings ( default_git_depth integer, forward_deployment_enabled boolean, merge_trains_enabled boolean DEFAULT false, - auto_rollback_enabled boolean DEFAULT false NOT NULL + auto_rollback_enabled boolean DEFAULT false NOT NULL, + keep_latest_artifact boolean DEFAULT true NOT NULL, + restrict_user_defined_variables boolean DEFAULT false NOT NULL ); CREATE SEQUENCE project_ci_cd_settings_id_seq @@ -17584,7 +17844,8 @@ CREATE TABLE vulnerability_feedback ( comment_author_id integer, comment text, comment_timestamp timestamp with time zone, - finding_uuid uuid + finding_uuid uuid, + dismissal_reason smallint ); CREATE SEQUENCE vulnerability_feedback_id_seq @@ -18131,6 +18392,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_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); ALTER TABLE ONLY broadcast_messages ALTER COLUMN id SET DEFAULT nextval('broadcast_messages_id_seq'::regclass); @@ -18315,6 +18578,8 @@ ALTER TABLE ONLY diff_note_positions ALTER COLUMN id SET DEFAULT nextval('diff_n 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); + ALTER TABLE ONLY elastic_reindexing_tasks ALTER COLUMN id SET DEFAULT nextval('elastic_reindexing_tasks_id_seq'::regclass); ALTER TABLE ONLY emails ALTER COLUMN id SET DEFAULT nextval('emails_id_seq'::regclass); @@ -18423,6 +18688,8 @@ ALTER TABLE ONLY incident_management_oncall_rotations ALTER COLUMN id SET DEFAUL ALTER TABLE ONLY incident_management_oncall_schedules ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_schedules_id_seq'::regclass); +ALTER TABLE ONLY incident_management_oncall_shifts ALTER COLUMN id SET DEFAULT nextval('incident_management_oncall_shifts_id_seq'::regclass); + ALTER TABLE ONLY index_statuses ALTER COLUMN id SET DEFAULT nextval('index_statuses_id_seq'::regclass); ALTER TABLE ONLY insights ALTER COLUMN id SET DEFAULT nextval('insights_id_seq'::regclass); @@ -18531,6 +18798,8 @@ ALTER TABLE ONLY oauth_applications ALTER COLUMN id SET DEFAULT nextval('oauth_a ALTER TABLE ONLY oauth_openid_requests ALTER COLUMN id SET DEFAULT nextval('oauth_openid_requests_id_seq'::regclass); +ALTER TABLE ONLY onboarding_progresses ALTER COLUMN id SET DEFAULT nextval('onboarding_progresses_id_seq'::regclass); + ALTER TABLE ONLY open_project_tracker_data ALTER COLUMN id SET DEFAULT nextval('open_project_tracker_data_id_seq'::regclass); ALTER TABLE ONLY operations_feature_flag_scopes ALTER COLUMN id SET DEFAULT nextval('operations_feature_flag_scopes_id_seq'::regclass); @@ -18555,6 +18824,14 @@ ALTER TABLE ONLY packages_conan_file_metadata ALTER COLUMN id SET DEFAULT nextva ALTER TABLE ONLY packages_conan_metadata ALTER COLUMN id SET DEFAULT nextval('packages_conan_metadata_id_seq'::regclass); +ALTER TABLE ONLY packages_debian_group_architectures ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_architectures_id_seq'::regclass); + +ALTER TABLE ONLY packages_debian_group_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_group_distributions_id_seq'::regclass); + +ALTER TABLE ONLY packages_debian_project_architectures ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_architectures_id_seq'::regclass); + +ALTER TABLE ONLY packages_debian_project_distributions ALTER COLUMN id SET DEFAULT nextval('packages_debian_project_distributions_id_seq'::regclass); + ALTER TABLE ONLY packages_dependencies ALTER COLUMN id SET DEFAULT nextval('packages_dependencies_id_seq'::regclass); ALTER TABLE ONLY packages_dependency_links ALTER COLUMN id SET DEFAULT nextval('packages_dependency_links_id_seq'::regclass); @@ -19126,11 +19403,11 @@ ALTER TABLE ONLY ar_internal_metadata ALTER TABLE ONLY atlassian_identities ADD CONSTRAINT atlassian_identities_pkey PRIMARY KEY (user_id); -ALTER TABLE ONLY audit_events_part_5fc467ac26 - ADD CONSTRAINT audit_events_part_5fc467ac26_pkey PRIMARY KEY (id, created_at); +ALTER TABLE ONLY audit_events_archived + ADD CONSTRAINT audit_events_archived_pkey PRIMARY KEY (id); ALTER TABLE ONLY audit_events - ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id); + ADD CONSTRAINT audit_events_pkey PRIMARY KEY (id, created_at); ALTER TABLE ONLY authentication_events ADD CONSTRAINT authentication_events_pkey PRIMARY KEY (id); @@ -19174,6 +19451,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_lists + ADD CONSTRAINT boards_epic_lists_pkey PRIMARY KEY (id); + ALTER TABLE ONLY boards_epic_user_preferences ADD CONSTRAINT boards_epic_user_preferences_pkey PRIMARY KEY (id); @@ -19471,6 +19751,9 @@ ALTER TABLE ONLY diff_note_positions ALTER TABLE ONLY draft_notes ADD CONSTRAINT draft_notes_pkey PRIMARY KEY (id); +ALTER TABLE ONLY elastic_reindexing_subtasks + ADD CONSTRAINT elastic_reindexing_subtasks_pkey PRIMARY KEY (id); + ALTER TABLE ONLY elastic_reindexing_tasks ADD CONSTRAINT elastic_reindexing_tasks_pkey PRIMARY KEY (id); @@ -19621,6 +19904,9 @@ ALTER TABLE ONLY group_group_links ALTER TABLE ONLY group_import_states ADD CONSTRAINT group_import_states_pkey PRIMARY KEY (group_id); +ALTER TABLE ONLY group_merge_request_approval_settings + ADD CONSTRAINT group_merge_request_approval_settings_pkey PRIMARY KEY (group_id); + ALTER TABLE ONLY group_wiki_repositories ADD CONSTRAINT group_wiki_repositories_pkey PRIMARY KEY (group_id); @@ -19636,6 +19922,9 @@ ALTER TABLE ONLY import_export_uploads ALTER TABLE ONLY import_failures ADD CONSTRAINT import_failures_pkey PRIMARY KEY (id); +ALTER TABLE ONLY incident_management_oncall_shifts + ADD CONSTRAINT inc_mgmnt_no_overlapping_oncall_shifts EXCLUDE USING gist (rotation_id WITH =, tstzrange(starts_at, ends_at, '[)'::text) WITH &&); + ALTER TABLE ONLY incident_management_oncall_participants ADD CONSTRAINT incident_management_oncall_participants_pkey PRIMARY KEY (id); @@ -19645,6 +19934,9 @@ ALTER TABLE ONLY incident_management_oncall_rotations ALTER TABLE ONLY incident_management_oncall_schedules ADD CONSTRAINT incident_management_oncall_schedules_pkey PRIMARY KEY (id); +ALTER TABLE ONLY incident_management_oncall_shifts + ADD CONSTRAINT incident_management_oncall_shifts_pkey PRIMARY KEY (id); + ALTER TABLE ONLY index_statuses ADD CONSTRAINT index_statuses_pkey PRIMARY KEY (id); @@ -19813,6 +20105,9 @@ ALTER TABLE ONLY namespace_limits ALTER TABLE ONLY namespace_onboarding_actions ADD CONSTRAINT namespace_onboarding_actions_pkey PRIMARY KEY (id); +ALTER TABLE ONLY namespace_package_settings + ADD CONSTRAINT namespace_package_settings_pkey PRIMARY KEY (namespace_id); + ALTER TABLE ONLY namespace_root_storage_statistics ADD CONSTRAINT namespace_root_storage_statistics_pkey PRIMARY KEY (namespace_id); @@ -19846,6 +20141,9 @@ ALTER TABLE ONLY oauth_applications ALTER TABLE ONLY oauth_openid_requests ADD CONSTRAINT oauth_openid_requests_pkey PRIMARY KEY (id); +ALTER TABLE ONLY onboarding_progresses + ADD CONSTRAINT onboarding_progresses_pkey PRIMARY KEY (id); + ALTER TABLE ONLY open_project_tracker_data ADD CONSTRAINT open_project_tracker_data_pkey PRIMARY KEY (id); @@ -19885,6 +20183,21 @@ ALTER TABLE ONLY packages_conan_file_metadata ALTER TABLE ONLY packages_conan_metadata ADD CONSTRAINT packages_conan_metadata_pkey PRIMARY KEY (id); +ALTER TABLE ONLY packages_debian_file_metadata + ADD CONSTRAINT packages_debian_file_metadata_pkey PRIMARY KEY (package_file_id); + +ALTER TABLE ONLY packages_debian_group_architectures + ADD CONSTRAINT packages_debian_group_architectures_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_debian_group_distributions + ADD CONSTRAINT packages_debian_group_distributions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_debian_project_architectures + ADD CONSTRAINT packages_debian_project_architectures_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY packages_debian_project_distributions + ADD CONSTRAINT packages_debian_project_distributions_pkey PRIMARY KEY (id); + ALTER TABLE ONLY packages_dependencies ADD CONSTRAINT packages_dependencies_pkey PRIMARY KEY (id); @@ -20497,9 +20810,9 @@ CREATE INDEX product_analytics_events_experi_project_id_collector_tstamp_idx ON CREATE INDEX active_billable_users ON users USING btree (id) WHERE (((state)::text = 'active'::text) AND ((user_type IS NULL) OR (user_type = ANY (ARRAY[NULL::integer, 6, 4]))) AND ((user_type IS NULL) OR (user_type <> ALL ('{2,6,1,3,7,8}'::smallint[])))); -CREATE INDEX analytics_index_audit_events_on_created_at_and_author_id ON audit_events USING btree (created_at, author_id); +CREATE INDEX analytics_index_audit_events_on_created_at_and_author_id ON audit_events_archived USING btree (created_at, author_id); -CREATE INDEX analytics_index_audit_events_part_on_created_at_and_author_id ON ONLY audit_events_part_5fc467ac26 USING btree (created_at, author_id); +CREATE INDEX analytics_index_audit_events_part_on_created_at_and_author_id ON ONLY audit_events USING btree (created_at, author_id); CREATE INDEX analytics_index_events_on_created_at_and_author_id ON events USING btree (created_at, author_id); @@ -20541,11 +20854,13 @@ CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_and_note_id_index ON epic_user CREATE UNIQUE INDEX epic_user_mentions_on_epic_id_index ON epic_user_mentions USING btree (epic_id) WHERE (note_id IS NULL); +CREATE INDEX expired_artifacts_temp_index ON ci_job_artifacts USING btree (id, created_at) WHERE ((expire_at IS NULL) AND (created_at < '2020-06-22 00:00:00+00'::timestamp with time zone)); + CREATE INDEX finding_links_on_vulnerability_occurrence_id ON vulnerability_finding_links USING btree (vulnerability_occurrence_id); -CREATE INDEX idx_audit_events_on_entity_id_desc_author_id_created_at ON audit_events USING btree (entity_id, entity_type, id DESC, author_id, created_at); +CREATE INDEX idx_audit_events_on_entity_id_desc_author_id_created_at ON audit_events_archived USING btree (entity_id, entity_type, id DESC, author_id, created_at); -CREATE INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ON ONLY audit_events_part_5fc467ac26 USING btree (entity_id, entity_type, id DESC, author_id, created_at); +CREATE INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ON ONLY audit_events USING btree (entity_id, entity_type, id DESC, author_id, created_at); CREATE INDEX idx_ci_pipelines_artifacts_locked ON ci_pipelines USING btree (ci_ref_id, id) WHERE (locked = 1); @@ -20599,6 +20914,10 @@ CREATE INDEX idx_packages_build_infos_on_package_id ON packages_build_infos USIN CREATE INDEX idx_packages_packages_on_project_id_name_version_package_type ON packages_packages USING btree (project_id, name, version, package_type); +CREATE INDEX idx_pkgs_deb_grp_architectures_on_distribution_id ON packages_debian_group_architectures USING btree (distribution_id); + +CREATE INDEX idx_pkgs_deb_proj_architectures_on_distribution_id ON packages_debian_project_architectures USING btree (distribution_id); + CREATE UNIQUE INDEX idx_pkgs_dep_links_on_pkg_id_dependency_id_dependency_type ON packages_dependency_links USING btree (package_id, dependency_id, dependency_type); CREATE INDEX idx_proj_feat_usg_on_jira_dvcs_cloud_last_sync_at_and_proj_id ON project_feature_usages USING btree (jira_dvcs_cloud_last_sync_at, project_id) WHERE (jira_dvcs_cloud_last_sync_at IS NOT NULL); @@ -20823,8 +21142,16 @@ CREATE UNIQUE INDEX index_boards_epic_board_positions_on_epic_board_id_and_epic_ CREATE INDEX index_boards_epic_board_positions_on_epic_id ON boards_epic_board_positions USING btree (epic_id); +CREATE INDEX index_boards_epic_board_positions_on_scoped_relative_position ON boards_epic_board_positions USING btree (epic_board_id, epic_id, relative_position); + CREATE INDEX index_boards_epic_boards_on_group_id ON boards_epic_boards USING btree (group_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); + +CREATE INDEX index_boards_epic_lists_on_label_id ON boards_epic_lists USING btree (label_id); + CREATE INDEX index_boards_epic_user_preferences_on_board_id ON boards_epic_user_preferences USING btree (board_id); CREATE UNIQUE INDEX index_boards_epic_user_preferences_on_board_user_epic_unique ON boards_epic_user_preferences USING btree (board_id, user_id, epic_id); @@ -20999,7 +21326,7 @@ CREATE INDEX index_ci_pipelines_on_external_pull_request_id ON ci_pipelines USIN CREATE INDEX index_ci_pipelines_on_merge_request_id ON ci_pipelines USING btree (merge_request_id) WHERE (merge_request_id IS NOT NULL); -CREATE INDEX index_ci_pipelines_on_pipeline_schedule_id ON ci_pipelines USING btree (pipeline_schedule_id); +CREATE INDEX index_ci_pipelines_on_pipeline_schedule_id_and_id ON ci_pipelines USING btree (pipeline_schedule_id, id); CREATE INDEX index_ci_pipelines_on_project_id_and_id_desc ON ci_pipelines USING btree (project_id, id DESC); @@ -21295,6 +21622,8 @@ CREATE INDEX index_draft_notes_on_discussion_id ON draft_notes USING btree (disc CREATE INDEX index_draft_notes_on_merge_request_id ON draft_notes USING btree (merge_request_id); +CREATE INDEX index_elastic_reindexing_subtasks_on_elastic_reindexing_task_id ON elastic_reindexing_subtasks USING btree (elastic_reindexing_task_id); + CREATE UNIQUE INDEX index_elastic_reindexing_tasks_on_in_progress ON elastic_reindexing_tasks USING btree (in_progress) WHERE in_progress; CREATE INDEX index_elastic_reindexing_tasks_on_state ON elastic_reindexing_tasks USING btree (state); @@ -21595,6 +21924,10 @@ CREATE UNIQUE INDEX index_inc_mgmnt_oncall_rotations_on_oncall_schedule_id_and_n CREATE INDEX index_incident_management_oncall_schedules_on_project_id ON incident_management_oncall_schedules USING btree (project_id); +CREATE INDEX index_incident_management_oncall_shifts_on_participant_id ON incident_management_oncall_shifts USING btree (participant_id); + +CREATE INDEX index_incident_management_oncall_shifts_on_rotation_id ON incident_management_oncall_shifts USING btree (rotation_id); + CREATE UNIQUE INDEX index_index_statuses_on_project_id ON index_statuses USING btree (project_id); CREATE INDEX index_insights_on_namespace_id ON insights USING btree (namespace_id); @@ -21711,7 +22044,7 @@ CREATE UNIQUE INDEX index_label_priorities_on_project_id_and_label_id ON label_p CREATE UNIQUE INDEX index_labels_on_group_id_and_project_id_and_title ON labels USING btree (group_id, project_id, title); -CREATE INDEX index_labels_on_group_id_and_title_with_null_project_id ON labels USING btree (group_id, title) WHERE (project_id IS NULL); +CREATE UNIQUE INDEX index_labels_on_group_id_and_title_unique ON labels USING btree (group_id, title) WHERE (project_id IS NULL); CREATE INDEX index_labels_on_project_id ON labels USING btree (project_id); @@ -21847,6 +22180,8 @@ CREATE INDEX index_merge_requests_on_target_project_id_and_iid_and_state_id ON m CREATE INDEX index_merge_requests_on_target_project_id_and_iid_jira_title ON merge_requests USING btree (target_project_id, iid) WHERE ((title)::text ~ '[A-Z][A-Z_0-9]+-\d+'::text); +CREATE INDEX index_merge_requests_on_target_project_id_and_squash_commit_sha ON merge_requests USING btree (target_project_id, squash_commit_sha); + CREATE INDEX index_merge_requests_on_target_project_id_and_target_branch ON merge_requests USING btree (target_project_id, target_branch) WHERE ((state_id = 1) AND (merge_when_pipeline_succeeds = true)); CREATE INDEX index_merge_requests_on_target_project_id_iid_jira_description ON merge_requests USING btree (target_project_id, iid) WHERE (description ~ '[A-Z][A-Z_0-9]+-\d+'::text); @@ -22013,6 +22348,8 @@ CREATE UNIQUE INDEX index_on_segment_selections_project_id_segment_id ON analyti CREATE INDEX index_on_segment_selections_segment_id ON analytics_devops_adoption_segment_selections USING btree (segment_id); +CREATE INDEX index_on_snapshots_segment_id_end_time ON analytics_devops_adoption_snapshots USING btree (segment_id, end_time); + CREATE INDEX index_on_snapshots_segment_id_recorded_at ON analytics_devops_adoption_snapshots USING btree (segment_id, recorded_at); CREATE INDEX index_on_users_lower_email ON users USING btree (lower((email)::text)); @@ -22021,6 +22358,8 @@ CREATE INDEX index_on_users_lower_username ON users USING btree (lower((username CREATE INDEX index_on_users_name_lower ON users USING btree (lower((name)::text)); +CREATE UNIQUE INDEX index_onboarding_progresses_on_namespace_id ON onboarding_progresses USING btree (namespace_id); + CREATE INDEX index_open_project_tracker_data_on_service_id ON open_project_tracker_data USING btree (service_id); CREATE INDEX index_operations_feature_flags_issues_on_issue_id ON operations_feature_flags_issues USING btree (issue_id); @@ -22051,6 +22390,14 @@ CREATE UNIQUE INDEX index_packages_conan_file_metadata_on_package_file_id ON pac CREATE UNIQUE INDEX index_packages_conan_metadata_on_package_id_username_channel ON packages_conan_metadata USING btree (package_id, package_username, package_channel); +CREATE INDEX index_packages_debian_group_distributions_on_creator_id ON packages_debian_group_distributions USING btree (creator_id); + +CREATE INDEX index_packages_debian_group_distributions_on_group_id ON packages_debian_group_distributions USING btree (group_id); + +CREATE INDEX index_packages_debian_project_distributions_on_creator_id ON packages_debian_project_distributions USING btree (creator_id); + +CREATE INDEX index_packages_debian_project_distributions_on_project_id ON packages_debian_project_distributions USING btree (project_id); + CREATE UNIQUE INDEX index_packages_dependencies_on_name_and_version_pattern ON packages_dependencies USING btree (name, version_pattern); CREATE INDEX index_packages_dependency_links_on_dependency_id ON packages_dependency_links USING btree (dependency_id); @@ -23001,14 +23348,22 @@ CREATE INDEX temporary_index_vulnerabilities_on_id ON vulnerabilities USING btre CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree (user_id, term_id); -CREATE INDEX tmp_build_stage_position_index ON ci_builds USING btree (stage_id, stage_idx) WHERE (stage_idx IS NOT NULL); - -CREATE INDEX tmp_index_for_email_unconfirmation_migration ON emails USING btree (id) WHERE (confirmed_at IS NOT NULL); - CREATE INDEX tmp_index_oauth_applications_on_id_where_trusted ON oauth_applications USING btree (id) WHERE (trusted = true); CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2); +CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name); + +CREATE UNIQUE INDEX uniq_pkgs_deb_proj_architectures_on_distribution_id_and_name ON packages_debian_project_architectures USING btree (distribution_id, name); + +CREATE UNIQUE INDEX uniq_pkgs_debian_group_distributions_group_id_and_codename ON packages_debian_group_distributions USING btree (group_id, codename); + +CREATE UNIQUE INDEX uniq_pkgs_debian_group_distributions_group_id_and_suite ON packages_debian_group_distributions USING btree (group_id, suite); + +CREATE UNIQUE INDEX uniq_pkgs_debian_project_distributions_project_id_and_codename ON packages_debian_project_distributions USING btree (project_id, codename); + +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_merge_request_metrics_by_merge_request_id ON merge_request_metrics USING btree (merge_request_id); CREATE UNIQUE INDEX vulnerability_feedback_unique_idx ON vulnerability_feedback USING btree (project_id, category, feedback_type, project_fingerprint); @@ -23273,6 +23628,12 @@ ALTER INDEX product_analytics_events_experimental_pkey ATTACH PARTITION gitlab_p 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_wiki_on_delete AFTER DELETE ON services FOR EACH ROW WHEN ((((old.type)::text = 'ExternalWikiService'::text) AND (old.project_id IS NOT NULL))) EXECUTE PROCEDURE set_has_external_wiki(); + +CREATE TRIGGER trigger_has_external_wiki_on_insert AFTER INSERT ON services FOR EACH ROW WHEN (((new.active = true) AND ((new.type)::text = 'ExternalWikiService'::text) AND (new.project_id IS NOT NULL))) EXECUTE PROCEDURE set_has_external_wiki(); + +CREATE TRIGGER trigger_has_external_wiki_on_update AFTER UPDATE ON services FOR EACH ROW WHEN ((((new.type)::text = 'ExternalWikiService'::text) AND (old.active <> new.active) AND (new.project_id IS NOT NULL))) EXECUTE PROCEDURE set_has_external_wiki(); + ALTER TABLE ONLY chat_names ADD CONSTRAINT fk_00797a2bf9 FOREIGN KEY (service_id) REFERENCES services(id) ON DELETE CASCADE; @@ -24011,6 +24372,9 @@ ALTER TABLE ONLY trending_projects ALTER TABLE ONLY project_deploy_tokens ADD CONSTRAINT fk_rails_0aca134388 FOREIGN KEY (deploy_token_id) REFERENCES deploy_tokens(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_debian_group_distributions + ADD CONSTRAINT fk_rails_0adf75c347 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE RESTRICT; + ALTER TABLE ONLY packages_conan_file_metadata ADD CONSTRAINT fk_rails_0afabd9328 FOREIGN KEY (package_file_id) REFERENCES packages_package_files(id) ON DELETE CASCADE; @@ -24032,6 +24396,9 @@ ALTER TABLE ONLY user_synced_attributes_metadata ALTER TABLE ONLY project_authorizations ADD CONSTRAINT fk_rails_0f84bb11f3 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY boards_epic_lists + ADD CONSTRAINT fk_rails_0f9c7f646f FOREIGN KEY (epic_board_id) REFERENCES boards_epic_boards(id) ON DELETE CASCADE; + ALTER TABLE ONLY issue_email_participants ADD CONSTRAINT fk_rails_0fdfd8b811 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -24116,6 +24483,9 @@ ALTER TABLE ONLY incident_management_oncall_schedules ALTER TABLE ONLY vulnerability_user_mentions ADD CONSTRAINT fk_rails_1a41c485cd FOREIGN KEY (vulnerability_id) REFERENCES vulnerabilities(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_debian_file_metadata + ADD CONSTRAINT fk_rails_1ae85be112 FOREIGN KEY (package_file_id) REFERENCES packages_package_files(id) ON DELETE CASCADE; + ALTER TABLE ONLY issuable_slas ADD CONSTRAINT fk_rails_1b8768cd63 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -24137,6 +24507,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 boards_epic_lists + ADD CONSTRAINT fk_rails_1fe6b54909 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; + ALTER TABLE ONLY approval_merge_request_rules_groups ADD CONSTRAINT fk_rails_2020a7124a FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -24206,6 +24579,9 @@ ALTER TABLE ONLY geo_repository_updated_events ALTER TABLE ONLY boards_epic_board_labels ADD CONSTRAINT fk_rails_2bedeb8799 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; +ALTER TABLE ONLY onboarding_progresses + ADD CONSTRAINT fk_rails_2ccfd420cc FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY protected_branch_unprotect_access_levels ADD CONSTRAINT fk_rails_2d2aba21ef FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -24260,6 +24636,9 @@ ALTER TABLE ONLY merge_request_blocks ALTER TABLE ONLY merge_request_reviewers ADD CONSTRAINT fk_rails_3704a66140 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY group_merge_request_approval_settings + ADD CONSTRAINT fk_rails_37b6b4cdba FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY analytics_cycle_analytics_project_stages ADD CONSTRAINT fk_rails_3829e49b66 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -24449,6 +24828,9 @@ ALTER TABLE ONLY issue_user_mentions ALTER TABLE ONLY merge_request_assignees ADD CONSTRAINT fk_rails_579d375628 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_debian_project_architectures + ADD CONSTRAINT fk_rails_5808663adf FOREIGN KEY (distribution_id) REFERENCES packages_debian_project_distributions(id) ON DELETE CASCADE; + ALTER TABLE ONLY clusters_applications_cilium ADD CONSTRAINT fk_rails_59dc12eea6 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; @@ -24785,6 +25167,9 @@ ALTER TABLE ONLY alert_management_alert_assignees ALTER TABLE ONLY scim_identities ADD CONSTRAINT fk_rails_9421a0bffb FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_debian_project_distributions + ADD CONSTRAINT fk_rails_94b95e1f84 FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY packages_pypi_metadata ADD CONSTRAINT fk_rails_9698717cdd FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; @@ -25145,6 +25530,12 @@ ALTER TABLE ONLY user_callouts ALTER TABLE ONLY vulnerability_feedback ADD CONSTRAINT fk_rails_debd54e456 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_debian_project_distributions + ADD CONSTRAINT fk_rails_df44271a30 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE RESTRICT; + +ALTER TABLE ONLY incident_management_oncall_shifts + ADD CONSTRAINT fk_rails_df4feb286a FOREIGN KEY (rotation_id) REFERENCES incident_management_oncall_rotations(id) ON DELETE CASCADE; + ALTER TABLE ONLY analytics_cycle_analytics_group_stages ADD CONSTRAINT fk_rails_dfb37c880d FOREIGN KEY (end_event_label_id) REFERENCES labels(id) ON DELETE CASCADE; @@ -25184,6 +25575,9 @@ ALTER TABLE ONLY merge_request_metrics ALTER TABLE ONLY draft_notes ADD CONSTRAINT fk_rails_e753681674 FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; +ALTER TABLE ONLY namespace_package_settings + ADD CONSTRAINT fk_rails_e773444769 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; + ALTER TABLE ONLY dast_site_tokens ADD CONSTRAINT fk_rails_e84f721a8e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -25214,12 +25608,18 @@ ALTER TABLE ONLY snippet_statistics ALTER TABLE ONLY project_security_settings ADD CONSTRAINT fk_rails_ed4abe1338 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_debian_group_distributions + ADD CONSTRAINT fk_rails_ede0bb937f FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY experiment_subjects ADD CONSTRAINT fk_rails_ede5754774 FOREIGN KEY (experiment_id) REFERENCES experiments(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_daily_build_group_report_results ADD CONSTRAINT fk_rails_ee072d13b3 FOREIGN KEY (last_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; +ALTER TABLE ONLY packages_debian_group_architectures + ADD CONSTRAINT fk_rails_ef667d1b03 FOREIGN KEY (distribution_id) REFERENCES packages_debian_group_distributions(id) ON DELETE CASCADE; + ALTER TABLE ONLY label_priorities ADD CONSTRAINT fk_rails_ef916d14fa FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -25241,6 +25641,9 @@ ALTER TABLE ONLY requirements ALTER TABLE ONLY snippet_repositories ADD CONSTRAINT fk_rails_f21f899728 FOREIGN KEY (shard_id) REFERENCES shards(id) ON DELETE RESTRICT; +ALTER TABLE ONLY elastic_reindexing_subtasks + ADD CONSTRAINT fk_rails_f2cc190164 FOREIGN KEY (elastic_reindexing_task_id) REFERENCES elastic_reindexing_tasks(id) ON DELETE CASCADE; + ALTER TABLE ONLY ci_pipeline_chat_data ADD CONSTRAINT fk_rails_f300456b63 FOREIGN KEY (chat_name_id) REFERENCES chat_names(id) ON DELETE CASCADE; @@ -25256,6 +25659,9 @@ ALTER TABLE ONLY board_group_recent_visits ALTER TABLE ONLY resource_state_events ADD CONSTRAINT fk_rails_f5827a7ccd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY incident_management_oncall_shifts + ADD CONSTRAINT fk_rails_f6eef06841 FOREIGN KEY (participant_id) REFERENCES incident_management_oncall_participants(id) ON DELETE CASCADE; + ALTER TABLE ONLY design_user_mentions ADD CONSTRAINT fk_rails_f7075a53c1 FOREIGN KEY (design_id) REFERENCES design_management_designs(id) ON DELETE CASCADE; |