diff --git a/.gitlab/ci/database.gitlab-ci.yml b/.gitlab/ci/database.gitlab-ci.yml index b151655ea51aa071be9d3dfcfb1db6c1df59f039..a36f0a12f4474ab8981161e86f4c560ff3c9b03d 100644 --- a/.gitlab/ci/database.gitlab-ci.yml +++ b/.gitlab/ci/database.gitlab-ci.yml @@ -36,7 +36,7 @@ db:rollback: - .db-job-base - .rails:rules:db-rollback script: - - bundle exec rake db:migrate VERSION=20230616082958 # 16.2 First migration + - bundle exec rake db:migrate VERSION=20230718020825 # 16.3 First migration - bundle exec rake db:migrate db:rollback single-db: diff --git a/.rubocop_todo/migration/ensure_factory_for_table.yml b/.rubocop_todo/migration/ensure_factory_for_table.yml index f5a8c65853cb917ff35605f4a057cfe650b4d4f9..70337cbe8c9607aefa4d9a94268bc8fb3f6527ab 100644 --- a/.rubocop_todo/migration/ensure_factory_for_table.yml +++ b/.rubocop_todo/migration/ensure_factory_for_table.yml @@ -2,14 +2,8 @@ Migration/EnsureFactoryForTable: Details: grace period Exclude: - - 'db/migrate/20230616164309_create_subscription_user_add_on_assignments.rb' - - 'db/migrate/20230616200440_create_system_access_microsoft_application.rb' - - 'db/migrate/20230616214220_create_system_access_microsoft_graph_access_tokens.rb' - - 'db/migrate/20230622044119_create_merge_request_review_llm_summary.rb' - 'db/migrate/20230626211305_create_catalog_resource_versions.rb' - 'db/migrate/20230704233431_create_table_batched_git_ref_updates_deletions.rb' - - 'db/migrate/20230705092150_create_ml_models.rb' - - 'db/migrate/20230707090835_create_ml_model_versions.rb' - 'db/migrate/20230717142737_create_group_ssh_certificate.rb' - 'db/migrate/20230727084849_create_catalog_resource_components.rb' - 'db/migrate/20230821133549_create_packages_nuget_symbols.rb' diff --git a/.rubocop_todo/style/inline_disable_annotation.yml b/.rubocop_todo/style/inline_disable_annotation.yml index c09e84907f3fd2e114de0edabad9269fe43f68a5..65a9056eb1256d1647ac8b53e60447a48e186721 100644 --- a/.rubocop_todo/style/inline_disable_annotation.yml +++ b/.rubocop_todo/style/inline_disable_annotation.yml @@ -1106,15 +1106,7 @@ Style/InlineDisableAnnotation: - 'config/routes/project.rb' - 'danger/ce_ee_vue_templates/Dangerfile' - 'danger/roulette/Dangerfile' - - 'db/migrate/20230522162742_cleanup_bigint_conversion_for_merge_request_metrics_for_self_hosts.rb' - 'db/migrate/20230601090722_add_status_message_to_packages.rb' - - 'db/migrate/20230612074428_add_name_to_external_audit_event_destination.rb' - - 'db/migrate/20230612091747_add_name_to_instance_audit_event_destination.rb' - - 'db/migrate/20230614180651_add_organization_id_to_namespaces.rb' - - 'db/migrate/20230621072726_add_description_to_ci_variable.rb' - - 'db/migrate/20230621083004_add_description_to_ci_group_variable.rb' - - 'db/migrate/20230706130217_add_column_model_id_to_ml_experiments.rb' - - 'db/migrate/20230710160232_add_expires_at_to_service_access_tokens.rb' - 'db/migrate/20230718145747_create_target_branch_rules.rb' - 'db/migrate/20230726104022_add_name_to_google_cloud_logging_configuration.rb' - 'db/migrate/20230809165212_add_path_prefix_and_build_ref_to_pages_deployments.rb' @@ -1127,11 +1119,6 @@ Style/InlineDisableAnnotation: - 'db/migrate/20231017135207_add_fields_to_ml_model.rb' - 'db/migrate/20231019180421_add_name_description_to_catalog_resources.rb' - 'db/migrate/20231024142236_add_fields_to_bulk_import_failures.rb' - - 'db/post_migrate/20230314094215_drop_u2f_registrations_table.rb' - - 'db/post_migrate/20230528203340_drop_message_from_vulnerability_occurrences.rb' - - 'db/post_migrate/20230614182049_add_index_to_namespaces_organization_id.rb' - - 'db/post_migrate/20230619005223_change_unconfirmed_created_at_index_on_users.rb' - - 'db/post_migrate/20230711093010_drop_default_partition_id_value_for_ci_tables.rb' - 'db/post_migrate/20230724123547_cleanup_conversion_big_int_ci_build_needs_self_managed.rb' - 'db/post_migrate/20230724150939_index_projects_on_namespace_id_and_repository_size_limit.rb' - 'db/post_migrate/20230728151058_add_auditor_index_to_users_table.rb' @@ -2882,7 +2869,6 @@ Style/InlineDisableAnnotation: - 'spec/lib/omni_auth/strategies/jwt_spec.rb' - 'spec/lib/result_spec.rb' - 'spec/mailers/notify_spec.rb' - - 'spec/migrations/20230613192703_swap_ci_build_needs_to_big_int_for_self_hosts_spec.rb' - 'spec/migrations/20230726144458_swap_notes_id_to_bigint_for_self_managed_spec.rb' - 'spec/migrations/20230803125434_add_has_merge_request_on_vulnerability_reads_trigger_spec.rb' - 'spec/migrations/20230809104753_swap_epic_user_mentions_note_id_to_bigint_for_self_hosts_spec.rb' @@ -2899,7 +2885,6 @@ Style/InlineDisableAnnotation: - 'spec/migrations/20230906204934_restart_self_hosted_sent_notifications_bigint_conversion_spec.rb' - 'spec/migrations/20230906204935_restart_self_hosted_sent_notifications_backfill_spec.rb' - 'spec/migrations/20231016001000_fix_design_user_mentions_design_id_note_id_index_for_self_managed_spec.rb' - - 'spec/migrations/cleanup_bigint_conversion_for_merge_request_metrics_for_self_hosts_spec.rb' - 'spec/migrations/cleanup_conversion_big_int_ci_build_needs_self_managed_spec.rb' - 'spec/migrations/swap_commit_user_mentions_note_id_to_bigint_for_self_managed_spec.rb' - 'spec/migrations/swap_events_target_id_to_bigint_for_gitlab_dot_com_spec.rb' diff --git a/db/init_structure.sql b/db/init_structure.sql index cf4118b3ce124e07b0c020831e86bb2cb9db5376..58ebbe850c81fb74459119ff0c8d6380394147a1 100644 --- a/db/init_structure.sql +++ b/db/init_structure.sql @@ -191,6 +191,18 @@ CREATE FUNCTION postgres_pg_stat_activity_autovacuum() RETURNS TABLE(query text, AND backend_type = 'autovacuum worker' $$; +CREATE FUNCTION prevent_delete_of_default_organization() RETURNS trigger + LANGUAGE plpgsql + AS $$ +BEGIN +IF OLD.id = 1 THEN + RAISE EXCEPTION 'Deletion of the default Organization is not allowed.'; +END IF; +RETURN OLD; + +END +$$; + CREATE FUNCTION set_has_external_issue_tracker() RETURNS trigger LANGUAGE plpgsql AS $$ @@ -237,29 +249,20 @@ RETURN NULL; END $$; -CREATE FUNCTION trigger_023e82d8e257() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."id_convert_to_bigint" := NEW."id"; - RETURN NEW; -END; -$$; - -CREATE FUNCTION trigger_080e73845bfd() RETURNS trigger +CREATE FUNCTION trigger_1a857e8db6cd() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - NEW."id_convert_to_bigint" := NEW."id"; + NEW."uuid_convert_string_to_uuid" := NEW."uuid"; RETURN NEW; END; $$; -CREATE FUNCTION trigger_1a857e8db6cd() RETURNS trigger +CREATE FUNCTION trigger_7f3d66a7d7f5() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - NEW."uuid_convert_string_to_uuid" := NEW."uuid"; + NEW."pipeline_id_convert_to_bigint" := NEW."pipeline_id"; RETURN NEW; END; $$; @@ -11766,6 +11769,10 @@ CREATE TABLE application_settings ( unconfirmed_users_delete_after_days integer DEFAULT 7 NOT NULL, default_branch_protection_defaults jsonb DEFAULT '{}'::jsonb NOT NULL, gitlab_shell_operation_limit integer DEFAULT 600, + elasticsearch_requeue_workers boolean DEFAULT false NOT NULL, + elasticsearch_worker_number_of_shards integer DEFAULT 2 NOT NULL, + relay_state_domain_allowlist text[] DEFAULT '{}'::text[] NOT NULL, + namespace_storage_forks_cost_factor double precision DEFAULT 1.0 NOT NULL, CONSTRAINT app_settings_container_reg_cleanup_tags_max_list_size_positive CHECK ((container_registry_cleanup_tags_service_max_list_size >= 0)), CONSTRAINT app_settings_container_registry_pre_import_tags_rate_positive CHECK ((container_registry_pre_import_tags_rate >= (0)::numeric)), CONSTRAINT app_settings_dep_proxy_ttl_policies_worker_capacity_positive CHECK ((dependency_proxy_ttl_group_policy_worker_capacity >= 0)), @@ -11809,6 +11816,7 @@ CREATE TABLE application_settings ( CONSTRAINT check_9c6c447a13 CHECK ((char_length(maintenance_mode_message) <= 255)), CONSTRAINT check_a5704163cc CHECK ((char_length(secret_detection_revocation_token_types_url) <= 255)), CONSTRAINT check_ae53cf7f82 CHECK ((char_length(vertex_ai_host) <= 255)), + CONSTRAINT check_app_settings_namespace_storage_forks_cost_factor_range CHECK (((namespace_storage_forks_cost_factor >= (0)::double precision) AND (namespace_storage_forks_cost_factor <= (1)::double precision))), CONSTRAINT check_b8c74ea5b3 CHECK ((char_length(deactivation_email_additional_text) <= 1000)), CONSTRAINT check_d03919528d CHECK ((char_length(container_registry_vendor) <= 255)), CONSTRAINT check_d820146492 CHECK ((char_length(spam_check_endpoint_url) <= 255)), @@ -12113,8 +12121,10 @@ CREATE TABLE audit_events_external_audit_event_destinations ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, verification_token text, + name text NOT NULL, CONSTRAINT check_2feafb9daf CHECK ((char_length(destination_url) <= 255)), - CONSTRAINT check_8ec80a7d06 CHECK ((char_length(verification_token) <= 24)) + CONSTRAINT check_8ec80a7d06 CHECK ((char_length(verification_token) <= 24)), + CONSTRAINT check_c52ff8e90e CHECK ((char_length(name) <= 72)) ); CREATE SEQUENCE audit_events_external_audit_event_destinations_id_seq @@ -12166,6 +12176,8 @@ CREATE TABLE audit_events_instance_external_audit_event_destinations ( destination_url text NOT NULL, encrypted_verification_token bytea NOT NULL, encrypted_verification_token_iv bytea NOT NULL, + name text NOT NULL, + CONSTRAINT check_433fbb3305 CHECK ((char_length(name) <= 72)), CONSTRAINT check_4dc67167ce CHECK ((char_length(destination_url) <= 255)) ); @@ -12918,7 +12930,8 @@ ALTER SEQUENCE bulk_imports_id_seq OWNED BY bulk_imports.id; CREATE TABLE catalog_resources ( id bigint NOT NULL, project_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL + created_at timestamp with time zone NOT NULL, + state smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE catalog_resources_id_seq @@ -12975,7 +12988,7 @@ CREATE TABLE ci_build_needs ( artifacts boolean DEFAULT true NOT NULL, optional boolean DEFAULT false NOT NULL, build_id bigint NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL, + partition_id bigint NOT NULL, id bigint NOT NULL ); @@ -12997,7 +13010,7 @@ CREATE TABLE ci_build_pending_states ( failure_reason smallint, trace_checksum bytea, trace_bytesize bigint, - partition_id bigint DEFAULT 100 NOT NULL + partition_id bigint NOT NULL ); CREATE SEQUENCE ci_build_pending_states_id_seq @@ -13013,7 +13026,7 @@ CREATE TABLE ci_build_report_results ( build_id bigint NOT NULL, project_id bigint NOT NULL, data jsonb DEFAULT '{}'::jsonb NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL + partition_id bigint NOT NULL ); CREATE TABLE ci_build_trace_chunks ( @@ -13024,7 +13037,7 @@ CREATE TABLE ci_build_trace_chunks ( checksum bytea, lock_version integer DEFAULT 0 NOT NULL, build_id bigint NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL + partition_id bigint NOT NULL ); CREATE SEQUENCE ci_build_trace_chunks_id_seq @@ -13044,7 +13057,7 @@ CREATE TABLE ci_build_trace_metadata ( remote_checksum bytea, last_archival_attempt_at timestamp with time zone, archived_at timestamp with time zone, - partition_id bigint DEFAULT 100 NOT NULL + partition_id bigint NOT NULL ); CREATE TABLE p_ci_builds ( @@ -13209,7 +13222,7 @@ CREATE TABLE ci_builds_runner_session ( certificate character varying, "authorization" character varying, build_id bigint NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL + partition_id bigint NOT NULL ); CREATE SEQUENCE ci_builds_runner_session_id_seq @@ -13325,7 +13338,9 @@ CREATE TABLE ci_group_variables ( variable_type smallint DEFAULT 1 NOT NULL, environment_scope text DEFAULT '*'::text NOT NULL, raw boolean DEFAULT false NOT NULL, - CONSTRAINT check_dfe009485a CHECK ((char_length(environment_scope) <= 255)) + description text, + CONSTRAINT check_dfe009485a CHECK ((char_length(environment_scope) <= 255)), + CONSTRAINT check_e2e50ff879 CHECK ((char_length(description) <= 255)) ); CREATE SEQUENCE ci_group_variables_id_seq @@ -13387,7 +13402,7 @@ CREATE TABLE ci_job_artifacts ( id bigint NOT NULL, job_id bigint NOT NULL, locked smallint DEFAULT 2, - partition_id bigint DEFAULT 100 NOT NULL, + partition_id bigint NOT NULL, accessibility smallint DEFAULT 0 NOT NULL, file_final_path text, CONSTRAINT check_27f0f6dbab CHECK ((file_store IS NOT NULL)), @@ -13430,7 +13445,7 @@ CREATE TABLE ci_job_variables ( variable_type smallint DEFAULT 1 NOT NULL, source smallint DEFAULT 0 NOT NULL, raw boolean DEFAULT false NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL + partition_id bigint NOT NULL ); CREATE SEQUENCE ci_job_variables_id_seq @@ -13523,7 +13538,7 @@ CREATE TABLE ci_pending_builds ( minutes_exceeded boolean DEFAULT false NOT NULL, tag_ids integer[] DEFAULT '{}'::integer[], namespace_traversal_ids integer[] DEFAULT '{}'::integer[], - partition_id bigint DEFAULT 100 NOT NULL + partition_id bigint NOT NULL ); CREATE SEQUENCE ci_pending_builds_id_seq @@ -13657,7 +13672,6 @@ CREATE SEQUENCE ci_pipeline_schedules_id_seq ALTER SEQUENCE ci_pipeline_schedules_id_seq OWNED BY ci_pipeline_schedules.id; CREATE TABLE ci_pipeline_variables ( - id_convert_to_bigint integer DEFAULT 0 NOT NULL, key character varying NOT NULL, value text, encrypted_value text, @@ -13665,9 +13679,10 @@ CREATE TABLE ci_pipeline_variables ( encrypted_value_iv character varying, pipeline_id integer NOT NULL, variable_type smallint DEFAULT 1 NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL, + partition_id bigint NOT NULL, raw boolean DEFAULT false NOT NULL, - id bigint NOT NULL + id bigint NOT NULL, + pipeline_id_convert_to_bigint bigint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_pipeline_variables_id_seq @@ -13709,7 +13724,7 @@ CREATE TABLE ci_pipelines ( external_pull_request_id bigint, ci_ref_id bigint, locked smallint DEFAULT 1 NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL, + partition_id bigint NOT NULL, id_convert_to_bigint bigint DEFAULT 0 NOT NULL, CONSTRAINT check_d7e99a025e CHECK ((lock_version IS NOT NULL)) ); @@ -13951,7 +13966,7 @@ CREATE TABLE ci_running_builds ( runner_id bigint NOT NULL, created_at timestamp with time zone DEFAULT now() NOT NULL, runner_type smallint NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL + partition_id bigint NOT NULL ); CREATE SEQUENCE ci_running_builds_id_seq @@ -14017,8 +14032,8 @@ CREATE TABLE ci_sources_pipelines ( source_project_id integer, source_pipeline_id integer, source_job_id bigint, - partition_id bigint DEFAULT 100 NOT NULL, - source_partition_id bigint DEFAULT 100 NOT NULL + partition_id bigint NOT NULL, + source_partition_id bigint NOT NULL ); CREATE SEQUENCE ci_sources_pipelines_id_seq @@ -14055,7 +14070,7 @@ CREATE TABLE ci_stages ( lock_version integer DEFAULT 0, "position" integer, id bigint NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL, + partition_id bigint NOT NULL, CONSTRAINT check_81b431e49b CHECK ((lock_version IS NOT NULL)) ); @@ -14128,7 +14143,7 @@ CREATE TABLE ci_unit_test_failures ( failed_at timestamp with time zone NOT NULL, unit_test_id bigint NOT NULL, build_id bigint NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL + partition_id bigint NOT NULL ); CREATE SEQUENCE ci_unit_test_failures_id_seq @@ -14172,7 +14187,9 @@ CREATE TABLE ci_variables ( environment_scope character varying DEFAULT '*'::character varying NOT NULL, masked boolean DEFAULT false NOT NULL, variable_type smallint DEFAULT 1 NOT NULL, - raw boolean DEFAULT false NOT NULL + raw boolean DEFAULT false NOT NULL, + description text, + CONSTRAINT check_7e46c006aa CHECK ((char_length(description) <= 255)) ); CREATE SEQUENCE ci_variables_id_seq @@ -15673,7 +15690,9 @@ CREATE TABLE environments ( auto_delete_at timestamp with time zone, tier smallint, merge_request_id bigint, - cluster_agent_id bigint + cluster_agent_id bigint, + kubernetes_namespace text, + CONSTRAINT check_b5373a1804 CHECK ((char_length(kubernetes_namespace) <= 63)) ); CREATE SEQUENCE environments_id_seq @@ -16714,6 +16733,28 @@ CREATE TABLE group_wiki_repositories ( CONSTRAINT check_07f1c81806 CHECK ((char_length(disk_path) <= 80)) ); +CREATE TABLE group_wiki_repository_states ( + id bigint NOT NULL, + verification_started_at timestamp with time zone, + verification_retry_at timestamp with time zone, + verified_at timestamp with time zone, + group_wiki_repository_id bigint NOT NULL, + verification_state smallint DEFAULT 0 NOT NULL, + verification_retry_count smallint DEFAULT 0 NOT NULL, + verification_checksum bytea, + verification_failure text, + CONSTRAINT check_14d288436d CHECK ((char_length(verification_failure) <= 255)) +); + +CREATE SEQUENCE group_wiki_repository_states_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE group_wiki_repository_states_id_seq OWNED BY group_wiki_repository_states.id; + CREATE TABLE historical_data ( id integer NOT NULL, date date, @@ -17128,6 +17169,8 @@ CREATE TABLE integrations ( encrypted_properties bytea, encrypted_properties_iv bytea, incident_events boolean DEFAULT false NOT NULL, + group_mention_events boolean DEFAULT false NOT NULL, + group_confidential_mention_events boolean DEFAULT false NOT NULL, CONSTRAINT check_a948a0aa7e CHECK ((char_length(type_new) <= 255)) ); @@ -17859,7 +17902,8 @@ CREATE TABLE member_roles ( base_access_level integer NOT NULL, read_code boolean DEFAULT false, read_vulnerability boolean DEFAULT false NOT NULL, - admin_vulnerability boolean DEFAULT false NOT NULL + admin_vulnerability boolean DEFAULT false NOT NULL, + read_dependency boolean DEFAULT false NOT NULL ); CREATE SEQUENCE member_roles_id_seq @@ -18203,6 +18247,27 @@ CREATE SEQUENCE merge_request_predictions_merge_request_id_seq ALTER SEQUENCE merge_request_predictions_merge_request_id_seq OWNED BY merge_request_predictions.merge_request_id; +CREATE TABLE merge_request_review_llm_summaries ( + id bigint NOT NULL, + user_id bigint, + review_id bigint NOT NULL, + merge_request_diff_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + provider smallint NOT NULL, + content text NOT NULL, + CONSTRAINT check_72802358e9 CHECK ((char_length(content) <= 2056)) +); + +CREATE SEQUENCE merge_request_review_llm_summaries_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE merge_request_review_llm_summaries_id_seq OWNED BY merge_request_review_llm_summaries.id; + CREATE TABLE merge_request_reviewers ( id bigint NOT NULL, user_id bigint NOT NULL, @@ -18545,6 +18610,7 @@ CREATE TABLE ml_experiments ( user_id bigint, name text NOT NULL, deleted_on timestamp with time zone, + model_id bigint, CONSTRAINT check_ee07a0be2c CHECK ((char_length(name) <= 255)) ); @@ -18557,6 +18623,44 @@ CREATE SEQUENCE ml_experiments_id_seq ALTER SEQUENCE ml_experiments_id_seq OWNED BY ml_experiments.id; +CREATE TABLE ml_model_versions ( + 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, + model_id bigint NOT NULL, + package_id bigint, + version text NOT NULL, + CONSTRAINT check_28b2d892c8 CHECK ((char_length(version) <= 255)) +); + +CREATE SEQUENCE ml_model_versions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ml_model_versions_id_seq OWNED BY ml_model_versions.id; + +CREATE TABLE ml_models ( + 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, + name text NOT NULL, + CONSTRAINT check_1fd2cc7d93 CHECK ((char_length(name) <= 255)) +); + +CREATE SEQUENCE ml_models_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE ml_models_id_seq OWNED BY ml_models.id; + CREATE TABLE namespace_admin_notes ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -18649,7 +18753,10 @@ CREATE TABLE namespace_limits ( additional_purchased_storage_size bigint DEFAULT 0 NOT NULL, additional_purchased_storage_ends_on date, namespace_id integer NOT NULL, - temporary_storage_increase_ends_on date + temporary_storage_increase_ends_on date, + pre_enforcement_notification_at timestamp with time zone, + first_enforced_at timestamp with time zone, + last_enforced_at timestamp with time zone ); CREATE TABLE namespace_package_settings ( @@ -18798,7 +18905,8 @@ CREATE TABLE namespaces ( push_rule_id bigint, shared_runners_enabled boolean DEFAULT true NOT NULL, allow_descendants_override_disabled_shared_runners boolean DEFAULT false NOT NULL, - traversal_ids integer[] DEFAULT '{}'::integer[] NOT NULL + traversal_ids integer[] DEFAULT '{}'::integer[] NOT NULL, + organization_id bigint DEFAULT 1 ); CREATE SEQUENCE namespaces_id_seq @@ -18882,7 +18990,6 @@ CREATE SEQUENCE note_metadata_note_id_seq ALTER SEQUENCE note_metadata_note_id_seq OWNED BY note_metadata.note_id; CREATE TABLE notes ( - id_convert_to_bigint integer DEFAULT 0 NOT NULL, note text, noteable_type character varying, author_id integer, @@ -19224,6 +19331,30 @@ CREATE SEQUENCE operations_user_lists_id_seq ALTER SEQUENCE operations_user_lists_id_seq OWNED BY operations_user_lists.id; +CREATE TABLE organization_settings ( + organization_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + settings jsonb DEFAULT '{}'::jsonb NOT NULL +); + +CREATE TABLE organization_users ( + id bigint NOT NULL, + organization_id bigint NOT NULL, + user_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE organization_users_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE organization_users_id_seq OWNED BY organization_users.id; + CREATE TABLE organizations ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -20047,7 +20178,8 @@ CREATE TABLE personal_access_tokens ( token_digest character varying, expire_notification_delivered boolean DEFAULT false NOT NULL, last_used_at timestamp with time zone, - after_expiry_notification_delivered boolean DEFAULT false NOT NULL + after_expiry_notification_delivered boolean DEFAULT false NOT NULL, + previous_personal_access_token_id bigint ); CREATE SEQUENCE personal_access_tokens_id_seq @@ -20192,7 +20324,7 @@ CREATE TABLE pm_advisories ( CONSTRAINT check_bed97fa77a CHECK ((char_length(cvss_v3) <= 128)), CONSTRAINT check_e4bfd3ffbf CHECK ((char_length(title) <= 256)), CONSTRAINT check_fee880f7aa CHECK ((char_length(description) <= 8192)), - CONSTRAINT chk_rails_e73af9de76 CHECK ((cardinality(urls) <= 10)) + CONSTRAINT chk_rails_e73af9de76 CHECK ((cardinality(urls) <= 20)) ); CREATE SEQUENCE pm_advisories_id_seq @@ -20211,7 +20343,7 @@ CREATE TABLE pm_affected_packages ( updated_at timestamp with time zone NOT NULL, purl_type smallint NOT NULL, package_name text NOT NULL, - distro_version text, + distro_version text DEFAULT ''::text NOT NULL, solution text, affected_range text NOT NULL, fixed_versions text[] DEFAULT '{}'::text[], @@ -22159,7 +22291,8 @@ CREATE TABLE saml_providers ( enforced_group_managed_accounts boolean DEFAULT false NOT NULL, prohibited_outer_forks boolean DEFAULT true NOT NULL, default_membership_role smallint DEFAULT 10 NOT NULL, - git_check_enforced boolean DEFAULT false NOT NULL + git_check_enforced boolean DEFAULT false NOT NULL, + relay_state_domain_allowlist text[] DEFAULT '{}'::text[] NOT NULL ); CREATE SEQUENCE saml_providers_id_seq @@ -22267,23 +22400,6 @@ CREATE SEQUENCE sbom_sources_id_seq ALTER SEQUENCE sbom_sources_id_seq OWNED BY sbom_sources.id; -CREATE TABLE sbom_vulnerable_component_versions ( - id bigint NOT NULL, - vulnerability_advisory_id bigint, - sbom_component_version_id bigint, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL -); - -CREATE SEQUENCE sbom_vulnerable_component_versions_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE sbom_vulnerable_component_versions_id_seq OWNED BY sbom_vulnerable_component_versions.id; - CREATE TABLE scan_result_policies ( id bigint NOT NULL, security_orchestration_policy_configuration_id bigint NOT NULL, @@ -22296,6 +22412,8 @@ CREATE TABLE scan_result_policies ( age_value integer, age_operator smallint, age_interval smallint, + vulnerability_attributes jsonb DEFAULT '{}'::jsonb, + project_id bigint, CONSTRAINT age_value_null_or_positive CHECK (((age_value IS NULL) OR (age_value >= 0))) ); @@ -22559,9 +22677,6 @@ CREATE TABLE sent_notifications ( recipient_id integer, commit_id character varying, reply_key character varying NOT NULL, - line_code character varying, - note_type character varying, - "position" text, in_reply_to_discussion_id character varying, id bigint NOT NULL ); @@ -22590,6 +22705,25 @@ CREATE SEQUENCE sentry_issues_id_seq ALTER SEQUENCE sentry_issues_id_seq OWNED BY sentry_issues.id; +CREATE TABLE service_access_tokens ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + category smallint DEFAULT 0 NOT NULL, + encrypted_token bytea NOT NULL, + encrypted_token_iv bytea NOT NULL, + expires_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE service_access_tokens_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE service_access_tokens_id_seq OWNED BY service_access_tokens.id; + CREATE TABLE service_desk_custom_email_credentials ( project_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -23014,6 +23148,23 @@ CREATE SEQUENCE subscription_add_ons_id_seq ALTER SEQUENCE subscription_add_ons_id_seq OWNED BY subscription_add_ons.id; +CREATE TABLE subscription_user_add_on_assignments ( + id bigint NOT NULL, + add_on_purchase_id bigint NOT NULL, + user_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE subscription_user_add_on_assignments_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE subscription_user_add_on_assignments_id_seq OWNED BY subscription_user_add_on_assignments.id; + CREATE TABLE subscriptions ( id integer NOT NULL, user_id integer, @@ -23056,6 +23207,52 @@ CREATE SEQUENCE suggestions_id_seq ALTER SEQUENCE suggestions_id_seq OWNED BY suggestions.id; +CREATE TABLE system_access_microsoft_applications ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + namespace_id bigint, + enabled boolean DEFAULT false NOT NULL, + tenant_xid text NOT NULL, + client_xid text NOT NULL, + login_endpoint text DEFAULT 'https://login.microsoftonline.com'::text NOT NULL, + graph_endpoint text DEFAULT 'https://graph.microsoft.com'::text NOT NULL, + encrypted_client_secret bytea NOT NULL, + encrypted_client_secret_iv bytea NOT NULL, + CONSTRAINT check_042f6b21aa CHECK ((char_length(login_endpoint) <= 255)), + CONSTRAINT check_1e8b2d405f CHECK ((char_length(tenant_xid) <= 255)), + CONSTRAINT check_339c3ffca8 CHECK ((char_length(graph_endpoint) <= 255)), + CONSTRAINT check_ee72fb5459 CHECK ((char_length(client_xid) <= 255)) +); + +CREATE SEQUENCE system_access_microsoft_applications_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE system_access_microsoft_applications_id_seq OWNED BY system_access_microsoft_applications.id; + +CREATE TABLE system_access_microsoft_graph_access_tokens ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + system_access_microsoft_application_id bigint, + expires_in integer NOT NULL, + encrypted_token bytea NOT NULL, + encrypted_token_iv bytea NOT NULL +); + +CREATE SEQUENCE system_access_microsoft_graph_access_tokens_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE system_access_microsoft_graph_access_tokens_id_seq OWNED BY system_access_microsoft_graph_access_tokens.id; + CREATE TABLE system_note_metadata ( id integer NOT NULL, commit_count integer, @@ -23313,27 +23510,6 @@ CREATE SEQUENCE trending_projects_id_seq ALTER SEQUENCE trending_projects_id_seq OWNED BY trending_projects.id; -CREATE TABLE u2f_registrations ( - id integer NOT NULL, - certificate text, - key_handle character varying, - public_key character varying, - counter integer, - user_id integer, - created_at timestamp without time zone NOT NULL, - updated_at timestamp without time zone NOT NULL, - name character varying -); - -CREATE SEQUENCE u2f_registrations_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE u2f_registrations_id_seq OWNED BY u2f_registrations.id; - CREATE TABLE upcoming_reconciliations ( id bigint NOT NULL, namespace_id bigint, @@ -23520,7 +23696,6 @@ CREATE TABLE user_details ( password_last_changed_at timestamp with time zone DEFAULT now() NOT NULL, onboarding_step_url text, discord text DEFAULT ''::text NOT NULL, - provisioned_by_group_at timestamp with time zone, enterprise_group_id bigint, enterprise_group_associated_at timestamp with time zone, CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)), @@ -23784,7 +23959,7 @@ CREATE TABLE users ( otp_backup_codes text, public_email character varying, dashboard integer DEFAULT 0, - project_view integer DEFAULT 0, + project_view integer DEFAULT 2, consumed_timestep integer, layout integer DEFAULT 0, hide_project_limit boolean DEFAULT false, @@ -23820,6 +23995,7 @@ CREATE TABLE users ( static_object_token_encrypted text, otp_secret_expires_at timestamp with time zone, onboarding_in_progress boolean DEFAULT false NOT NULL, + CONSTRAINT check_0dd5948e38 CHECK ((user_type IS NOT NULL)), CONSTRAINT check_7bde697e8e CHECK ((char_length(static_object_token_encrypted) <= 255)) ); @@ -23957,44 +24133,6 @@ CREATE SEQUENCE vulnerabilities_id_seq ALTER SEQUENCE vulnerabilities_id_seq OWNED BY vulnerabilities.id; -CREATE TABLE vulnerability_advisories ( - uuid uuid NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - id bigint NOT NULL, - created_date date NOT NULL, - published_date date NOT NULL, - description text, - title text, - component_name text, - solution text, - not_impacted text, - cvss_v2 text, - cvss_v3 text, - affected_range text, - identifiers text[] DEFAULT '{}'::text[], - fixed_versions text[] DEFAULT '{}'::text[], - urls text[] DEFAULT '{}'::text[], - links text[] DEFAULT '{}'::text[], - CONSTRAINT check_3ab0544d19 CHECK ((char_length(title) <= 2048)), - CONSTRAINT check_3b57023409 CHECK ((char_length(affected_range) <= 32)), - CONSTRAINT check_4d5cd7be9c CHECK ((char_length(component_name) <= 2048)), - CONSTRAINT check_962f256a51 CHECK ((char_length(solution) <= 2048)), - CONSTRAINT check_aae93955fb CHECK ((char_length(cvss_v3) <= 128)), - CONSTRAINT check_b8a17497f3 CHECK ((char_length(cvss_v2) <= 128)), - CONSTRAINT check_c05a35f418 CHECK ((char_length(not_impacted) <= 2048)), - CONSTRAINT check_ff9f6483b6 CHECK ((char_length(description) <= 2048)) -); - -CREATE SEQUENCE vulnerability_advisories_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE vulnerability_advisories_id_seq OWNED BY vulnerability_advisories.id; - CREATE TABLE vulnerability_exports ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -24298,7 +24436,6 @@ CREATE TABLE vulnerability_occurrences ( vulnerability_id bigint, details jsonb DEFAULT '{}'::jsonb NOT NULL, description text, - message text, solution text, cve text, location jsonb, @@ -24306,7 +24443,6 @@ CREATE TABLE vulnerability_occurrences ( uuid_convert_string_to_uuid uuid DEFAULT '00000000-0000-0000-0000-000000000000'::uuid NOT NULL, CONSTRAINT check_4a3a60f2ba CHECK ((char_length(solution) <= 7000)), CONSTRAINT check_ade261da6b CHECK ((char_length(description) <= 15000)), - CONSTRAINT check_df6dd20219 CHECK ((char_length(message) <= 3000)), CONSTRAINT check_f602da68dd CHECK ((char_length(cve) <= 48400)) ); @@ -24501,7 +24637,8 @@ CREATE TABLE web_hooks ( encrypted_url_variables bytea, encrypted_url_variables_iv bytea, integration_id integer, - branch_filter_strategy smallint DEFAULT 0 NOT NULL + branch_filter_strategy smallint DEFAULT 0 NOT NULL, + emoji_events boolean DEFAULT false NOT NULL ); CREATE SEQUENCE web_hooks_id_seq @@ -25323,6 +25460,8 @@ ALTER TABLE ONLY group_import_states ALTER COLUMN group_id SET DEFAULT nextval(' ALTER TABLE ONLY group_repository_storage_moves ALTER COLUMN id SET DEFAULT nextval('group_repository_storage_moves_id_seq'::regclass); +ALTER TABLE ONLY group_wiki_repository_states ALTER COLUMN id SET DEFAULT nextval('group_wiki_repository_states_id_seq'::regclass); + ALTER TABLE ONLY historical_data ALTER COLUMN id SET DEFAULT nextval('historical_data_id_seq'::regclass); ALTER TABLE ONLY identities ALTER COLUMN id SET DEFAULT nextval('identities_id_seq'::regclass); @@ -25459,6 +25598,8 @@ ALTER TABLE ONLY merge_request_metrics ALTER COLUMN id SET DEFAULT nextval('merg ALTER TABLE ONLY merge_request_predictions ALTER COLUMN merge_request_id SET DEFAULT nextval('merge_request_predictions_merge_request_id_seq'::regclass); +ALTER TABLE ONLY merge_request_review_llm_summaries ALTER COLUMN id SET DEFAULT nextval('merge_request_review_llm_summaries_id_seq'::regclass); + ALTER TABLE ONLY merge_request_reviewers ALTER COLUMN id SET DEFAULT nextval('merge_request_reviewers_id_seq'::regclass); ALTER TABLE ONLY merge_request_user_mentions ALTER COLUMN id SET DEFAULT nextval('merge_request_user_mentions_id_seq'::regclass); @@ -25489,6 +25630,10 @@ ALTER TABLE ONLY ml_experiment_metadata ALTER COLUMN id SET DEFAULT nextval('ml_ ALTER TABLE ONLY ml_experiments ALTER COLUMN id SET DEFAULT nextval('ml_experiments_id_seq'::regclass); +ALTER TABLE ONLY ml_model_versions ALTER COLUMN id SET DEFAULT nextval('ml_model_versions_id_seq'::regclass); + +ALTER TABLE ONLY ml_models ALTER COLUMN id SET DEFAULT nextval('ml_models_id_seq'::regclass); + ALTER TABLE ONLY namespace_admin_notes ALTER COLUMN id SET DEFAULT nextval('namespace_admin_notes_id_seq'::regclass); ALTER TABLE ONLY namespace_bans ALTER COLUMN id SET DEFAULT nextval('namespace_bans_id_seq'::regclass); @@ -25537,6 +25682,8 @@ ALTER TABLE ONLY operations_strategies_user_lists ALTER COLUMN id SET DEFAULT ne ALTER TABLE ONLY operations_user_lists ALTER COLUMN id SET DEFAULT nextval('operations_user_lists_id_seq'::regclass); +ALTER TABLE ONLY organization_users ALTER COLUMN id SET DEFAULT nextval('organization_users_id_seq'::regclass); + ALTER TABLE ONLY organizations ALTER COLUMN id SET DEFAULT nextval('organizations_id_seq'::regclass); ALTER TABLE ONLY p_ci_builds ALTER COLUMN id SET DEFAULT nextval('ci_builds_id_seq'::regclass); @@ -25771,8 +25918,6 @@ ALTER TABLE ONLY sbom_occurrences ALTER COLUMN id SET DEFAULT nextval('sbom_occu ALTER TABLE ONLY sbom_sources ALTER COLUMN id SET DEFAULT nextval('sbom_sources_id_seq'::regclass); -ALTER TABLE ONLY sbom_vulnerable_component_versions ALTER COLUMN id SET DEFAULT nextval('sbom_vulnerable_component_versions_id_seq'::regclass); - ALTER TABLE ONLY scan_result_policies ALTER COLUMN id SET DEFAULT nextval('scan_result_policies_id_seq'::regclass); ALTER TABLE ONLY schema_inconsistencies ALTER COLUMN id SET DEFAULT nextval('schema_inconsistencies_id_seq'::regclass); @@ -25803,6 +25948,8 @@ ALTER TABLE ONLY sent_notifications ALTER COLUMN id SET DEFAULT nextval('sent_no ALTER TABLE ONLY sentry_issues ALTER COLUMN id SET DEFAULT nextval('sentry_issues_id_seq'::regclass); +ALTER TABLE ONLY service_access_tokens ALTER COLUMN id SET DEFAULT nextval('service_access_tokens_id_seq'::regclass); + ALTER TABLE ONLY shards ALTER COLUMN id SET DEFAULT nextval('shards_id_seq'::regclass); ALTER TABLE ONLY slack_api_scopes ALTER COLUMN id SET DEFAULT nextval('slack_api_scopes_id_seq'::regclass); @@ -25839,10 +25986,16 @@ ALTER TABLE ONLY subscription_add_on_purchases ALTER COLUMN id SET DEFAULT nextv ALTER TABLE ONLY subscription_add_ons ALTER COLUMN id SET DEFAULT nextval('subscription_add_ons_id_seq'::regclass); +ALTER TABLE ONLY subscription_user_add_on_assignments ALTER COLUMN id SET DEFAULT nextval('subscription_user_add_on_assignments_id_seq'::regclass); + ALTER TABLE ONLY subscriptions ALTER COLUMN id SET DEFAULT nextval('subscriptions_id_seq'::regclass); ALTER TABLE ONLY suggestions ALTER COLUMN id SET DEFAULT nextval('suggestions_id_seq'::regclass); +ALTER TABLE ONLY system_access_microsoft_applications ALTER COLUMN id SET DEFAULT nextval('system_access_microsoft_applications_id_seq'::regclass); + +ALTER TABLE ONLY system_access_microsoft_graph_access_tokens ALTER COLUMN id SET DEFAULT nextval('system_access_microsoft_graph_access_tokens_id_seq'::regclass); + ALTER TABLE ONLY system_note_metadata ALTER COLUMN id SET DEFAULT nextval('system_note_metadata_id_seq'::regclass); ALTER TABLE ONLY taggings ALTER COLUMN id SET DEFAULT nextval('taggings_id_seq'::regclass); @@ -25867,8 +26020,6 @@ ALTER TABLE ONLY topics ALTER COLUMN id SET DEFAULT nextval('topics_id_seq'::reg ALTER TABLE ONLY trending_projects ALTER COLUMN id SET DEFAULT nextval('trending_projects_id_seq'::regclass); -ALTER TABLE ONLY u2f_registrations ALTER COLUMN id SET DEFAULT nextval('u2f_registrations_id_seq'::regclass); - ALTER TABLE ONLY upcoming_reconciliations ALTER COLUMN id SET DEFAULT nextval('upcoming_reconciliations_id_seq'::regclass); ALTER TABLE ONLY upload_states ALTER COLUMN upload_id SET DEFAULT nextval('upload_states_upload_id_seq'::regclass); @@ -25913,8 +26064,6 @@ ALTER TABLE ONLY value_stream_dashboard_counts ALTER COLUMN id SET DEFAULT nextv ALTER TABLE ONLY vulnerabilities ALTER COLUMN id SET DEFAULT nextval('vulnerabilities_id_seq'::regclass); -ALTER TABLE ONLY vulnerability_advisories ALTER COLUMN id SET DEFAULT nextval('vulnerability_advisories_id_seq'::regclass); - ALTER TABLE ONLY vulnerability_exports ALTER COLUMN id SET DEFAULT nextval('vulnerability_exports_id_seq'::regclass); ALTER TABLE ONLY vulnerability_external_issue_links ALTER COLUMN id SET DEFAULT nextval('vulnerability_external_issue_links_id_seq'::regclass); @@ -26833,9 +26982,6 @@ ALTER TABLE ONLY chat_names ALTER TABLE ONLY chat_teams ADD CONSTRAINT chat_teams_pkey PRIMARY KEY (id); -ALTER TABLE users - ADD CONSTRAINT check_0dd5948e38 CHECK ((user_type IS NOT NULL)) NOT VALID; - ALTER TABLE vulnerability_scanners ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID; @@ -27421,6 +27567,9 @@ ALTER TABLE ONLY group_repository_storage_moves ALTER TABLE ONLY group_wiki_repositories ADD CONSTRAINT group_wiki_repositories_pkey PRIMARY KEY (group_id); +ALTER TABLE ONLY group_wiki_repository_states + ADD CONSTRAINT group_wiki_repository_states_pkey PRIMARY KEY (id); + ALTER TABLE ONLY historical_data ADD CONSTRAINT historical_data_pkey PRIMARY KEY (id); @@ -27649,6 +27798,9 @@ ALTER TABLE ONLY merge_request_metrics ALTER TABLE ONLY merge_request_predictions ADD CONSTRAINT merge_request_predictions_pkey PRIMARY KEY (merge_request_id); +ALTER TABLE ONLY merge_request_review_llm_summaries + ADD CONSTRAINT merge_request_review_llm_summaries_pkey PRIMARY KEY (id); + ALTER TABLE ONLY merge_request_reviewers ADD CONSTRAINT merge_request_reviewers_pkey PRIMARY KEY (id); @@ -27697,6 +27849,12 @@ ALTER TABLE ONLY ml_experiment_metadata ALTER TABLE ONLY ml_experiments ADD CONSTRAINT ml_experiments_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ml_model_versions + ADD CONSTRAINT ml_model_versions_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY ml_models + ADD CONSTRAINT ml_models_pkey PRIMARY KEY (id); + ALTER TABLE ONLY namespace_admin_notes ADD CONSTRAINT namespace_admin_notes_pkey PRIMARY KEY (id); @@ -27793,6 +27951,12 @@ ALTER TABLE ONLY operations_strategies_user_lists ALTER TABLE ONLY operations_user_lists ADD CONSTRAINT operations_user_lists_pkey PRIMARY KEY (id); +ALTER TABLE ONLY organization_settings + ADD CONSTRAINT organization_settings_pkey PRIMARY KEY (organization_id); + +ALTER TABLE ONLY organization_users + ADD CONSTRAINT organization_users_pkey PRIMARY KEY (id); + ALTER TABLE ONLY organizations ADD CONSTRAINT organizations_pkey PRIMARY KEY (id); @@ -28201,9 +28365,6 @@ ALTER TABLE ONLY sbom_occurrences ALTER TABLE ONLY sbom_sources ADD CONSTRAINT sbom_sources_pkey PRIMARY KEY (id); -ALTER TABLE ONLY sbom_vulnerable_component_versions - ADD CONSTRAINT sbom_vulnerable_component_versions_pkey PRIMARY KEY (id); - ALTER TABLE ONLY scan_result_policies ADD CONSTRAINT scan_result_policies_pkey PRIMARY KEY (id); @@ -28252,6 +28413,9 @@ ALTER TABLE ONLY sentry_issues ALTER TABLE ONLY sprints ADD CONSTRAINT sequence_is_unique_per_iterations_cadence_id UNIQUE (iterations_cadence_id, sequence) DEFERRABLE INITIALLY DEFERRED; +ALTER TABLE ONLY service_access_tokens + ADD CONSTRAINT service_access_tokens_pkey PRIMARY KEY (id); + ALTER TABLE ONLY service_desk_custom_email_credentials ADD CONSTRAINT service_desk_custom_email_credentials_pkey PRIMARY KEY (project_id); @@ -28321,12 +28485,21 @@ ALTER TABLE ONLY subscription_add_on_purchases ALTER TABLE ONLY subscription_add_ons ADD CONSTRAINT subscription_add_ons_pkey PRIMARY KEY (id); +ALTER TABLE ONLY subscription_user_add_on_assignments + ADD CONSTRAINT subscription_user_add_on_assignments_pkey PRIMARY KEY (id); + ALTER TABLE ONLY subscriptions ADD CONSTRAINT subscriptions_pkey PRIMARY KEY (id); ALTER TABLE ONLY suggestions ADD CONSTRAINT suggestions_pkey PRIMARY KEY (id); +ALTER TABLE ONLY system_access_microsoft_applications + ADD CONSTRAINT system_access_microsoft_applications_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY system_access_microsoft_graph_access_tokens + ADD CONSTRAINT system_access_microsoft_graph_access_tokens_pkey PRIMARY KEY (id); + ALTER TABLE ONLY system_note_metadata ADD CONSTRAINT system_note_metadata_pkey PRIMARY KEY (id); @@ -28363,9 +28536,6 @@ ALTER TABLE ONLY topics ALTER TABLE ONLY trending_projects ADD CONSTRAINT trending_projects_pkey PRIMARY KEY (id); -ALTER TABLE ONLY u2f_registrations - ADD CONSTRAINT u2f_registrations_pkey PRIMARY KEY (id); - ALTER TABLE ONLY upcoming_reconciliations ADD CONSTRAINT upcoming_reconciliations_pkey PRIMARY KEY (id); @@ -28456,9 +28626,6 @@ ALTER TABLE ONLY verification_codes ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT vulnerabilities_pkey PRIMARY KEY (id); -ALTER TABLE ONLY vulnerability_advisories - ADD CONSTRAINT vulnerability_advisories_pkey PRIMARY KEY (id); - ALTER TABLE ONLY vulnerability_exports ADD CONSTRAINT vulnerability_exports_pkey PRIMARY KEY (id); @@ -29749,14 +29916,6 @@ CREATE INDEX idx_container_exp_policies_on_project_id_next_run_at_enabled ON con CREATE INDEX idx_container_repos_on_exp_cleanup_status_project_id_start_date ON container_repositories USING btree (expiration_policy_cleanup_status, project_id, expiration_policy_started_at); -CREATE INDEX idx_container_repos_on_import_started_at_when_importing ON container_repositories USING btree (migration_import_started_at) WHERE (migration_state = 'importing'::text); - -CREATE INDEX idx_container_repos_on_migration_state_migration_plan_created ON container_repositories USING btree (migration_state, migration_plan, created_at); - -CREATE INDEX idx_container_repos_on_pre_import_done_at_when_pre_import_done ON container_repositories USING btree (migration_pre_import_done_at) WHERE (migration_state = 'pre_import_done'::text); - -CREATE INDEX idx_container_repos_on_pre_import_started_at_when_pre_importing ON container_repositories USING btree (migration_pre_import_started_at) WHERE (migration_state = 'pre_importing'::text); - CREATE INDEX idx_deployment_clusters_on_cluster_id_and_kubernetes_namespace ON deployment_clusters USING btree (cluster_id, kubernetes_namespace); CREATE INDEX idx_devops_adoption_segments_namespace_end_time ON analytics_devops_adoption_snapshots USING btree (namespace_id, end_time); @@ -29851,8 +30010,12 @@ CREATE UNIQUE INDEX idx_packages_on_project_id_name_version_unique_when_golang O CREATE UNIQUE INDEX idx_packages_on_project_id_name_version_unique_when_helm ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 11) AND (status <> 4)); +CREATE UNIQUE INDEX idx_packages_on_project_id_name_version_unique_when_npm ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 2) AND (status <> 4)); + CREATE INDEX idx_packages_packages_on_project_id_name_version_package_type ON packages_packages USING btree (project_id, name, version, package_type); +CREATE INDEX idx_personal_access_tokens_on_previous_personal_access_token_id ON personal_access_tokens USING btree (previous_personal_access_token_id); + CREATE INDEX idx_pkgs_debian_group_distribution_keys_on_distribution_id ON packages_debian_group_distribution_keys USING btree (distribution_id); CREATE INDEX idx_pkgs_debian_project_distribution_keys_on_distribution_id ON packages_debian_project_distribution_keys USING btree (distribution_id); @@ -30639,6 +30802,8 @@ CREATE INDEX index_ci_triggers_on_owner_id ON ci_triggers USING btree (owner_id) CREATE INDEX index_ci_triggers_on_project_id ON ci_triggers USING btree (project_id); +CREATE UNIQUE INDEX index_ci_triggers_on_token ON ci_triggers USING btree (token); + CREATE INDEX index_ci_unit_test_failures_on_build_id ON ci_unit_test_failures USING btree (build_id); CREATE INDEX index_ci_unit_test_failures_on_partition_id_build_id ON ci_unit_test_failures USING btree (partition_id, build_id); @@ -30711,10 +30876,6 @@ CREATE INDEX index_container_expiration_policies_on_next_run_at_and_enabled ON c CREATE INDEX index_container_registry_data_repair_details_on_status ON container_registry_data_repair_details USING btree (status); -CREATE INDEX index_container_repositories_on_greatest_completed_at ON container_repositories USING btree (GREATEST(migration_pre_import_done_at, migration_import_done_at, migration_aborted_at, migration_skipped_at)) WHERE (migration_state = ANY (ARRAY['import_done'::text, 'pre_import_done'::text, 'import_aborted'::text, 'import_skipped'::text])); - -CREATE INDEX index_container_repositories_on_migration_state_import_done_at ON container_repositories USING btree (migration_state, migration_import_done_at); - CREATE INDEX index_container_repositories_on_project_id_and_id ON container_repositories USING btree (project_id, id); CREATE UNIQUE INDEX index_container_repositories_on_project_id_and_name ON container_repositories USING btree (project_id, name); @@ -31091,8 +31252,6 @@ CREATE INDEX index_events_on_project_id_and_created_at ON events USING btree (pr CREATE INDEX index_events_on_project_id_and_id ON events USING btree (project_id, id); -CREATE INDEX index_events_on_project_id_and_id_desc_on_merged_action ON events USING btree (project_id, id DESC) WHERE (action = 7); - CREATE UNIQUE INDEX index_events_on_target_type_and_target_id_and_fingerprint ON events USING btree (target_type, target_id, fingerprint); CREATE INDEX index_evidences_on_release_id ON evidences USING btree (release_id); @@ -31271,13 +31430,23 @@ CREATE UNIQUE INDEX index_group_wiki_repositories_on_disk_path ON group_wiki_rep CREATE INDEX index_group_wiki_repositories_on_shard_id ON group_wiki_repositories USING btree (shard_id); +CREATE INDEX index_group_wiki_repository_states_failed_verification ON group_wiki_repository_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_group_wiki_repository_states_needs_verification ON group_wiki_repository_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + +CREATE UNIQUE INDEX index_group_wiki_repository_states_on_group_wiki_repository_id ON group_wiki_repository_states USING btree (group_wiki_repository_id); + +CREATE INDEX index_group_wiki_repository_states_on_verification_state ON group_wiki_repository_states USING btree (verification_state); + +CREATE INDEX index_group_wiki_repository_states_pending_verification ON group_wiki_repository_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE INDEX index_groups_on_parent_id_id ON namespaces USING btree (parent_id, id) WHERE ((type)::text = 'Group'::text); CREATE INDEX index_groups_on_path_and_id ON namespaces USING btree (path, id) WHERE ((type)::text = 'Group'::text); CREATE INDEX index_historical_data_on_recorded_at ON historical_data USING btree (recorded_at); -CREATE UNIQUE INDEX index_http_integrations_on_active_and_project_and_endpoint ON alert_management_http_integrations USING btree (active, project_id, endpoint_identifier) WHERE active; +CREATE UNIQUE INDEX index_http_integrations_on_project_and_endpoint ON alert_management_http_integrations USING btree (project_id, endpoint_identifier); CREATE INDEX index_identities_on_saml_provider_id ON identities USING btree (saml_provider_id) WHERE (saml_provider_id IS NOT NULL); @@ -31449,6 +31618,10 @@ CREATE INDEX index_issues_on_moved_to_id ON issues USING btree (moved_to_id) WHE CREATE INDEX index_issues_on_namespace_id ON issues USING btree (namespace_id); +CREATE INDEX index_issues_on_project_health_status_asc_work_item_type ON issues USING btree (project_id, health_status, id DESC, state_id, work_item_type_id); + +CREATE INDEX index_issues_on_project_health_status_desc_work_item_type ON issues USING btree (project_id, health_status DESC NULLS LAST, id DESC, state_id, work_item_type_id); + CREATE INDEX index_issues_on_project_id_and_created_at_issue_type_incident ON issues USING btree (project_id, created_at) WHERE (issue_type = 1); CREATE UNIQUE INDEX index_issues_on_project_id_and_external_key ON issues USING btree (project_id, external_key) WHERE (external_key IS NOT NULL); @@ -31683,6 +31856,12 @@ CREATE INDEX index_merge_request_metrics_on_pipeline_id ON merge_request_metrics CREATE INDEX index_merge_request_metrics_on_target_project_id ON merge_request_metrics USING btree (target_project_id); +CREATE INDEX index_merge_request_review_llm_summaries_on_mr_diff_id ON merge_request_review_llm_summaries USING btree (merge_request_diff_id); + +CREATE INDEX index_merge_request_review_llm_summaries_on_review_id ON merge_request_review_llm_summaries USING btree (review_id); + +CREATE INDEX index_merge_request_review_llm_summaries_on_user_id ON merge_request_review_llm_summaries USING btree (user_id); + CREATE UNIQUE INDEX index_merge_request_reviewers_on_merge_request_id_and_user_id ON merge_request_reviewers USING btree (merge_request_id, user_id); CREATE INDEX index_merge_request_reviewers_on_user_id ON merge_request_reviewers USING btree (user_id); @@ -31805,12 +31984,26 @@ CREATE INDEX index_ml_candidates_on_user_id ON ml_candidates USING btree (user_i CREATE UNIQUE INDEX index_ml_experiment_metadata_on_experiment_id_and_name ON ml_experiment_metadata USING btree (experiment_id, name); +CREATE INDEX index_ml_experiments_on_model_id ON ml_experiments USING btree (model_id); + CREATE UNIQUE INDEX index_ml_experiments_on_project_id_and_iid ON ml_experiments USING btree (project_id, iid); CREATE UNIQUE INDEX index_ml_experiments_on_project_id_and_name ON ml_experiments USING btree (project_id, name); CREATE INDEX index_ml_experiments_on_user_id ON ml_experiments USING btree (user_id); +CREATE INDEX index_ml_model_versions_on_model_id ON ml_model_versions USING btree (model_id); + +CREATE INDEX index_ml_model_versions_on_package_id ON ml_model_versions USING btree (package_id); + +CREATE INDEX index_ml_model_versions_on_project_id ON ml_model_versions USING btree (project_id); + +CREATE UNIQUE INDEX index_ml_model_versions_on_project_id_and_model_id_and_version ON ml_model_versions USING btree (project_id, model_id, version); + +CREATE INDEX index_ml_models_on_project_id ON ml_models USING btree (project_id); + +CREATE UNIQUE INDEX index_ml_models_on_project_id_and_name ON ml_models USING btree (project_id, name); + CREATE UNIQUE INDEX index_mr_blocks_on_blocking_and_blocked_mr_ids ON merge_request_blocks USING btree (blocking_merge_request_id, blocked_merge_request_id); CREATE INDEX index_mr_cleanup_schedules_timestamps_status ON merge_request_cleanup_schedules USING btree (scheduled_at) WHERE ((completed_at IS NULL) AND (status = 0)); @@ -31853,6 +32046,8 @@ CREATE INDEX index_namespaces_on_ldap_sync_last_update_at ON namespaces USING bt CREATE INDEX index_namespaces_on_name_trigram ON namespaces USING gin (name gin_trgm_ops); +CREATE INDEX index_namespaces_on_organization_id ON namespaces USING btree (organization_id); + CREATE INDEX index_namespaces_on_owner_id ON namespaces USING btree (owner_id); CREATE UNIQUE INDEX index_namespaces_on_parent_id_and_id ON namespaces USING btree (parent_id, id); @@ -32043,6 +32238,10 @@ CREATE UNIQUE INDEX index_ops_feature_flags_issues_on_feature_flag_id_and_issue_ CREATE UNIQUE INDEX index_ops_strategies_user_lists_on_strategy_id_and_user_list_id ON operations_strategies_user_lists USING btree (strategy_id, user_list_id); +CREATE UNIQUE INDEX index_organization_users_on_organization_id_and_user_id ON organization_users USING btree (organization_id, user_id); + +CREATE INDEX index_organization_users_on_user_id ON organization_users USING btree (user_id); + CREATE UNIQUE INDEX index_organizations_on_unique_name_per_group ON customer_relations_organizations USING btree (group_id, lower(name), id); CREATE UNIQUE INDEX index_p_ci_job_annotations_on_partition_id_job_id_name ON ONLY p_ci_job_annotations USING btree (partition_id, job_id, name); @@ -32227,8 +32426,6 @@ CREATE INDEX index_pm_package_version_licenses_on_pm_package_version_id ON pm_pa CREATE INDEX index_pm_package_versions_on_pm_package_id ON pm_package_versions USING btree (pm_package_id); -CREATE UNIQUE INDEX index_pool_repositories_on_disk_path ON pool_repositories USING btree (disk_path); - CREATE INDEX index_pool_repositories_on_shard_id ON pool_repositories USING btree (shard_id); CREATE UNIQUE INDEX index_pool_repositories_on_source_project_id_and_shard_id ON pool_repositories USING btree (source_project_id, shard_id); @@ -32375,6 +32572,8 @@ CREATE INDEX index_project_topics_on_topic_id ON project_topics USING btree (top CREATE UNIQUE INDEX index_project_user_callouts_feature ON user_project_callouts USING btree (user_id, feature_name, project_id); +CREATE INDEX index_project_vulnerability_reads_common_finder_query_desc ON vulnerability_reads USING btree (project_id, state, report_type, severity DESC, vulnerability_id DESC); + CREATE UNIQUE INDEX index_project_wiki_repositories_on_project_id ON project_wiki_repositories USING btree (project_id); CREATE INDEX index_projects_aimed_for_deletion ON projects USING btree (marked_for_deletion_at) WHERE ((marked_for_deletion_at IS NOT NULL) AND (pending_delete = false)); @@ -32703,6 +32902,8 @@ CREATE UNIQUE INDEX index_sbom_sources_on_source_type_and_source ON sbom_sources CREATE INDEX index_scan_result_policies_on_policy_configuration_id ON scan_result_policies USING btree (security_orchestration_policy_configuration_id); +CREATE INDEX index_scan_result_policies_on_project_id ON scan_result_policies USING btree (project_id); + CREATE INDEX index_schema_inconsistencies_on_issue_id ON schema_inconsistencies USING btree (issue_id); CREATE INDEX index_scim_identities_on_group_id ON scim_identities USING btree (group_id); @@ -32885,6 +33086,8 @@ CREATE INDEX index_subscription_add_on_purchases_on_subscription_add_on_id ON su CREATE UNIQUE INDEX index_subscription_add_ons_on_name ON subscription_add_ons USING btree (name); +CREATE INDEX index_subscription_user_add_on_assignments_on_user_id ON subscription_user_add_on_assignments USING btree (user_id); + CREATE INDEX index_subscriptions_on_project_id ON subscriptions USING btree (project_id); CREATE UNIQUE INDEX index_subscriptions_on_subscribable_and_user_id_and_project_id ON subscriptions USING btree (subscribable_id, subscribable_type, user_id, project_id); @@ -32895,6 +33098,8 @@ CREATE INDEX index_successful_deployments_on_cluster_id_and_environment_id ON de CREATE UNIQUE INDEX index_suggestions_on_note_id_and_relative_order ON suggestions USING btree (note_id, relative_order); +CREATE UNIQUE INDEX index_system_access_microsoft_applications_on_namespace_id ON system_access_microsoft_applications USING btree (namespace_id); + CREATE UNIQUE INDEX index_system_note_metadata_on_description_version_id ON system_note_metadata USING btree (description_version_id) WHERE (description_version_id IS NOT NULL); CREATE UNIQUE INDEX index_system_note_metadata_on_note_id ON system_note_metadata USING btree (note_id); @@ -32981,10 +33186,6 @@ CREATE INDEX index_topics_total_projects_count ON topics USING btree (total_proj CREATE UNIQUE INDEX index_trending_projects_on_project_id ON trending_projects USING btree (project_id); -CREATE INDEX index_u2f_registrations_on_key_handle ON u2f_registrations USING btree (key_handle); - -CREATE INDEX index_u2f_registrations_on_user_id ON u2f_registrations USING btree (user_id); - CREATE UNIQUE INDEX index_uniq_ci_runners_on_token ON ci_runners USING btree (token); CREATE UNIQUE INDEX index_uniq_ci_runners_on_token_encrypted ON ci_runners USING btree (token_encrypted); @@ -33129,7 +33330,7 @@ CREATE INDEX index_users_on_state_and_user_type ON users USING btree (state, use CREATE UNIQUE INDEX index_users_on_static_object_token ON users USING btree (static_object_token); -CREATE INDEX index_users_on_unconfirmed_and_created_at_for_active_humans ON users USING btree (created_at, id) WHERE ((confirmed_at IS NULL) AND ((state)::text = 'active'::text) AND (user_type = 0)); +CREATE INDEX index_users_on_unconfirmed_created_at_active_type_sign_in_count ON users USING btree (created_at, id) WHERE ((confirmed_at IS NULL) AND ((state)::text = 'active'::text) AND (user_type = 0) AND (sign_in_count = 0)); CREATE INDEX index_users_on_unconfirmed_email ON users USING btree (unconfirmed_email) WHERE (unconfirmed_email IS NOT NULL); @@ -33177,6 +33378,8 @@ CREATE INDEX index_vulnerabilities_on_author_id ON vulnerabilities USING btree ( CREATE INDEX index_vulnerabilities_on_confirmed_by_id ON vulnerabilities USING btree (confirmed_by_id); +CREATE INDEX index_vulnerabilities_on_detected_at_and_id ON vulnerabilities USING btree (id, detected_at); + CREATE INDEX index_vulnerabilities_on_dismissed_by_id ON vulnerabilities USING btree (dismissed_by_id); CREATE INDEX index_vulnerabilities_on_due_date_sourcing_milestone_id ON vulnerabilities USING btree (due_date_sourcing_milestone_id); @@ -33297,6 +33500,8 @@ CREATE INDEX index_vulnerability_reads_on_scanner_id ON vulnerability_reads USIN CREATE UNIQUE INDEX index_vulnerability_reads_on_uuid ON vulnerability_reads USING btree (uuid); +CREATE INDEX index_vulnerability_reads_on_uuid_project_id_and_state ON vulnerability_reads USING btree (uuid, project_id, state); + CREATE UNIQUE INDEX index_vulnerability_reads_on_vulnerability_id ON vulnerability_reads USING btree (vulnerability_id); CREATE UNIQUE INDEX index_vulnerability_remediations_on_project_id_and_checksum ON vulnerability_remediations USING btree (project_id, checksum); @@ -33317,10 +33522,6 @@ CREATE UNIQUE INDEX index_vulnerability_statistics_on_unique_project_id ON vulne CREATE UNIQUE INDEX index_vulnerability_user_mentions_on_note_id ON vulnerability_user_mentions USING btree (note_id) WHERE (note_id IS NOT NULL); -CREATE INDEX index_vulnerable_component_versions_on_sbom_component_version ON sbom_vulnerable_component_versions USING btree (sbom_component_version_id); - -CREATE INDEX index_vulnerable_component_versions_on_vulnerability_advisory ON sbom_vulnerable_component_versions USING btree (vulnerability_advisory_id); - CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id ON vulnerability_user_mentions USING btree (vulnerability_id) WHERE (note_id IS NULL); CREATE UNIQUE INDEX index_vulns_user_mentions_on_vulnerability_id_and_note_id ON vulnerability_user_mentions USING btree (vulnerability_id, note_id); @@ -33503,28 +33704,22 @@ CREATE INDEX tmp_idx_for_vulnerability_feedback_migration ON vulnerability_feedb CREATE INDEX tmp_idx_packages_on_project_id_when_npm_not_pending_destruction ON packages_packages USING btree (project_id) WHERE ((package_type = 2) AND (status <> 4)); +CREATE INDEX tmp_idx_vuln_reads_where_dismissal_reason_null ON vulnerability_reads USING btree (id) WHERE ((state = 2) AND (dismissal_reason IS NULL)); + CREATE INDEX tmp_idx_vulnerability_occurrences_on_id_where_report_type_7_99 ON vulnerability_occurrences USING btree (id) WHERE (report_type = ANY (ARRAY[7, 99])); -CREATE INDEX tmp_index_ci_job_artifacts_on_expire_at_where_locked_unknown ON ci_job_artifacts USING btree (expire_at, job_id) WHERE ((locked = 2) AND (expire_at IS NOT NULL)); +CREATE INDEX tmp_idx_vulns_on_converted_uuid ON vulnerability_occurrences USING btree (id, uuid_convert_string_to_uuid) WHERE (uuid_convert_string_to_uuid = '00000000-0000-0000-0000-000000000000'::uuid); -CREATE INDEX tmp_index_ci_job_artifacts_on_id_expire_at_file_type_trace ON ci_job_artifacts USING btree (id) WHERE (((date_part('day'::text, timezone('UTC'::text, expire_at)) = ANY (ARRAY[(21)::double precision, (22)::double precision, (23)::double precision])) AND (date_part('minute'::text, timezone('UTC'::text, expire_at)) = ANY (ARRAY[(0)::double precision, (30)::double precision, (45)::double precision])) AND (date_part('second'::text, timezone('UTC'::text, expire_at)) = (0)::double precision)) OR (file_type = 3)); +CREATE INDEX tmp_index_ci_job_artifacts_on_expire_at_where_locked_unknown ON ci_job_artifacts USING btree (expire_at, job_id) WHERE ((locked = 2) AND (expire_at IS NOT NULL)); CREATE INDEX tmp_index_cis_vulnerability_reads_on_id ON vulnerability_reads USING btree (id) WHERE (report_type = 7); -CREATE INDEX tmp_index_container_repos_on_non_migrated ON container_repositories USING btree (project_id, id) WHERE (migration_state <> 'import_done'::text); - -CREATE INDEX tmp_index_container_repositories_on_id_migration_state ON container_repositories USING btree (id, migration_state); - -CREATE INDEX tmp_index_for_backfilling_resource_link_events ON system_note_metadata USING btree (id) WHERE (((action)::text = 'relate_to_parent'::text) OR ((action)::text = 'unrelate_from_parent'::text)); - CREATE INDEX tmp_index_for_null_member_namespace_id ON members USING btree (member_namespace_id) WHERE (member_namespace_id IS NULL); CREATE INDEX tmp_index_for_project_namespace_id_migration_on_routes ON routes USING btree (id) WHERE ((namespace_id IS NULL) AND ((source_type)::text = 'Project'::text)); CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (state = 2); -CREATE INDEX tmp_index_migrated_container_registries ON container_repositories USING btree (project_id) WHERE ((migration_state = 'import_done'::text) OR (created_at >= '2022-01-23 00:00:00'::timestamp without time zone)); - CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING btree (id) WHERE (state <> 2); CREATE INDEX tmp_index_project_statistics_cont_registry_size ON project_statistics USING btree (project_id) WHERE (container_registry_size = 0); @@ -33537,6 +33732,8 @@ CREATE UNIQUE INDEX u_project_compliance_standards_adherence_for_reporting ON pr CREATE UNIQUE INDEX uniq_idx_packages_packages_on_project_id_name_version_ml_model ON packages_packages USING btree (project_id, name, version) WHERE (package_type = 14); +CREATE UNIQUE INDEX uniq_idx_user_add_on_assignments_on_add_on_purchase_and_user ON subscription_user_add_on_assignments USING btree (add_on_purchase_id, user_id); + CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name); CREATE UNIQUE INDEX uniq_pkgs_deb_grp_components_on_distribution_id_and_name ON packages_debian_group_components USING btree (distribution_id, name); @@ -33555,6 +33752,8 @@ CREATE UNIQUE INDEX uniq_pkgs_debian_project_distributions_project_id_and_suite CREATE UNIQUE INDEX unique_ci_builds_token_encrypted_and_partition_id ON ci_builds USING btree (token_encrypted, partition_id) WHERE (token_encrypted IS NOT NULL); +CREATE UNIQUE INDEX unique_external_audit_event_destination_namespace_id_and_name ON audit_events_external_audit_event_destinations USING btree (namespace_id, name); + CREATE UNIQUE INDEX unique_google_cloud_logging_configurations_on_namespace_id ON audit_events_google_cloud_logging_configurations USING btree (namespace_id, google_project_id_name, log_id_name); CREATE UNIQUE INDEX unique_idx_namespaces_storage_limit_exclusions_on_namespace_id ON namespaces_storage_limit_exclusions USING btree (namespace_id); @@ -33565,6 +33764,10 @@ CREATE UNIQUE INDEX unique_index_for_project_pages_unique_domain ON project_sett CREATE UNIQUE INDEX unique_index_on_system_note_metadata_id ON resource_link_events USING btree (system_note_metadata_id); +CREATE UNIQUE INDEX unique_index_sysaccess_ms_access_tokens_on_sysaccess_ms_app_id ON system_access_microsoft_graph_access_tokens USING btree (system_access_microsoft_application_id); + +CREATE UNIQUE INDEX unique_instance_audit_event_destination_name ON audit_events_instance_external_audit_event_destinations USING btree (name); + CREATE UNIQUE INDEX unique_merge_request_diff_llm_summaries_on_mr_diff_id ON merge_request_diff_llm_summaries USING btree (merge_request_diff_id); CREATE UNIQUE INDEX unique_merge_request_metrics_by_merge_request_id ON merge_request_metrics USING btree (merge_request_id); @@ -33573,6 +33776,8 @@ CREATE UNIQUE INDEX unique_organizations_on_path ON organizations USING btree (p CREATE UNIQUE INDEX unique_packages_project_id_and_name_and_version_when_debian ON packages_packages USING btree (project_id, name, version) WHERE ((package_type = 9) AND (status <> 4)); +CREATE UNIQUE INDEX unique_pool_repositories_on_disk_path_and_shard_id ON pool_repositories USING btree (disk_path, shard_id); + CREATE UNIQUE INDEX unique_postgres_async_fk_validations_name_and_table_name ON postgres_async_foreign_key_validations USING btree (name, table_name); CREATE UNIQUE INDEX unique_projects_on_name_namespace_id ON projects USING btree (name, namespace_id); @@ -35077,20 +35282,22 @@ CREATE TRIGGER namespaces_loose_fk_trigger AFTER DELETE ON namespaces REFERENCIN CREATE TRIGGER nullify_merge_request_metrics_build_data_on_update BEFORE UPDATE ON merge_request_metrics FOR EACH ROW EXECUTE FUNCTION nullify_merge_request_metrics_build_data(); +CREATE TRIGGER organizations_loose_fk_trigger AFTER DELETE ON organizations REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); + CREATE TRIGGER p_ci_builds_loose_fk_trigger AFTER DELETE ON p_ci_builds REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); +CREATE TRIGGER prevent_delete_of_default_organization_before_destroy BEFORE DELETE ON organizations FOR EACH ROW EXECUTE FUNCTION prevent_delete_of_default_organization(); + CREATE TRIGGER projects_loose_fk_trigger AFTER DELETE ON projects REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); CREATE TRIGGER push_rules_loose_fk_trigger AFTER DELETE ON push_rules REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); CREATE TRIGGER tags_loose_fk_trigger AFTER DELETE ON tags REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); -CREATE TRIGGER trigger_023e82d8e257 BEFORE INSERT OR UPDATE ON ci_pipeline_variables FOR EACH ROW EXECUTE FUNCTION trigger_023e82d8e257(); - -CREATE TRIGGER trigger_080e73845bfd BEFORE INSERT OR UPDATE ON notes FOR EACH ROW EXECUTE FUNCTION trigger_080e73845bfd(); - CREATE TRIGGER trigger_1a857e8db6cd BEFORE INSERT OR UPDATE ON vulnerability_occurrences FOR EACH ROW EXECUTE FUNCTION trigger_1a857e8db6cd(); +CREATE TRIGGER trigger_7f3d66a7d7f5 BEFORE INSERT OR UPDATE ON ci_pipeline_variables FOR EACH ROW EXECUTE FUNCTION trigger_7f3d66a7d7f5(); + CREATE TRIGGER trigger_b2d852e1e2cb BEFORE INSERT OR UPDATE ON ci_pipelines FOR EACH ROW EXECUTE FUNCTION trigger_b2d852e1e2cb(); CREATE TRIGGER trigger_cd1aeb22b34a BEFORE INSERT OR UPDATE ON events FOR EACH ROW EXECUTE FUNCTION trigger_cd1aeb22b34a(); @@ -35202,6 +35409,9 @@ ALTER TABLE ONLY notification_settings ALTER TABLE ONLY lists ADD CONSTRAINT fk_0d3f677137 FOREIGN KEY (board_id) REFERENCES boards(id) ON DELETE CASCADE; +ALTER TABLE ONLY subscription_user_add_on_assignments + ADD CONSTRAINT fk_0d89020c49 FOREIGN KEY (add_on_purchase_id) REFERENCES subscription_add_on_purchases(id) ON DELETE CASCADE; + ALTER TABLE ONLY deployment_approvals ADD CONSTRAINT fk_0f58311058 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -35385,6 +35595,9 @@ ALTER TABLE ONLY incident_management_timeline_events ALTER TABLE ONLY bulk_import_exports ADD CONSTRAINT fk_39c726d3b5 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ml_model_versions + ADD CONSTRAINT fk_39f8aa0b8a FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE SET NULL; + ALTER TABLE p_ci_builds ADD CONSTRAINT fk_3a9eaa254d FOREIGN KEY (stage_id) REFERENCES ci_stages(id) ON DELETE CASCADE; @@ -35451,6 +35664,9 @@ ALTER TABLE ONLY sbom_occurrences ALTER TABLE ONLY namespace_commit_emails ADD CONSTRAINT fk_4d6ba63ba5 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY ml_model_versions + ADD CONSTRAINT fk_4e8b59e7a8 FOREIGN KEY (model_id) REFERENCES ml_models(id) ON DELETE CASCADE; + ALTER TABLE ONLY user_achievements ADD CONSTRAINT fk_4efde02858 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -35517,6 +35733,9 @@ ALTER TABLE ONLY user_achievements ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_6149611a04 FOREIGN KEY (assignee_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY merge_request_review_llm_summaries + ADD CONSTRAINT fk_6154a9cb89 FOREIGN KEY (review_id) REFERENCES reviews(id) ON DELETE CASCADE; + ALTER TABLE ONLY work_item_widget_definitions ADD CONSTRAINT fk_61bfa96db5 FOREIGN KEY (work_item_type_id) REFERENCES work_item_types(id) ON DELETE CASCADE; @@ -35571,6 +35790,9 @@ ALTER TABLE ONLY integrations ALTER TABLE ONLY user_interacted_projects ADD CONSTRAINT fk_722ceba4f7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY subscription_user_add_on_assignments + ADD CONSTRAINT fk_724c2df9a8 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_725465b774 FOREIGN KEY (dismissed_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -35607,6 +35829,9 @@ ALTER TABLE ONLY lists ALTER TABLE ONLY protected_branches ADD CONSTRAINT fk_7a9c6d93e7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY scan_result_policies + ADD CONSTRAINT fk_7aa24439f1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_7ac31eacb9 FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -35640,6 +35865,9 @@ ALTER TABLE ONLY import_export_uploads ALTER TABLE ONLY push_rules ADD CONSTRAINT fk_83b29894de FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY organization_users + ADD CONSTRAINT fk_8471abad75 FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_request_diffs ADD CONSTRAINT fk_8483f3258f FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; @@ -35673,21 +35901,24 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY ci_build_trace_chunks ADD CONSTRAINT fk_89e29fa5ee_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; -ALTER TABLE ONLY sbom_vulnerable_component_versions - ADD CONSTRAINT fk_8a2a1197f9 FOREIGN KEY (sbom_component_version_id) REFERENCES sbom_component_versions(id) ON DELETE CASCADE; - ALTER TABLE ONLY protected_branch_merge_access_levels ADD CONSTRAINT fk_8a3072ccb3 FOREIGN KEY (protected_branch_id) REFERENCES protected_branches(id) ON DELETE CASCADE; ALTER TABLE ONLY bulk_import_exports ADD CONSTRAINT fk_8c6f33cebe FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY organization_users + ADD CONSTRAINT fk_8d9b20725d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY releases ADD CONSTRAINT fk_8e4456f90f FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; ALTER TABLE ONLY protected_tags ADD CONSTRAINT fk_8e4af87648 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY merge_request_review_llm_summaries + ADD CONSTRAINT fk_8ec009c6ab FOREIGN KEY (merge_request_diff_id) REFERENCES merge_request_diffs(id) ON DELETE CASCADE; + ALTER TABLE ONLY todos ADD CONSTRAINT fk_91d1f47b13 FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; @@ -35875,7 +36106,7 @@ ALTER TABLE ONLY routes ADD CONSTRAINT fk_bb2e5b8968 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE p_ci_runner_machine_builds - ADD CONSTRAINT fk_bb490f12fe_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_bb490f12fe_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY namespace_bans ADD CONSTRAINT fk_bcc024eef2 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -35943,6 +36174,9 @@ ALTER TABLE ONLY agent_activity_events ALTER TABLE ONLY issue_links ADD CONSTRAINT fk_c900194ff2 FOREIGN KEY (source_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY personal_access_tokens + ADD CONSTRAINT fk_c951fbf57e FOREIGN KEY (previous_personal_access_token_id) REFERENCES personal_access_tokens(id) ON DELETE SET NULL; + ALTER TABLE ONLY jira_tracker_data ADD CONSTRAINT fk_c98abcd54c FOREIGN KEY (integration_id) REFERENCES integrations(id) ON DELETE CASCADE; @@ -35979,6 +36213,9 @@ ALTER TABLE ONLY custom_emoji ALTER TABLE ONLY bulk_import_entities ADD CONSTRAINT fk_d06d023c30 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY merge_request_review_llm_summaries + ADD CONSTRAINT fk_d07eeb6392 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_mirror_data ADD CONSTRAINT fk_d1aad367d7 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -36000,9 +36237,6 @@ ALTER TABLE ONLY lists ALTER TABLE ONLY agent_activity_events ADD CONSTRAINT fk_d6f785c9fc FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; -ALTER TABLE ONLY sbom_vulnerable_component_versions - ADD CONSTRAINT fk_d720a1959a FOREIGN KEY (vulnerability_advisory_id) REFERENCES vulnerability_advisories(id) ON DELETE CASCADE; - ALTER TABLE ONLY user_achievements ADD CONSTRAINT fk_d7653ef780 FOREIGN KEY (revoked_by_user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -36064,7 +36298,7 @@ ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT fk_e1bad85861 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; ALTER TABLE p_ci_builds_metadata - ADD CONSTRAINT fk_e20479742e_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_e20479742e_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY gitlab_subscriptions ADD CONSTRAINT fk_e2595d00a1 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -36195,6 +36429,12 @@ ALTER TABLE ONLY ml_candidate_metrics ALTER TABLE ONLY ml_candidate_params ADD CONSTRAINT fk_ml_candidate_params_on_candidate_id FOREIGN KEY (candidate_id) REFERENCES ml_candidates(id) ON DELETE CASCADE; +ALTER TABLE ONLY ml_candidates + ADD CONSTRAINT fk_ml_candidates_on_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + +ALTER TABLE ONLY ml_experiments + ADD CONSTRAINT fk_ml_experiments_on_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; + ALTER TABLE ONLY path_locks ADD CONSTRAINT fk_path_locks_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -36390,9 +36630,6 @@ ALTER TABLE ONLY vulnerability_user_mentions 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 ml_candidates - ADD CONSTRAINT fk_rails_1b37441fe5 FOREIGN KEY (user_id) REFERENCES users(id); - ALTER TABLE ONLY issuable_slas ADD CONSTRAINT fk_rails_1b8768cd63 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -36420,9 +36657,6 @@ ALTER TABLE ONLY geo_repository_created_events ALTER TABLE ONLY external_status_checks ADD CONSTRAINT fk_rails_1f5a8aa809 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY ml_experiments - ADD CONSTRAINT fk_rails_1fbc5e001f FOREIGN KEY (user_id) REFERENCES users(id); - ALTER TABLE ONLY dora_daily_metrics ADD CONSTRAINT fk_rails_1fd07aff6f FOREIGN KEY (environment_id) REFERENCES environments(id) ON DELETE CASCADE; @@ -36756,6 +36990,9 @@ ALTER TABLE ONLY project_repository_storage_moves ALTER TABLE ONLY ml_candidate_metadata ADD CONSTRAINT fk_rails_5117dddf22 FOREIGN KEY (candidate_id) REFERENCES ml_candidates(id) ON DELETE CASCADE; +ALTER TABLE ONLY ml_models + ADD CONSTRAINT fk_rails_51e87f7c50 FOREIGN KEY (project_id) REFERENCES projects(id); + ALTER TABLE ONLY elastic_group_index_statuses ADD CONSTRAINT fk_rails_52b9969b12 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -36846,6 +37083,9 @@ ALTER TABLE ONLY incident_management_oncall_participants ALTER TABLE ONLY work_item_parent_links ADD CONSTRAINT fk_rails_601d5bec3a FOREIGN KEY (work_item_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY system_access_microsoft_graph_access_tokens + ADD CONSTRAINT fk_rails_604908851f FOREIGN KEY (system_access_microsoft_application_id) REFERENCES system_access_microsoft_applications(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerability_state_transitions ADD CONSTRAINT fk_rails_60e4899648 FOREIGN KEY (vulnerability_id) REFERENCES vulnerabilities(id) ON DELETE CASCADE; @@ -37068,6 +37308,9 @@ ALTER TABLE ONLY required_code_owners_sections ALTER TABLE ONLY namespace_ldap_settings ADD CONSTRAINT fk_rails_82cd0ad4bb FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; +ALTER TABLE ONLY group_wiki_repository_states + ADD CONSTRAINT fk_rails_832511c9f1 FOREIGN KEY (group_wiki_repository_id) REFERENCES group_wiki_repositories(group_id) ON DELETE CASCADE; + ALTER TABLE ONLY cluster_enabled_grants ADD CONSTRAINT fk_rails_8336ce35af FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -37116,6 +37359,9 @@ ALTER TABLE ONLY achievements ALTER TABLE ONLY protected_environment_deploy_access_levels ADD CONSTRAINT fk_rails_898a13b650 FOREIGN KEY (protected_environment_id) REFERENCES protected_environments(id) ON DELETE CASCADE; +ALTER TABLE ONLY ml_model_versions + ADD CONSTRAINT fk_rails_8a481bd22e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY snippet_repositories ADD CONSTRAINT fk_rails_8afd7e2f71 FOREIGN KEY (snippet_id) REFERENCES snippets(id) ON DELETE CASCADE; @@ -37212,6 +37458,9 @@ ALTER TABLE ONLY boards_epic_board_recent_visits ALTER TABLE ONLY packages_dependency_links ADD CONSTRAINT fk_rails_96ef1c00d3 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY ml_experiments + ADD CONSTRAINT fk_rails_97194a054e FOREIGN KEY (model_id) REFERENCES ml_models(id) ON DELETE CASCADE; + ALTER TABLE ONLY group_repository_storage_moves ADD CONSTRAINT fk_rails_982bb5daf1 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -37531,7 +37780,13 @@ ALTER TABLE ONLY boards_epic_board_recent_visits ADD CONSTRAINT fk_rails_c4dcba4a3e FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_job_artifacts - ADD CONSTRAINT fk_rails_c5137cb2c1_p FOREIGN KEY (partition_id, job_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_rails_c5137cb2c1_p FOREIGN KEY (partition_id, job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + +ALTER TABLE ONLY organization_settings + ADD CONSTRAINT fk_rails_c56e4690c0 FOREIGN KEY (organization_id) REFERENCES organizations(id) ON DELETE CASCADE; + +ALTER TABLE ONLY system_access_microsoft_applications + ADD CONSTRAINT fk_rails_c5b7765d04 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; ALTER TABLE ONLY project_settings ADD CONSTRAINT fk_rails_c6df6e6328 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -37645,7 +37900,7 @@ ALTER TABLE ONLY merge_request_reviewers ADD CONSTRAINT fk_rails_d9fec24b9d FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_running_builds - ADD CONSTRAINT fk_rails_da45cfa165_p FOREIGN KEY (partition_id, build_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_rails_da45cfa165_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY resource_link_events ADD CONSTRAINT fk_rails_da5dd8a56f FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -37897,7 +38152,7 @@ ALTER TABLE ONLY board_project_recent_visits ADD CONSTRAINT fk_rails_fb6fc419cb FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_job_variables - ADD CONSTRAINT fk_rails_fbf3b34792_p FOREIGN KEY (partition_id, job_id) REFERENCES ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; + ADD CONSTRAINT fk_rails_fbf3b34792_p FOREIGN KEY (partition_id, job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE; ALTER TABLE ONLY packages_nuget_metadata ADD CONSTRAINT fk_rails_fc0c19f5b4 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; @@ -37938,9 +38193,6 @@ ALTER TABLE ONLY timelogs ALTER TABLE ONLY timelogs ADD CONSTRAINT fk_timelogs_note_id FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE SET NULL; -ALTER TABLE ONLY u2f_registrations - ADD CONSTRAINT fk_u2f_registrations_user_id FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; - ALTER TABLE issue_search_data ADD CONSTRAINT issue_search_data_issue_id_fkey FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; @@ -37950,18 +38202,6 @@ ALTER TABLE issue_search_data ALTER TABLE product_analytics_events_experimental ADD CONSTRAINT product_analytics_events_experimental_project_id_fkey FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; -ALTER TABLE ONLY ci_builds_metadata - ADD CONSTRAINT temp_fk_e20479742e_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID; - -ALTER TABLE ONLY ci_job_artifacts - ADD CONSTRAINT temp_fk_rails_c5137cb2c1_p FOREIGN KEY (partition_id, job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID; - -ALTER TABLE ONLY ci_running_builds - ADD CONSTRAINT temp_fk_rails_da45cfa165_p FOREIGN KEY (partition_id, build_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID; - -ALTER TABLE ONLY ci_job_variables - ADD CONSTRAINT temp_fk_rails_fbf3b34792_p FOREIGN KEY (partition_id, job_id) REFERENCES p_ci_builds(partition_id, id) ON UPDATE CASCADE ON DELETE CASCADE NOT VALID; - ALTER TABLE ONLY user_follow_users ADD CONSTRAINT user_follow_users_followee_id_fkey FOREIGN KEY (followee_id) REFERENCES users(id) ON DELETE CASCADE; diff --git a/db/migrate/20230522162742_cleanup_bigint_conversion_for_merge_request_metrics_for_self_hosts.rb b/db/migrate/20230522162742_cleanup_bigint_conversion_for_merge_request_metrics_for_self_hosts.rb deleted file mode 100644 index 5e56f8486f1ef5867161893951f432ffcef55361..0000000000000000000000000000000000000000 --- a/db/migrate/20230522162742_cleanup_bigint_conversion_for_merge_request_metrics_for_self_hosts.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class CleanupBigintConversionForMergeRequestMetricsForSelfHosts < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::ConvertToBigint - - enable_lock_retries! - - TABLE = :merge_request_metrics - - def up - return if should_skip? - return unless column_exists?(TABLE, :id_convert_to_bigint) - - # rubocop:disable Migration/WithLockRetriesDisallowedMethod - with_lock_retries do - cleanup_conversion_of_integer_to_bigint(TABLE, :id) - end - # rubocop:enable Migration/WithLockRetriesDisallowedMethod - end - - def down - return if should_skip? - return if column_exists?(TABLE, :id_convert_to_bigint) - - restore_conversion_of_integer_to_bigint(TABLE, :id) - end - - def should_skip? - com_or_dev_or_test_but_not_jh? - end -end diff --git a/db/migrate/20230605125735_add_tracking_columns_to_namespace_limits.rb b/db/migrate/20230605125735_add_tracking_columns_to_namespace_limits.rb deleted file mode 100644 index 68f75ddf7672f2202f23e2ba3ed7f754da46cbb6..0000000000000000000000000000000000000000 --- a/db/migrate/20230605125735_add_tracking_columns_to_namespace_limits.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class AddTrackingColumnsToNamespaceLimits < Gitlab::Database::Migration[2.1] - def change - add_column :namespace_limits, :pre_enforcement_notification_at, :datetime_with_timezone - add_column :namespace_limits, :first_enforced_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20230607124754_create_organization_settings.rb b/db/migrate/20230607124754_create_organization_settings.rb deleted file mode 100644 index 15d3fa3159fbd9e06416f9dd0502b1b6ccc8fa56..0000000000000000000000000000000000000000 --- a/db/migrate/20230607124754_create_organization_settings.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class CreateOrganizationSettings < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def change - create_table :organization_settings, id: false do |t| - t.references :organization, primary_key: true, default: nil, index: false, foreign_key: { on_delete: :cascade } - t.timestamps_with_timezone null: false - t.jsonb :settings, default: {}, null: false - end - end -end diff --git a/db/migrate/20230608113106_create_organization_users.rb b/db/migrate/20230608113106_create_organization_users.rb deleted file mode 100644 index 305765bc9df955af641260758bfd36069abc2660..0000000000000000000000000000000000000000 --- a/db/migrate/20230608113106_create_organization_users.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class CreateOrganizationUsers < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def up - create_table :organization_users do |t| - t.bigint :organization_id, - null: false - t.bigint :user_id, - null: false, - index: true - t.timestamps_with_timezone null: false - t.index 'organization_id, user_id', - name: 'index_organization_users_on_organization_id_and_user_id', unique: true - end - end - - def down - drop_table :organization_users - end -end diff --git a/db/migrate/20230609065641_initialize_conversion_of_ci_pipeline_variables_pipeline_id.rb b/db/migrate/20230609065641_initialize_conversion_of_ci_pipeline_variables_pipeline_id.rb deleted file mode 100644 index 09dfda688518a596a41309029d3eb55f233387ae..0000000000000000000000000000000000000000 --- a/db/migrate/20230609065641_initialize_conversion_of_ci_pipeline_variables_pipeline_id.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class InitializeConversionOfCiPipelineVariablesPipelineId < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - TABLE = :ci_pipeline_variables - COLUMNS = %i[pipeline_id] - - def up - initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - revert_initialize_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end -end diff --git a/db/migrate/20230612074428_add_name_to_external_audit_event_destination.rb b/db/migrate/20230612074428_add_name_to_external_audit_event_destination.rb deleted file mode 100644 index 4fe61c4caad98b207c05fecb28b115f13c4b7793..0000000000000000000000000000000000000000 --- a/db/migrate/20230612074428_add_name_to_external_audit_event_destination.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddNameToExternalAuditEventDestination < Gitlab::Database::Migration[2.1] - # rubocop:disable Migration/AddLimitToTextColumns - # text limit is added in a 20230612091526_add_text_limit_to_external_audit_event_destination_name.rb migration - def change - add_column :audit_events_external_audit_event_destinations, :name, :text - end - - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20230612091526_add_text_limit_to_external_audit_event_destination_name.rb b/db/migrate/20230612091526_add_text_limit_to_external_audit_event_destination_name.rb deleted file mode 100644 index d469c7cc96412aeec4042a9cdad4ff016a535eb9..0000000000000000000000000000000000000000 --- a/db/migrate/20230612091526_add_text_limit_to_external_audit_event_destination_name.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToExternalAuditEventDestinationName < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_text_limit :audit_events_external_audit_event_destinations, :name, 72 - end - - def down - remove_text_limit :audit_events_external_audit_event_destinations, :name - end -end diff --git a/db/migrate/20230612091747_add_name_to_instance_audit_event_destination.rb b/db/migrate/20230612091747_add_name_to_instance_audit_event_destination.rb deleted file mode 100644 index 7a99654bd66de65bcccdd38f3b79b9c3f57d51c3..0000000000000000000000000000000000000000 --- a/db/migrate/20230612091747_add_name_to_instance_audit_event_destination.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddNameToInstanceAuditEventDestination < Gitlab::Database::Migration[2.1] - # rubocop:disable Migration/AddLimitToTextColumns - # text limit is added in a 20230612091910_add_text_limit_to_instance_audit_event_destination_name.rb migration - def change - add_column :audit_events_instance_external_audit_event_destinations, :name, :text - end - - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20230612091910_add_text_limit_to_instance_audit_event_destination_name.rb b/db/migrate/20230612091910_add_text_limit_to_instance_audit_event_destination_name.rb deleted file mode 100644 index 0bdfd4baff717acae2e305782900d4018f8e6f10..0000000000000000000000000000000000000000 --- a/db/migrate/20230612091910_add_text_limit_to_instance_audit_event_destination_name.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToInstanceAuditEventDestinationName < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_text_limit :audit_events_instance_external_audit_event_destinations, :name, 72 - end - - def down - remove_text_limit :audit_events_instance_external_audit_event_destinations, :name - end -end diff --git a/db/migrate/20230613122211_add_vulnerability_attributes_to_scan_result_policies.rb b/db/migrate/20230613122211_add_vulnerability_attributes_to_scan_result_policies.rb deleted file mode 100644 index c3467efe4afcccd018123a017088b01a832532bd..0000000000000000000000000000000000000000 --- a/db/migrate/20230613122211_add_vulnerability_attributes_to_scan_result_policies.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddVulnerabilityAttributesToScanResultPolicies < Gitlab::Database::Migration[2.1] - def change - add_column :scan_result_policies, :vulnerability_attributes, :jsonb, default: {} - end -end diff --git a/db/migrate/20230614180651_add_organization_id_to_namespaces.rb b/db/migrate/20230614180651_add_organization_id_to_namespaces.rb deleted file mode 100644 index 6a0048b5fc34fe3566fd3e5f4ff70e44dc12bf00..0000000000000000000000000000000000000000 --- a/db/migrate/20230614180651_add_organization_id_to_namespaces.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddOrganizationIdToNamespaces < Gitlab::Database::Migration[2.1] - DEFAULT_ORGANIZATION_ID = 1 - - enable_lock_retries! - - def up - # This column already exists on some environments and it was reverted - # in MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122809 - return if column_exists?(:namespaces, :organization_id) - - add_column :namespaces, :organization_id, :bigint, default: DEFAULT_ORGANIZATION_ID, null: true # rubocop:disable Migration/AddColumnsToWideTables - end - - def down - remove_column :namespaces, :organization_id - end -end diff --git a/db/migrate/20230615074515_add_index_to_audit_event_external_destination.rb b/db/migrate/20230615074515_add_index_to_audit_event_external_destination.rb deleted file mode 100644 index b1846c8abedf40d4540be284252de658d12018dd..0000000000000000000000000000000000000000 --- a/db/migrate/20230615074515_add_index_to_audit_event_external_destination.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToAuditEventExternalDestination < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'unique_external_audit_event_destination_namespace_id_and_name' - - def up - add_concurrent_index :audit_events_external_audit_event_destinations, [:namespace_id, :name], unique: true, - name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :audit_events_external_audit_event_destinations, INDEX_NAME - end -end diff --git a/db/migrate/20230615074544_add_index_to_instance_audit_event_destination.rb b/db/migrate/20230615074544_add_index_to_instance_audit_event_destination.rb deleted file mode 100644 index 4e14bb537a334fa0d39fc02b776b2725f251f641..0000000000000000000000000000000000000000 --- a/db/migrate/20230615074544_add_index_to_instance_audit_event_destination.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToInstanceAuditEventDestination < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'unique_instance_audit_event_destination_name' - - def up - add_concurrent_index :audit_events_instance_external_audit_event_destinations, :name, unique: true, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :audit_events_instance_external_audit_event_destinations, INDEX_NAME - end -end diff --git a/db/migrate/20230615104902_add_user_id_foreign_key_to_organization_users.rb b/db/migrate/20230615104902_add_user_id_foreign_key_to_organization_users.rb deleted file mode 100644 index 0f8d18ee384c45cde78b82da70d067cf6963f684..0000000000000000000000000000000000000000 --- a/db/migrate/20230615104902_add_user_id_foreign_key_to_organization_users.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddUserIdForeignKeyToOrganizationUsers < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :organization_users, :users, column: :user_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :organization_users, column: :user_id - end - end -end diff --git a/db/migrate/20230616164309_create_subscription_user_add_on_assignments.rb b/db/migrate/20230616164309_create_subscription_user_add_on_assignments.rb deleted file mode 100644 index cb184cd1987d229c9c3f1ac31738830d887c5194..0000000000000000000000000000000000000000 --- a/db/migrate/20230616164309_create_subscription_user_add_on_assignments.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CreateSubscriptionUserAddOnAssignments < Gitlab::Database::Migration[2.1] - UNIQUE_INDEX_NAME = 'uniq_idx_user_add_on_assignments_on_add_on_purchase_and_user' - - def change - create_table :subscription_user_add_on_assignments do |t| - t.bigint :add_on_purchase_id, null: false - t.bigint :user_id, null: false - - t.timestamps_with_timezone null: false - - t.index [:add_on_purchase_id, :user_id], unique: true, name: UNIQUE_INDEX_NAME - t.index :user_id - end - end -end diff --git a/db/migrate/20230616164705_add_foreign_key_add_on_purchase_id_on_subscription_user_add_on_assignments.rb b/db/migrate/20230616164705_add_foreign_key_add_on_purchase_id_on_subscription_user_add_on_assignments.rb deleted file mode 100644 index d0d89bd5027cac0c570b971e90d36716ca6f8e5c..0000000000000000000000000000000000000000 --- a/db/migrate/20230616164705_add_foreign_key_add_on_purchase_id_on_subscription_user_add_on_assignments.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyAddOnPurchaseIdOnSubscriptionUserAddOnAssignments < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :subscription_user_add_on_assignments, :subscription_add_on_purchases, - column: :add_on_purchase_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :subscription_user_add_on_assignments, column: :add_on_purchase_id - end - end -end diff --git a/db/migrate/20230616164731_add_foreign_key_user_id_on_subscription_user_add_on_assignments.rb b/db/migrate/20230616164731_add_foreign_key_user_id_on_subscription_user_add_on_assignments.rb deleted file mode 100644 index a28c798deec4e7adbe6267c60e540cbda17ed5f6..0000000000000000000000000000000000000000 --- a/db/migrate/20230616164731_add_foreign_key_user_id_on_subscription_user_add_on_assignments.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddForeignKeyUserIdOnSubscriptionUserAddOnAssignments < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :subscription_user_add_on_assignments, :users, column: :user_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :subscription_user_add_on_assignments, column: :user_id - end - end -end diff --git a/db/migrate/20230616200440_create_system_access_microsoft_application.rb b/db/migrate/20230616200440_create_system_access_microsoft_application.rb deleted file mode 100644 index d58dd8f88d9d52a29369d6a40d74dd272e16d1c1..0000000000000000000000000000000000000000 --- a/db/migrate/20230616200440_create_system_access_microsoft_application.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateSystemAccessMicrosoftApplication < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def change - create_table :system_access_microsoft_applications do |t| - t.timestamps_with_timezone null: false - t.references :namespace, index: { unique: true }, foreign_key: { on_delete: :cascade } - t.boolean :enabled, null: false, default: false - t.text :tenant_xid, null: false, limit: 255 - t.text :client_xid, null: false, limit: 255 - t.text :login_endpoint, null: false, limit: 255, default: 'https://login.microsoftonline.com' - t.text :graph_endpoint, null: false, limit: 255, default: 'https://graph.microsoft.com' - t.binary :encrypted_client_secret, null: false - t.binary :encrypted_client_secret_iv, null: false - end - end -end diff --git a/db/migrate/20230616214220_create_system_access_microsoft_graph_access_tokens.rb b/db/migrate/20230616214220_create_system_access_microsoft_graph_access_tokens.rb deleted file mode 100644 index df196280d0ce60b3b2060a81aa32378024a791ea..0000000000000000000000000000000000000000 --- a/db/migrate/20230616214220_create_system_access_microsoft_graph_access_tokens.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class CreateSystemAccessMicrosoftGraphAccessTokens < Gitlab::Database::Migration[2.1] - def change - create_table :system_access_microsoft_graph_access_tokens do |t| - t.timestamps_with_timezone null: false - t.references :system_access_microsoft_application, - index: { name: 'unique_index_sysaccess_ms_access_tokens_on_sysaccess_ms_app_id', unique: true }, - foreign_key: { on_delete: :cascade } - t.integer :expires_in, null: false - t.binary :encrypted_token, null: false - t.binary :encrypted_token_iv, null: false - end - end -end diff --git a/db/migrate/20230620101808_change_default_value_for_distro_version.rb b/db/migrate/20230620101808_change_default_value_for_distro_version.rb deleted file mode 100644 index f0da7cfaba7897e97be52189ab79c60d34121a03..0000000000000000000000000000000000000000 --- a/db/migrate/20230620101808_change_default_value_for_distro_version.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class ChangeDefaultValueForDistroVersion < Gitlab::Database::Migration[2.1] - def up - change_column_default :pm_affected_packages, :distro_version, from: nil, to: '' - change_column_null :pm_affected_packages, :distro_version, false - end - - def down - change_column_default :pm_affected_packages, :distro_version, from: '', to: nil - change_column_null :pm_affected_packages, :distro_version, true - end -end diff --git a/db/migrate/20230620104217_add_organization_id_foreign_key_to_organization_users.rb b/db/migrate/20230620104217_add_organization_id_foreign_key_to_organization_users.rb deleted file mode 100644 index 0a9757d2e14014753565a438a83add8d35330c4e..0000000000000000000000000000000000000000 --- a/db/migrate/20230620104217_add_organization_id_foreign_key_to_organization_users.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddOrganizationIdForeignKeyToOrganizationUsers < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :organization_users, :organizations, column: :organization_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :organization_users, column: :organization_id - end - end -end diff --git a/db/migrate/20230621065943_add_elasticsearch_requeue_workers_to_application_settings.rb b/db/migrate/20230621065943_add_elasticsearch_requeue_workers_to_application_settings.rb deleted file mode 100644 index 2297cc5cdc259f46c467790a12b51839dc73e8a5..0000000000000000000000000000000000000000 --- a/db/migrate/20230621065943_add_elasticsearch_requeue_workers_to_application_settings.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddElasticsearchRequeueWorkersToApplicationSettings < Gitlab::Database::Migration[2.1] - def change - add_column :application_settings, :elasticsearch_requeue_workers, :boolean, null: false, default: false - end -end diff --git a/db/migrate/20230621070810_update_requeue_workers_in_application_settings_for_gitlab_com.rb b/db/migrate/20230621070810_update_requeue_workers_in_application_settings_for_gitlab_com.rb deleted file mode 100644 index 9ed9af7106631b4b762273a23996ca343b8ac6a3..0000000000000000000000000000000000000000 --- a/db/migrate/20230621070810_update_requeue_workers_in_application_settings_for_gitlab_com.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class UpdateRequeueWorkersInApplicationSettingsForGitlabCom < Gitlab::Database::Migration[2.1] - restrict_gitlab_migration gitlab_schema: :gitlab_main - - def up - return unless Gitlab.com? - - execute 'UPDATE application_settings SET elasticsearch_requeue_workers = true' - end - - def down - return unless Gitlab.com? - - execute 'UPDATE application_settings SET elasticsearch_requeue_workers = false' - end -end diff --git a/db/migrate/20230621072726_add_description_to_ci_variable.rb b/db/migrate/20230621072726_add_description_to_ci_variable.rb deleted file mode 100644 index c14afca60bb96a0ce19455dd5d0293c298efcd4e..0000000000000000000000000000000000000000 --- a/db/migrate/20230621072726_add_description_to_ci_variable.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class AddDescriptionToCiVariable < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - # rubocop:disable Migration/AddLimitToTextColumns - # text limit is added in a 20230621072848_add_text_limit_to_ci_variable_description.rb migration - def change - add_column(:ci_variables, :description, :text) - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20230621074446_add_elasticsearch_number_of_shards_to_application_settings.rb b/db/migrate/20230621074446_add_elasticsearch_number_of_shards_to_application_settings.rb deleted file mode 100644 index 6eed0f8cf152b97360ccd7bd19f5f071a1c4313c..0000000000000000000000000000000000000000 --- a/db/migrate/20230621074446_add_elasticsearch_number_of_shards_to_application_settings.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddElasticsearchNumberOfShardsToApplicationSettings < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def change - add_column :application_settings, :elasticsearch_worker_number_of_shards, :integer, null: false, default: 2 - end -end diff --git a/db/migrate/20230621074611_update_elasticsearch_number_of_shards_in_application_settings_for_gitlab_com.rb b/db/migrate/20230621074611_update_elasticsearch_number_of_shards_in_application_settings_for_gitlab_com.rb deleted file mode 100644 index 666d4a2e096439091d1edbf1f495bcc35ffd02a4..0000000000000000000000000000000000000000 --- a/db/migrate/20230621074611_update_elasticsearch_number_of_shards_in_application_settings_for_gitlab_com.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class UpdateElasticsearchNumberOfShardsInApplicationSettingsForGitlabCom < Gitlab::Database::Migration[2.1] - restrict_gitlab_migration gitlab_schema: :gitlab_main - - enable_lock_retries! - - def up - return unless Gitlab.com? - - execute 'UPDATE application_settings SET elasticsearch_worker_number_of_shards = 16' - end - - def down - return unless Gitlab.com? - - execute 'UPDATE application_settings SET elasticsearch_worker_number_of_shards = 2' - end -end diff --git a/db/migrate/20230621083004_add_description_to_ci_group_variable.rb b/db/migrate/20230621083004_add_description_to_ci_group_variable.rb deleted file mode 100644 index 933c4079c4c74ad153ec020e14e18791059f39df..0000000000000000000000000000000000000000 --- a/db/migrate/20230621083004_add_description_to_ci_group_variable.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class AddDescriptionToCiGroupVariable < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - # rubocop:disable Migration/AddLimitToTextColumns - # text limit is added in a 20230621083052_add_text_limit_to_ci_group_variable_description.rb migration - def change - add_column(:ci_group_variables, :description, :text) - end - # rubocop:enable Migration/AddLimitToTextColumns -end diff --git a/db/migrate/20230622044119_create_merge_request_review_llm_summary.rb b/db/migrate/20230622044119_create_merge_request_review_llm_summary.rb deleted file mode 100644 index 19b9cf27d90b8fc24e7267becac76a0d947d28f7..0000000000000000000000000000000000000000 --- a/db/migrate/20230622044119_create_merge_request_review_llm_summary.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class CreateMergeRequestReviewLlmSummary < Gitlab::Database::Migration[2.1] - INDEX_NAME = "index_merge_request_review_llm_summaries_on_mr_diff_id" - - def change - create_table :merge_request_review_llm_summaries do |t| - t.references :user, null: true, index: true - t.references :review, null: false, index: true - t.references :merge_request_diff, null: false, index: { name: INDEX_NAME } - t.timestamps_with_timezone null: false - t.integer :provider, null: false, limit: 2 - t.text :content, null: false, limit: 2056 - end - end -end diff --git a/db/migrate/20230622051925_add_user_foreign_key_to_merge_request_review_llm_summary.rb b/db/migrate/20230622051925_add_user_foreign_key_to_merge_request_review_llm_summary.rb deleted file mode 100644 index 1fa19317913d66e7aa90409da11f31d752104100..0000000000000000000000000000000000000000 --- a/db/migrate/20230622051925_add_user_foreign_key_to_merge_request_review_llm_summary.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddUserForeignKeyToMergeRequestReviewLlmSummary < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :merge_request_review_llm_summaries, :users, column: :user_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :merge_request_review_llm_summaries, column: :user_id - end - end -end diff --git a/db/migrate/20230622051943_add_review_foreign_key_to_merge_request_review_llm_summary.rb b/db/migrate/20230622051943_add_review_foreign_key_to_merge_request_review_llm_summary.rb deleted file mode 100644 index ec4eb6b3f91d6d1f0f7abe78bde39cfad00a2237..0000000000000000000000000000000000000000 --- a/db/migrate/20230622051943_add_review_foreign_key_to_merge_request_review_llm_summary.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddReviewForeignKeyToMergeRequestReviewLlmSummary < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :merge_request_review_llm_summaries, :reviews, column: :review_id, on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :merge_request_review_llm_summaries, column: :review_id - end - end -end diff --git a/db/migrate/20230622052015_add_merge_request_diff_foreign_key_to_merge_request_review_llm_summary.rb b/db/migrate/20230622052015_add_merge_request_diff_foreign_key_to_merge_request_review_llm_summary.rb deleted file mode 100644 index f5409aa48e908d399ef6e5b9e0563087cd3f0d68..0000000000000000000000000000000000000000 --- a/db/migrate/20230622052015_add_merge_request_diff_foreign_key_to_merge_request_review_llm_summary.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddMergeRequestDiffForeignKeyToMergeRequestReviewLlmSummary < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :merge_request_review_llm_summaries, :merge_request_diffs, - column: :merge_request_diff_id, - on_delete: :cascade - end - - def down - with_lock_retries do - remove_foreign_key :merge_request_review_llm_summaries, column: :merge_request_diff_id - end - end -end diff --git a/db/migrate/20230622093921_remove_deprecated_metric_worker_instances.rb b/db/migrate/20230622093921_remove_deprecated_metric_worker_instances.rb deleted file mode 100644 index ac2bc02ec3f28b2c3c3db66445ce7c9e9df95799..0000000000000000000000000000000000000000 --- a/db/migrate/20230622093921_remove_deprecated_metric_worker_instances.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class RemoveDeprecatedMetricWorkerInstances < Gitlab::Database::Migration[2.1] - DEPRECATED_JOB_CLASSES = %w[ - Clusters::Integrations::CheckPrometheusHealthWorker - Metrics::Dashboard::PruneOldAnnotationsWorker - Metrics::Dashboard::ScheduleAnnotationsPruneWorker - Metrics::Dashboard::SyncDashboardsWorker - ] - - disable_ddl_transaction! - - def up - sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES) - end - - def down - # This migration removes any instances of deprecated workers and cannot be undone. - end -end diff --git a/db/migrate/20230626065725_backfill_instance_audit_event_name.rb b/db/migrate/20230626065725_backfill_instance_audit_event_name.rb deleted file mode 100644 index ac3c617d26127d9a0da5b37986495996cdb071fe..0000000000000000000000000000000000000000 --- a/db/migrate/20230626065725_backfill_instance_audit_event_name.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class BackfillInstanceAuditEventName < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - restrict_gitlab_migration gitlab_schema: :gitlab_main - - class InstanceDestination < MigrationRecord - self.table_name = 'audit_events_instance_external_audit_event_destinations' - end - - def change - InstanceDestination.update_all("name = 'Destination ' || id") - end -end diff --git a/db/migrate/20230626065755_backfill_external_audit_event_name.rb b/db/migrate/20230626065755_backfill_external_audit_event_name.rb deleted file mode 100644 index 1c983e802d876d4e493f5461f8d023e031b92325..0000000000000000000000000000000000000000 --- a/db/migrate/20230626065755_backfill_external_audit_event_name.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class BackfillExternalAuditEventName < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - restrict_gitlab_migration gitlab_schema: :gitlab_main - - class ExternalDestination < MigrationRecord - self.table_name = 'audit_events_external_audit_event_destinations' - end - - def change - ExternalDestination.update_all("name = 'Destination ' || id") - end -end diff --git a/db/migrate/20230626070959_add_not_null_to_external_audit_event.rb b/db/migrate/20230626070959_add_not_null_to_external_audit_event.rb deleted file mode 100644 index e6d75c1dc6868c43337566d9b412b4670503d235..0000000000000000000000000000000000000000 --- a/db/migrate/20230626070959_add_not_null_to_external_audit_event.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddNotNullToExternalAuditEvent < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - change_column_null :audit_events_external_audit_event_destinations, :name, false - end - - def down - change_column_null :audit_events_external_audit_event_destinations, :name, true - end -end diff --git a/db/migrate/20230626071100_add_not_null_to_instance_audit_event.rb b/db/migrate/20230626071100_add_not_null_to_instance_audit_event.rb deleted file mode 100644 index 6a67dcf1a244fb4ca89856ab66e60ae0ce9080bc..0000000000000000000000000000000000000000 --- a/db/migrate/20230626071100_add_not_null_to_instance_audit_event.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddNotNullToInstanceAuditEvent < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - change_column_null :audit_events_instance_external_audit_event_destinations, :name, false - end - - def down - change_column_null :audit_events_instance_external_audit_event_destinations, :name, true - end -end diff --git a/db/migrate/20230626113908_add_project_id_to_scan_result_policies.rb b/db/migrate/20230626113908_add_project_id_to_scan_result_policies.rb deleted file mode 100644 index 6066b945edfb4711b7d23fd76fa778bb8aa0d238..0000000000000000000000000000000000000000 --- a/db/migrate/20230626113908_add_project_id_to_scan_result_policies.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddProjectIdToScanResultPolicies < Gitlab::Database::Migration[2.1] - def up - add_column :scan_result_policies, :project_id, :bigint - end - - def down - remove_column :scan_result_policies, :project_id - end -end diff --git a/db/migrate/20230626113909_add_index_to_scan_result_policies_on_project_id.rb b/db/migrate/20230626113909_add_index_to_scan_result_policies_on_project_id.rb deleted file mode 100644 index 63416765bfa7624dca43480a35fcce677fe3e198..0000000000000000000000000000000000000000 --- a/db/migrate/20230626113909_add_index_to_scan_result_policies_on_project_id.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToScanResultPoliciesOnProjectId < Gitlab::Database::Migration[2.1] - INDEX_NAME = 'index_scan_result_policies_on_project_id' - - disable_ddl_transaction! - - def up - add_concurrent_index :scan_result_policies, :project_id, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :scan_result_policies, INDEX_NAME - end -end diff --git a/db/migrate/20230626113910_add_project_id_foreign_key_to_scan_result_policies.rb b/db/migrate/20230626113910_add_project_id_foreign_key_to_scan_result_policies.rb deleted file mode 100644 index c5446e17ef3d2798fdefcbf4773edfe4af558a59..0000000000000000000000000000000000000000 --- a/db/migrate/20230626113910_add_project_id_foreign_key_to_scan_result_policies.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddProjectIdForeignKeyToScanResultPolicies < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :scan_result_policies, - :projects, - column: :project_id, - on_delete: :cascade - end - - def down - remove_foreign_key_if_exists :scan_result_policies, column: :project_id - end -end diff --git a/db/migrate/20230629071427_add_last_enforced_at_to_namespace_limits.rb b/db/migrate/20230629071427_add_last_enforced_at_to_namespace_limits.rb deleted file mode 100644 index 4f005c42228bf215ffa49a86408903655fd734dd..0000000000000000000000000000000000000000 --- a/db/migrate/20230629071427_add_last_enforced_at_to_namespace_limits.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddLastEnforcedAtToNamespaceLimits < Gitlab::Database::Migration[2.1] - def change - add_column :namespace_limits, :last_enforced_at, :datetime_with_timezone - end -end diff --git a/db/migrate/20230629112833_create_fk_ml_candidates_on_user_id.rb b/db/migrate/20230629112833_create_fk_ml_candidates_on_user_id.rb deleted file mode 100644 index 85545c415290ddfbfa399e9c5dfca08461635f6d..0000000000000000000000000000000000000000 --- a/db/migrate/20230629112833_create_fk_ml_candidates_on_user_id.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class CreateFkMlCandidatesOnUserId < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - NEW_CONSTRAINT_NAME = 'fk_ml_candidates_on_user_id' - - def up - add_concurrent_foreign_key( - :ml_candidates, - :users, - column: :user_id, - on_delete: :nullify, - validate: false, - name: NEW_CONSTRAINT_NAME - ) - end - - def down - with_lock_retries do - remove_foreign_key_if_exists( - :ml_candidates, - column: :user_id, - on_delete: :nullify, - name: NEW_CONSTRAINT_NAME - ) - end - end -end diff --git a/db/migrate/20230629113029_validate_fk_ml_candidates_on_user_id.rb b/db/migrate/20230629113029_validate_fk_ml_candidates_on_user_id.rb deleted file mode 100644 index dce7f8eeb471059674bed62259ed693aa31fccd5..0000000000000000000000000000000000000000 --- a/db/migrate/20230629113029_validate_fk_ml_candidates_on_user_id.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class ValidateFkMlCandidatesOnUserId < Gitlab::Database::Migration[2.1] - NEW_CONSTRAINT_NAME = 'fk_ml_candidates_on_user_id' - - def up - validate_foreign_key(:ml_candidates, :user_id, name: NEW_CONSTRAINT_NAME) - end - - def down - # no-op - end -end diff --git a/db/migrate/20230629113133_remove_old_fk_ml_candidates_on_user_id.rb b/db/migrate/20230629113133_remove_old_fk_ml_candidates_on_user_id.rb deleted file mode 100644 index 73ed826ec756dcb66ee9feda6b5551700b7b86a3..0000000000000000000000000000000000000000 --- a/db/migrate/20230629113133_remove_old_fk_ml_candidates_on_user_id.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class RemoveOldFkMlCandidatesOnUserId < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - OLD_CONSTRAINT_NAME = 'fk_rails_1b37441fe5' - - def up - remove_foreign_key_if_exists(:ml_candidates, column: :user_id, name: OLD_CONSTRAINT_NAME) - end - - def down - add_concurrent_foreign_key( - :ml_candidates, - :users, - column: :user_id, - validate: false, - name: OLD_CONSTRAINT_NAME - ) - end -end diff --git a/db/migrate/20230630101337_add_previous_personal_access_token_to_personal_access_tokens.rb b/db/migrate/20230630101337_add_previous_personal_access_token_to_personal_access_tokens.rb deleted file mode 100644 index 870723abea9074cd64aa44e90c8bf3b7e7f05c1c..0000000000000000000000000000000000000000 --- a/db/migrate/20230630101337_add_previous_personal_access_token_to_personal_access_tokens.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class AddPreviousPersonalAccessTokenToPersonalAccessTokens < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def up - add_column :personal_access_tokens, :previous_personal_access_token_id, :bigint, null: true - end - - def down - remove_column :personal_access_tokens, :previous_personal_access_token_id - end -end diff --git a/db/migrate/20230630101342_add_index_to_personal_access_tokens_on_previous_personal_access_token_id.rb b/db/migrate/20230630101342_add_index_to_personal_access_tokens_on_previous_personal_access_token_id.rb deleted file mode 100644 index 9d07d9f4118d877e496e854b3626ceea525cb101..0000000000000000000000000000000000000000 --- a/db/migrate/20230630101342_add_index_to_personal_access_tokens_on_previous_personal_access_token_id.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToPersonalAccessTokensOnPreviousPersonalAccessTokenId < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'idx_personal_access_tokens_on_previous_personal_access_token_id' - - def up - add_concurrent_index :personal_access_tokens, :previous_personal_access_token_id, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :personal_access_tokens, INDEX_NAME - end -end diff --git a/db/migrate/20230630101347_add_fk_to_personal_access_tokens_on_previous_personal_access_token_id.rb b/db/migrate/20230630101347_add_fk_to_personal_access_tokens_on_previous_personal_access_token_id.rb deleted file mode 100644 index a740b386e4790143d7e2185dfe83ab9bc5ca5dfe..0000000000000000000000000000000000000000 --- a/db/migrate/20230630101347_add_fk_to_personal_access_tokens_on_previous_personal_access_token_id.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class AddFkToPersonalAccessTokensOnPreviousPersonalAccessTokenId < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key( - :personal_access_tokens, - :personal_access_tokens, - column: :previous_personal_access_token_id, - on_delete: :nullify) - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :personal_access_tokens, column: :previous_personal_access_token_id - end - end -end diff --git a/db/migrate/20230630170515_add_state_to_catalog_resources.rb b/db/migrate/20230630170515_add_state_to_catalog_resources.rb deleted file mode 100644 index ff0a5fda6c9b5389de46c7a325dc97965ce28869..0000000000000000000000000000000000000000 --- a/db/migrate/20230630170515_add_state_to_catalog_resources.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddStateToCatalogResources < Gitlab::Database::Migration[2.1] - DRAFT = 0 - - def change - add_column :catalog_resources, :state, :smallint, null: false, limit: 1, default: DRAFT - end -end diff --git a/db/migrate/20230701195315_add_kubernetes_namespace_column_to_environments.rb b/db/migrate/20230701195315_add_kubernetes_namespace_column_to_environments.rb deleted file mode 100644 index e05feca2c64a7e75451086dd9a93628059efd77d..0000000000000000000000000000000000000000 --- a/db/migrate/20230701195315_add_kubernetes_namespace_column_to_environments.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class AddKubernetesNamespaceColumnToEnvironments < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - with_lock_retries do - add_column :environments, :kubernetes_namespace, :text unless column_exists?(:environments, :kubernetes_namespace) - end - - add_text_limit :environments, :kubernetes_namespace, 63 - end - - def down - remove_column :environments, :kubernetes_namespace - end -end diff --git a/db/migrate/20230703115902_add_relay_state_allowlist_application_settings.rb b/db/migrate/20230703115902_add_relay_state_allowlist_application_settings.rb deleted file mode 100644 index 3de7470f113f14a526dc658f222e31f12410a095..0000000000000000000000000000000000000000 --- a/db/migrate/20230703115902_add_relay_state_allowlist_application_settings.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddRelayStateAllowlistApplicationSettings < Gitlab::Database::Migration[2.1] - def change - add_column :application_settings, :relay_state_domain_allowlist, - :text, - array: true, - default: [], - null: false - end -end diff --git a/db/migrate/20230703121859_add_relay_state_allowlist_saml_providers.rb b/db/migrate/20230703121859_add_relay_state_allowlist_saml_providers.rb deleted file mode 100644 index b05059d1d61ba1b24a4c1e6bc43baf94bb26b722..0000000000000000000000000000000000000000 --- a/db/migrate/20230703121859_add_relay_state_allowlist_saml_providers.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddRelayStateAllowlistSamlProviders < Gitlab::Database::Migration[2.1] - def change - add_column :saml_providers, :relay_state_domain_allowlist, - :text, - array: true, - default: [], - null: false - end -end diff --git a/db/migrate/20230705085223_create_service_access_tokens.rb b/db/migrate/20230705085223_create_service_access_tokens.rb deleted file mode 100644 index b934ef5d60ae5fbfa21ee6e1c7476e6d1cd61a84..0000000000000000000000000000000000000000 --- a/db/migrate/20230705085223_create_service_access_tokens.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -class CreateServiceAccessTokens < Gitlab::Database::Migration[2.1] - def change - create_table :service_access_tokens do |t| - t.timestamps_with_timezone null: false - t.integer :category, limit: 2, null: false, default: 0 - t.binary :encrypted_token, null: false - t.binary :encrypted_token_iv, null: false - end - end -end diff --git a/db/migrate/20230705092150_create_ml_models.rb b/db/migrate/20230705092150_create_ml_models.rb deleted file mode 100644 index df8827a781fbd468d3e206615a15be16366e49a4..0000000000000000000000000000000000000000 --- a/db/migrate/20230705092150_create_ml_models.rb +++ /dev/null @@ -1,19 +0,0 @@ -# frozen_string_literal: true - -class CreateMlModels < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def up - create_table :ml_models do |t| - t.timestamps_with_timezone null: false - t.references :project, foreign_key: true, index: true, on_delete: :cascade, null: false - t.text :name, limit: 255, null: false - - t.index [:project_id, :name], unique: true - end - end - - def down - drop_table :ml_models - end -end diff --git a/db/migrate/20230705155000_add_group_mention_events_to_integrations.rb b/db/migrate/20230705155000_add_group_mention_events_to_integrations.rb deleted file mode 100644 index 82c2c7140222c268f4ec79ea88abdd278ec51b55..0000000000000000000000000000000000000000 --- a/db/migrate/20230705155000_add_group_mention_events_to_integrations.rb +++ /dev/null @@ -1,8 +0,0 @@ -# frozen_string_literal: true - -class AddGroupMentionEventsToIntegrations < Gitlab::Database::Migration[2.1] - def change - add_column :integrations, :group_mention_events, :boolean, null: false, default: false - add_column :integrations, :group_confidential_mention_events, :boolean, null: false, default: false - end -end diff --git a/db/migrate/20230706130217_add_column_model_id_to_ml_experiments.rb b/db/migrate/20230706130217_add_column_model_id_to_ml_experiments.rb deleted file mode 100644 index 4eab027bc22c5638a75debe5990f66c3af6d0be3..0000000000000000000000000000000000000000 --- a/db/migrate/20230706130217_add_column_model_id_to_ml_experiments.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class AddColumnModelIdToMlExperiments < Gitlab::Database::Migration[2.1] - def change - # rubocop:disable Migration/AddReference - add_reference :ml_experiments, - :model, - index: true, - null: true, - unique: true, - foreign_key: { on_delete: :cascade, to_table: :ml_models } - # rubocop:enable Migration/AddReference - end -end diff --git a/db/migrate/20230706192435_remove_debian_process_changes_worker_job_instances.rb b/db/migrate/20230706192435_remove_debian_process_changes_worker_job_instances.rb deleted file mode 100644 index 48c992b5e3cb600fea86d724c7bcf3036b68c865..0000000000000000000000000000000000000000 --- a/db/migrate/20230706192435_remove_debian_process_changes_worker_job_instances.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RemoveDebianProcessChangesWorkerJobInstances < Gitlab::Database::Migration[2.1] - DEPRECATED_JOB_CLASSES = %w[Packages::Debian::ProcessChangesWorker] - - disable_ddl_transaction! - - def up - sidekiq_remove_jobs(job_klasses: DEPRECATED_JOB_CLASSES) - end - - def down - # This migration removes any instances of deprecated workers and cannot be undone. - end -end diff --git a/db/migrate/20230707090835_create_ml_model_versions.rb b/db/migrate/20230707090835_create_ml_model_versions.rb deleted file mode 100644 index f7be6ec46817b3be8bbd9a5db4a15365fb01c933..0000000000000000000000000000000000000000 --- a/db/migrate/20230707090835_create_ml_model_versions.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class CreateMlModelVersions < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def up - create_table :ml_model_versions do |t| - t.timestamps_with_timezone null: false - t.references :project, foreign_key: { on_delete: :cascade }, index: true, null: false - - t.bigint :model_id, null: false # fk cascade - t.bigint :package_id, null: true # fk nullify - - t.text :version, limit: 255, null: false - - t.index :model_id - t.index :package_id - t.index [:project_id, :model_id, :version], unique: true - end - end - - def down - drop_table :ml_model_versions - end -end diff --git a/db/migrate/20230707094002_add_fk_on_ml_model_versions_to_ml_models.rb b/db/migrate/20230707094002_add_fk_on_ml_model_versions_to_ml_models.rb deleted file mode 100644 index 04e7b9c2e6a35ce3fd99d16d17675bf4a5aec34e..0000000000000000000000000000000000000000 --- a/db/migrate/20230707094002_add_fk_on_ml_model_versions_to_ml_models.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddFkOnMlModelVersionsToMlModels < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key(:ml_model_versions, :ml_models, column: :model_id, on_delete: :cascade) - end - - def down - with_lock_retries do - remove_foreign_key_if_exists(:ml_model_versions, column: :model_id, on_delete: :cascade) - end - end -end diff --git a/db/migrate/20230707094003_add_fk_on_ml_model_versions_to_packages.rb b/db/migrate/20230707094003_add_fk_on_ml_model_versions_to_packages.rb deleted file mode 100644 index 03c1af1af664380413bc74779fec7e7c1be20593..0000000000000000000000000000000000000000 --- a/db/migrate/20230707094003_add_fk_on_ml_model_versions_to_packages.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddFkOnMlModelVersionsToPackages < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key(:ml_model_versions, :packages_packages, column: :package_id, on_delete: :nullify) - end - - def down - with_lock_retries do - remove_foreign_key_if_exists(:ml_model_versions, column: :package_id, on_delete: :nullify) - end - end -end diff --git a/db/migrate/20230710160232_add_expires_at_to_service_access_tokens.rb b/db/migrate/20230710160232_add_expires_at_to_service_access_tokens.rb deleted file mode 100644 index f9e4e014ff459e664ecda141c94728b163f22904..0000000000000000000000000000000000000000 --- a/db/migrate/20230710160232_add_expires_at_to_service_access_tokens.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class AddExpiresAtToServiceAccessTokens < Gitlab::Database::Migration[2.1] - def change - # Code using this table has not been implemented yet. - # During we run the migration, the table will be empty. - # rubocop:disable Rails/NotNullColumn - add_column :service_access_tokens, :expires_at, :datetime_with_timezone, null: false - # rubocop:enable Rails/NotNullColumn - end -end diff --git a/db/migrate/20230710200434_add_emoji_events_to_web_hooks.rb b/db/migrate/20230710200434_add_emoji_events_to_web_hooks.rb deleted file mode 100644 index 45a6d15cefbd2eff742c4406a320633a95f1cfd4..0000000000000000000000000000000000000000 --- a/db/migrate/20230710200434_add_emoji_events_to_web_hooks.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class AddEmojiEventsToWebHooks < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def change - add_column :web_hooks, :emoji_events, :boolean, null: false, default: false - end -end diff --git a/db/migrate/20230712214613_add_read_dependency_to_member_roles.rb b/db/migrate/20230712214613_add_read_dependency_to_member_roles.rb deleted file mode 100644 index c6c9f3a061173b942bb99ec1125765c7a0d5aa20..0000000000000000000000000000000000000000 --- a/db/migrate/20230712214613_add_read_dependency_to_member_roles.rb +++ /dev/null @@ -1,7 +0,0 @@ -# frozen_string_literal: true - -class AddReadDependencyToMemberRoles < Gitlab::Database::Migration[2.1] - def change - add_column :member_roles, :read_dependency, :boolean, default: false, null: false - end -end diff --git a/db/migrate/20230714195649_add_namespace_storage_forks_cost_factor_to_application_settings.rb b/db/migrate/20230714195649_add_namespace_storage_forks_cost_factor_to_application_settings.rb deleted file mode 100644 index 3388b934668ce97effbfd1bf880f29d5007333c1..0000000000000000000000000000000000000000 --- a/db/migrate/20230714195649_add_namespace_storage_forks_cost_factor_to_application_settings.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddNamespaceStorageForksCostFactorToApplicationSettings < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - CONSTRAINT_NAME = 'check_app_settings_namespace_storage_forks_cost_factor_range' - - def up - with_lock_retries do - add_column :application_settings, :namespace_storage_forks_cost_factor, - :float, default: 1.0, null: false, if_not_exists: true - end - - add_check_constraint :application_settings, - 'namespace_storage_forks_cost_factor >= 0 AND namespace_storage_forks_cost_factor <= 1', - CONSTRAINT_NAME - end - - def down - remove_column :application_settings, :namespace_storage_forks_cost_factor - end -end diff --git a/db/migrate/20230717200940_create_group_wiki_repository_states.rb b/db/migrate/20230717200940_create_group_wiki_repository_states.rb deleted file mode 100644 index 36b2173ab24bf7f456949255de0b5c1d5ba34e64..0000000000000000000000000000000000000000 --- a/db/migrate/20230717200940_create_group_wiki_repository_states.rb +++ /dev/null @@ -1,43 +0,0 @@ -# frozen_string_literal: true - -class CreateGroupWikiRepositoryStates < Gitlab::Database::Migration[2.1] - VERIFICATION_STATE_INDEX_NAME = "index_group_wiki_repository_states_on_verification_state" - PENDING_VERIFICATION_INDEX_NAME = "index_group_wiki_repository_states_pending_verification" - FAILED_VERIFICATION_INDEX_NAME = "index_group_wiki_repository_states_failed_verification" - NEEDS_VERIFICATION_INDEX_NAME = "index_group_wiki_repository_states_needs_verification" - - enable_lock_retries! - - def up - create_table :group_wiki_repository_states do |t| - t.datetime_with_timezone :verification_started_at - t.datetime_with_timezone :verification_retry_at - t.datetime_with_timezone :verified_at - t.references :group_wiki_repository, - null: false, - index: { unique: true }, - foreign_key: { primary_key: :group_id, on_delete: :cascade } - t.integer :verification_state, default: 0, limit: 2, null: false - t.integer :verification_retry_count, default: 0, limit: 2, null: false - t.binary :verification_checksum, using: 'verification_checksum::bytea' - t.text :verification_failure, limit: 255 - - t.index :verification_state, name: VERIFICATION_STATE_INDEX_NAME - t.index :verified_at, - where: "(verification_state = 0)", - order: { verified_at: 'ASC NULLS FIRST' }, - name: PENDING_VERIFICATION_INDEX_NAME - t.index :verification_retry_at, - where: "(verification_state = 3)", - order: { verification_retry_at: 'ASC NULLS FIRST' }, - name: FAILED_VERIFICATION_INDEX_NAME - t.index :verification_state, - where: "(verification_state = 0 OR verification_state = 3)", - name: NEEDS_VERIFICATION_INDEX_NAME - end - end - - def down - drop_table :group_wiki_repository_states - end -end diff --git a/db/post_migrate/20230314094213_remove_foreign_keys_from_u2f_registrations_table.rb b/db/post_migrate/20230314094213_remove_foreign_keys_from_u2f_registrations_table.rb deleted file mode 100644 index d6185d6674d85088987eb7159326713f1c5cbd67..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230314094213_remove_foreign_keys_from_u2f_registrations_table.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class RemoveForeignKeysFromU2fRegistrationsTable < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - with_lock_retries do - remove_foreign_key :u2f_registrations, :users - end - end - - def down - add_concurrent_foreign_key :u2f_registrations, :users, column: :user_id - end -end diff --git a/db/post_migrate/20230314094215_drop_u2f_registrations_table.rb b/db/post_migrate/20230314094215_drop_u2f_registrations_table.rb deleted file mode 100644 index 9a57c424592897548d9d63847b18243cdccc930a..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230314094215_drop_u2f_registrations_table.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class DropU2fRegistrationsTable < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def up - drop_table :u2f_registrations - end - - def down - create_table :u2f_registrations do |t| # rubocop: disable Migration/SchemaAdditionMethodsNoPost - t.text :certificate - t.string :key_handle - t.string :public_key - t.integer :counter - t.references :user, foreign_key: false - t.datetime_with_timezone :created_at, null: false - t.datetime_with_timezone :updated_at, null: false - t.string :name - t.index [:key_handle], name: 'index_u2f_registrations_on_key_handle' - end - end -end diff --git a/db/post_migrate/20230523101514_finalize_user_type_migration.rb b/db/post_migrate/20230523101514_finalize_user_type_migration.rb deleted file mode 100644 index c6533bec5871f1f4fce226580685979c67400380..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230523101514_finalize_user_type_migration.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class FinalizeUserTypeMigration < Gitlab::Database::Migration[2.1] - MIGRATION = 'MigrateHumanUserType' - - restrict_gitlab_migration gitlab_schema: :gitlab_main - - disable_ddl_transaction! - - def up - ensure_batched_background_migration_is_finished( - job_class_name: MIGRATION, - table_name: :users, - column_name: :id, - job_arguments: [] - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20230528203340_drop_message_from_vulnerability_occurrences.rb b/db/post_migrate/20230528203340_drop_message_from_vulnerability_occurrences.rb deleted file mode 100644 index 4214ba803f6077183c210e3e86764ca82f5a6330..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230528203340_drop_message_from_vulnerability_occurrences.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class DropMessageFromVulnerabilityOccurrences < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - remove_column :vulnerability_occurrences, :message - end - - def down - unless column_exists?(:vulnerability_occurrences, :message) - add_column :vulnerability_occurrences, :message, :text # rubocop:disable Migration/SchemaAdditionMethodsNoPost - end - - add_check_constraint(:vulnerability_occurrences, 'char_length(message) <= 3000', 'check_df6dd20219') - end -end diff --git a/db/post_migrate/20230530012406_finalize_backfill_resource_link_events.rb b/db/post_migrate/20230530012406_finalize_backfill_resource_link_events.rb deleted file mode 100644 index c86a341392f9908734815b4b4e4082013b24e857..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230530012406_finalize_backfill_resource_link_events.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class FinalizeBackfillResourceLinkEvents < Gitlab::Database::Migration[2.1] - MIGRATION = 'BackfillResourceLinkEvents' - disable_ddl_transaction! - - restrict_gitlab_migration gitlab_schema: :gitlab_main - - def up - ensure_batched_background_migration_is_finished( - job_class_name: MIGRATION, - table_name: :system_note_metadata, - column_name: :id, - job_arguments: [], - finalize: true - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20230601211635_add_detected_at_id_index_to_vulnerabilities.rb b/db/post_migrate/20230601211635_add_detected_at_id_index_to_vulnerabilities.rb deleted file mode 100644 index e7ccfad1fd3fbbdee60239df86f0a8e732200370..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230601211635_add_detected_at_id_index_to_vulnerabilities.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddDetectedAtIdIndexToVulnerabilities < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'index_vulnerabilities_on_detected_at_and_id' - - def up - add_concurrent_index :vulnerabilities, [:id, :detected_at], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME - end -end diff --git a/db/post_migrate/20230601213750_add_uuid_project_id_state_id_index_to_vulnerability_reads.rb b/db/post_migrate/20230601213750_add_uuid_project_id_state_id_index_to_vulnerability_reads.rb deleted file mode 100644 index f91394eb7837837323815a11b7757512d3e6affc..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230601213750_add_uuid_project_id_state_id_index_to_vulnerability_reads.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddUuidProjectIdStateIdIndexToVulnerabilityReads < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'index_vulnerability_reads_on_uuid_project_id_and_state' - - def up - add_concurrent_index :vulnerability_reads, [:uuid, :project_id, :state], name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :vulnerability_reads, INDEX_NAME - end -end diff --git a/db/post_migrate/20230608145500_add_prepared_at_index_to_merge_requests.rb b/db/post_migrate/20230608145500_add_prepared_at_index_to_merge_requests.rb deleted file mode 100644 index 3d3557ce543b8645b7a9f1e702d3e148711cc9c1..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230608145500_add_prepared_at_index_to_merge_requests.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class AddPreparedAtIndexToMergeRequests < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'index_merge_requests_on_id_and_prepared_at' - - # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/415721 - - def up - prepare_async_index(:merge_requests, - :id, - name: INDEX_NAME, - where: "prepared_at IS NULL") - end - - def down - unprepare_async_index(:merge_requests, :id, name: INDEX_NAME) - end -end diff --git a/db/post_migrate/20230609065942_backfill_ci_pipeline_variables_for_pipeline_id_bigint_conversion.rb b/db/post_migrate/20230609065942_backfill_ci_pipeline_variables_for_pipeline_id_bigint_conversion.rb deleted file mode 100644 index c09820ad9d42559eea5d9e873fdb19966f4a80f0..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230609065942_backfill_ci_pipeline_variables_for_pipeline_id_bigint_conversion.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class BackfillCiPipelineVariablesForPipelineIdBigintConversion < Gitlab::Database::Migration[2.1] - restrict_gitlab_migration gitlab_schema: :gitlab_ci - - TABLE = :ci_pipeline_variables - COLUMNS = %i[pipeline_id] - - def up - backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS, sub_batch_size: 500) - end - - def down - revert_backfill_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end -end diff --git a/db/post_migrate/20230613192703_ensure_ci_build_needs_big_int_backfill_is_finished_for_self_hosts.rb b/db/post_migrate/20230613192703_ensure_ci_build_needs_big_int_backfill_is_finished_for_self_hosts.rb deleted file mode 100644 index 7616944567e1ea43d3be94a5479f59482c2c0ab6..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230613192703_ensure_ci_build_needs_big_int_backfill_is_finished_for_self_hosts.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class EnsureCiBuildNeedsBigIntBackfillIsFinishedForSelfHosts < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::ConvertToBigint - - disable_ddl_transaction! - - restrict_gitlab_migration gitlab_schema: :gitlab_ci - - TABLE_NAME = 'ci_build_needs' - - def up - ensure_batched_background_migration_is_finished( - job_class_name: 'CopyColumnUsingBackgroundMigrationJob', - table_name: TABLE_NAME, - column_name: 'id', - job_arguments: [['id'], ['id_convert_to_bigint']] - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20230613192802_swap_ci_build_needs_to_big_int_for_self_hosts.rb b/db/post_migrate/20230613192802_swap_ci_build_needs_to_big_int_for_self_hosts.rb deleted file mode 100644 index 7533de86a2a513c938018e771c76cf295a139c58..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230613192802_swap_ci_build_needs_to_big_int_for_self_hosts.rb +++ /dev/null @@ -1,74 +0,0 @@ -# frozen_string_literal: true - -class SwapCiBuildNeedsToBigIntForSelfHosts < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::ConvertToBigint - - disable_ddl_transaction! - - TABLE_NAME = 'ci_build_needs' - - def up - return if should_skip? - return if temporary_column_already_dropped? - return if columns_already_swapped? - - swap - end - - def down - return if should_skip? - return if temporary_column_already_dropped? - return unless columns_already_swapped? - - swap - end - - private - - def swap - add_concurrent_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: - 'index_ci_build_needs_on_id_convert_to_bigint' - - with_lock_retries(raise_on_exhaustion: true) do - execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" - - execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id TO id_tmp" - execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id_convert_to_bigint TO id" - execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN id_tmp TO id_convert_to_bigint" - - function_name = Gitlab::Database::UnidirectionalCopyTrigger.on_table( - TABLE_NAME, connection: Ci::ApplicationRecord.connection - ).name( - :id, :id_convert_to_bigint - ) - - execute "ALTER FUNCTION #{quote_table_name(function_name)} RESET ALL" - - execute "ALTER SEQUENCE ci_build_needs_id_seq OWNED BY #{TABLE_NAME}.id" - change_column_default TABLE_NAME, :id, -> { "nextval('ci_build_needs_id_seq'::regclass)" } - change_column_default TABLE_NAME, :id_convert_to_bigint, 0 - - execute "ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT ci_build_needs_pkey CASCADE" - rename_index TABLE_NAME, 'index_ci_build_needs_on_id_convert_to_bigint', 'ci_build_needs_pkey' - execute "ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT ci_build_needs_pkey PRIMARY KEY USING INDEX ci_build_needs_pkey" - end - end - - def should_skip? - com_or_dev_or_test_but_not_jh? - end - - def columns_already_swapped? - table_columns = columns(TABLE_NAME) - column_id = table_columns.find { |c| c.name == 'id' } - column_id_convert_to_bigint = table_columns.find { |c| c.name == 'id_convert_to_bigint' } - - column_id.sql_type == 'bigint' && column_id_convert_to_bigint.sql_type == 'integer' - end - - def temporary_column_already_dropped? - table_columns = columns(TABLE_NAME) - - !table_columns.find { |c| c.name == 'id_convert_to_bigint' } - end -end diff --git a/db/post_migrate/20230614181310_track_organization_deletions.rb b/db/post_migrate/20230614181310_track_organization_deletions.rb deleted file mode 100644 index 9e936d6d285d71305fc428bc7c7da7e210c20e83..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230614181310_track_organization_deletions.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class TrackOrganizationDeletions < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers - - enable_lock_retries! - - def up - # This LFK trigger already exists on some environments and it was reverted - # in MR: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122809 - track_record_deletions(:organizations) unless has_loose_foreign_key?('organizations') - end - - def down - untrack_record_deletions(:organizations) - end -end diff --git a/db/post_migrate/20230614182049_add_index_to_namespaces_organization_id.rb b/db/post_migrate/20230614182049_add_index_to_namespaces_organization_id.rb deleted file mode 100644 index c7eeb7a89156733cd5f681e132f972937c380858..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230614182049_add_index_to_namespaces_organization_id.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToNamespacesOrganizationId < Gitlab::Database::Migration[2.1] - INDEX_NAME = 'index_namespaces_on_organization_id' - TABLE = :namespaces - - disable_ddl_transaction! - - # This index was added on GitLab SaaS in - # https://gitlab.com/gitlab-org/gitlab/-/merge_requests/120822 - - # rubocop:disable Migration/PreventIndexCreation - def up - add_concurrent_index TABLE, :organization_id, name: INDEX_NAME - end - # rubocop:enable Migration/PreventIndexCreation - - def down - remove_concurrent_index_by_name TABLE, INDEX_NAME - end -end diff --git a/db/post_migrate/20230615030402_remove_audit_events_group_index.rb b/db/post_migrate/20230615030402_remove_audit_events_group_index.rb deleted file mode 100644 index ff75a04b0f40c577a5507ed45d850e9b846dcad1..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230615030402_remove_audit_events_group_index.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class RemoveAuditEventsGroupIndex < Gitlab::Database::Migration[2.1] - include Gitlab::Database::PartitioningMigrationHelpers - - TABLE_NAME = :audit_events - COLUMN_NAMES = [:entity_id, :entity_type, :created_at, :id] - INDEX_NAME = 'index_audit_events_on_entity_id_and_entity_type_and_created_at' - - # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/415424 - def up - each_partition(TABLE_NAME) do |partition, partition_index_name| - unprepare_async_index_by_name(partition.identifier, partition_index_name) - end - end - - def down - each_partition(TABLE_NAME) do |partition, partition_index_name| - prepare_async_index( - partition.identifier, - COLUMN_NAMES, - name: partition_index_name - ) - end - end - - private - - def each_partition(table_name) - partitioned_table = find_partitioned_table(table_name) - partitioned_table.postgres_partitions.order(:name).each do |partition| - partition_index_name = generated_index_name(partition.identifier, INDEX_NAME) - - yield partition, partition_index_name - end - end -end diff --git a/db/post_migrate/20230615113748_replace_ci_job_artifacts_foreign_key_v3.rb b/db/post_migrate/20230615113748_replace_ci_job_artifacts_foreign_key_v3.rb deleted file mode 100644 index 92b3008ff00816c4bbe0eadb6c972ea09a641815..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230615113748_replace_ci_job_artifacts_foreign_key_v3.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class ReplaceCiJobArtifactsForeignKeyV3 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :ci_job_artifacts, :p_ci_builds, - name: 'temp_fk_rails_c5137cb2c1_p', - column: [:partition_id, :job_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - end - - def down - remove_foreign_key_if_exists :ci_job_artifacts, name: 'temp_fk_rails_c5137cb2c1_p' - end -end diff --git a/db/post_migrate/20230615113840_replace_ci_running_builds_foreign_key_v3.rb b/db/post_migrate/20230615113840_replace_ci_running_builds_foreign_key_v3.rb deleted file mode 100644 index ef8f252bbf7b68be818b55355e9cf677762e88fd..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230615113840_replace_ci_running_builds_foreign_key_v3.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class ReplaceCiRunningBuildsForeignKeyV3 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :ci_running_builds, :p_ci_builds, - name: 'temp_fk_rails_da45cfa165_p', - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - end - - def down - remove_foreign_key_if_exists :ci_running_builds, name: 'temp_fk_rails_da45cfa165_p' - end -end diff --git a/db/post_migrate/20230615113858_replace_ci_job_variables_foreign_key_v3.rb b/db/post_migrate/20230615113858_replace_ci_job_variables_foreign_key_v3.rb deleted file mode 100644 index 76c83c90ad02441cd79459ceab5cc9d2214bf51e..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230615113858_replace_ci_job_variables_foreign_key_v3.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -class ReplaceCiJobVariablesForeignKeyV3 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - add_concurrent_foreign_key :ci_job_variables, :p_ci_builds, - name: 'temp_fk_rails_fbf3b34792_p', - column: [:partition_id, :job_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - end - - def down - remove_foreign_key_if_exists :ci_job_variables, name: 'temp_fk_rails_fbf3b34792_p' - end -end diff --git a/db/post_migrate/20230615121103_replace_p_ci_builds_metadata_foreign_key_v3.rb b/db/post_migrate/20230615121103_replace_p_ci_builds_metadata_foreign_key_v3.rb deleted file mode 100644 index dca891fc0640f42f23e64b8f92daec814d43f799..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230615121103_replace_p_ci_builds_metadata_foreign_key_v3.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplacePCiBuildsMetadataForeignKeyV3 < Gitlab::Database::Migration[2.1] - include Gitlab::Database::PartitioningMigrationHelpers - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - disable_ddl_transaction! - - def up - return unless should_run? - - add_concurrent_partitioned_foreign_key :p_ci_builds_metadata, :p_ci_builds, - name: :temp_fk_e20479742e_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - end - - def down - return unless should_run? - - with_lock_retries do - remove_foreign_key_if_exists :p_ci_builds_metadata, :p_ci_builds, - name: :temp_fk_e20479742e_p, - reverse_lock_order: true - end - end - - private - - def should_run? - can_execute_on?(:ci_builds_metadata, :ci_builds) - end -end diff --git a/db/post_migrate/20230615121122_replace_p_ci_runner_machine_builds_foreign_key_v3.rb b/db/post_migrate/20230615121122_replace_p_ci_runner_machine_builds_foreign_key_v3.rb deleted file mode 100644 index 854d7358e5e3f692050469fbdf69c36bb93b3733..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230615121122_replace_p_ci_runner_machine_builds_foreign_key_v3.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplacePCiRunnerMachineBuildsForeignKeyV3 < Gitlab::Database::Migration[2.1] - include Gitlab::Database::PartitioningMigrationHelpers - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - disable_ddl_transaction! - - def up - return unless should_run? - - add_concurrent_partitioned_foreign_key :p_ci_runner_machine_builds, :p_ci_builds, - name: :temp_fk_bb490f12fe_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - end - - def down - return unless should_run? - - with_lock_retries do - remove_foreign_key_if_exists :p_ci_runner_machine_builds, :p_ci_builds, - name: :temp_fk_bb490f12fe_p, - reverse_lock_order: true - end - end - - private - - def should_run? - can_execute_on?(:ci_builds) - end -end diff --git a/db/post_migrate/20230615144627_remove_temporary_container_repository_indexes.rb b/db/post_migrate/20230615144627_remove_temporary_container_repository_indexes.rb deleted file mode 100644 index c4d01f35607cc17085dcef37d3bd7458f7b23821..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230615144627_remove_temporary_container_repository_indexes.rb +++ /dev/null @@ -1,82 +0,0 @@ -# frozen_string_literal: true - -class RemoveTemporaryContainerRepositoryIndexes < Gitlab::Database::Migration[2.1] - INDEX_CONTAINER_REPOS_ON_NON_MIGRATED = 'tmp_index_container_repos_on_non_migrated' - INDEX_CONTAINER_REPOSITORIES_ON_ID_MIGRATION_STATE = 'tmp_index_container_repositories_on_id_migration_state' - INDEX_MIGRATED_CONTAINER_REGISTRIES = 'tmp_index_migrated_container_registries' - INDEX_CONTAINER_REPOS_ON_IMPORT_STARTED_AT_WHEN_IMPORTING = 'idx_container_repos_on_import_started_at_when_importing' - INDEX_CONTAINER_REPOS_ON_MIGRATION_STATE_MIGRATION_PLAN_CREATED = - 'idx_container_repos_on_migration_state_migration_plan_created' - INDEX_CONTAINER_REPOS_ON_PRE_IMPORT_DONE_AT_WHEN_PRE_IMPORT_DONE = - 'idx_container_repos_on_pre_import_done_at_when_pre_import_done' - INDEX_CONTAINER_REPOS_ON_PRE_IMPORT_STARTED_AT_WHEN_PRE_IMPORTING = - 'idx_container_repos_on_pre_import_started_at_when_pre_importing' - INDEX_CONTAINER_REPOSITORIES_ON_GREATEST_COMPLETED_AT = 'index_container_repositories_on_greatest_completed_at' - INDEX_CONTAINER_REPOSITORIES_ON_MIGRATION_STATE_IMPORT_DONE_AT = - 'index_container_repositories_on_migration_state_import_done_at' - - disable_ddl_transaction! - - def up - remove_concurrent_index_by_name :container_repositories, INDEX_CONTAINER_REPOS_ON_NON_MIGRATED - remove_concurrent_index_by_name :container_repositories, INDEX_CONTAINER_REPOSITORIES_ON_ID_MIGRATION_STATE - remove_concurrent_index_by_name :container_repositories, INDEX_MIGRATED_CONTAINER_REGISTRIES - remove_concurrent_index_by_name :container_repositories, INDEX_CONTAINER_REPOS_ON_IMPORT_STARTED_AT_WHEN_IMPORTING - remove_concurrent_index_by_name :container_repositories, - INDEX_CONTAINER_REPOS_ON_MIGRATION_STATE_MIGRATION_PLAN_CREATED - remove_concurrent_index_by_name :container_repositories, - INDEX_CONTAINER_REPOS_ON_PRE_IMPORT_DONE_AT_WHEN_PRE_IMPORT_DONE - remove_concurrent_index_by_name :container_repositories, - INDEX_CONTAINER_REPOS_ON_PRE_IMPORT_STARTED_AT_WHEN_PRE_IMPORTING - remove_concurrent_index_by_name :container_repositories, INDEX_CONTAINER_REPOSITORIES_ON_GREATEST_COMPLETED_AT - remove_concurrent_index_by_name :container_repositories, - INDEX_CONTAINER_REPOSITORIES_ON_MIGRATION_STATE_IMPORT_DONE_AT - end - - def down - add_concurrent_index :container_repositories, - [:project_id, :id], - name: INDEX_CONTAINER_REPOS_ON_NON_MIGRATED, - where: "migration_state != 'import_done'" - - add_concurrent_index :container_repositories, - [:id, :migration_state], - name: INDEX_CONTAINER_REPOSITORIES_ON_ID_MIGRATION_STATE - - add_concurrent_index :container_repositories, - [:project_id], - name: INDEX_MIGRATED_CONTAINER_REGISTRIES, - where: "migration_state = 'import_done' OR created_at >= '2022-01-23'" - - add_concurrent_index :container_repositories, - [:migration_import_started_at], - name: INDEX_CONTAINER_REPOS_ON_IMPORT_STARTED_AT_WHEN_IMPORTING, - where: "migration_state = 'importing'::text" - - add_concurrent_index :container_repositories, - [:migration_state, :migration_plan, :created_at], - name: INDEX_CONTAINER_REPOS_ON_MIGRATION_STATE_MIGRATION_PLAN_CREATED - - add_concurrent_index :container_repositories, - [:migration_pre_import_done_at], - name: INDEX_CONTAINER_REPOS_ON_PRE_IMPORT_DONE_AT_WHEN_PRE_IMPORT_DONE, - where: "migration_state = 'pre_import_done'::text" - - add_concurrent_index :container_repositories, - [:migration_pre_import_started_at], - name: INDEX_CONTAINER_REPOS_ON_PRE_IMPORT_STARTED_AT_WHEN_PRE_IMPORTING, - where: "migration_state = 'pre_importing'::text" - - execute( - <<-SQL - CREATE INDEX CONCURRENTLY #{INDEX_CONTAINER_REPOSITORIES_ON_GREATEST_COMPLETED_AT} ON container_repositories - USING btree (GREATEST(migration_pre_import_done_at, migration_import_done_at, migration_aborted_at, migration_skipped_at)) - WHERE (migration_state = ANY (ARRAY['import_done'::text, 'pre_import_done'::text, 'import_aborted'::text, 'import_skipped'::text])); - SQL - ) - - add_concurrent_index :container_repositories, - [:migration_state, :migration_import_done_at], - name: INDEX_CONTAINER_REPOSITORIES_ON_MIGRATION_STATE_IMPORT_DONE_AT - end -end diff --git a/db/post_migrate/20230616082958_add_unique_index_for_npm_packages_on_project_id_name_version.rb b/db/post_migrate/20230616082958_add_unique_index_for_npm_packages_on_project_id_name_version.rb deleted file mode 100644 index 646bbf414e27e836b20ef68e488c3842049d7a9b..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230616082958_add_unique_index_for_npm_packages_on_project_id_name_version.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class AddUniqueIndexForNpmPackagesOnProjectIdNameVersion < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'idx_packages_on_project_id_name_version_unique_when_npm' - PACKAGE_TYPE_NPM = 2 - - def up - add_concurrent_index( - :packages_packages, - %i[project_id name version], - name: INDEX_NAME, - unique: true, - where: "package_type = #{PACKAGE_TYPE_NPM} AND status <> 4" - ) - end - - def down - remove_concurrent_index_by_name :packages_packages, INDEX_NAME - end -end diff --git a/db/post_migrate/20230618020202_finish_user_type_migration.rb b/db/post_migrate/20230618020202_finish_user_type_migration.rb deleted file mode 100644 index 4a729d5d408b6578c602da1277424b6afd39f7db..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230618020202_finish_user_type_migration.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class FinishUserTypeMigration < Gitlab::Database::Migration[2.1] - MIGRATION = 'MigrateHumanUserType' - - disable_ddl_transaction! - - restrict_gitlab_migration gitlab_schema: :gitlab_main - - def up - ensure_batched_background_migration_is_finished( - job_class_name: MIGRATION, - table_name: :users, - column_name: :id, - job_arguments: [] - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20230619005223_change_unconfirmed_created_at_index_on_users.rb b/db/post_migrate/20230619005223_change_unconfirmed_created_at_index_on_users.rb deleted file mode 100644 index e299ce394a337073ea2bbe6f01fa105a57a4c624..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230619005223_change_unconfirmed_created_at_index_on_users.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class ChangeUnconfirmedCreatedAtIndexOnUsers < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - OLD_INDEX_NAME = 'index_users_on_unconfirmed_and_created_at_for_active_humans' - NEW_INDEX_NAME = 'index_users_on_unconfirmed_created_at_active_type_sign_in_count' - - def up - # rubocop:disable Migration/PreventIndexCreation - add_concurrent_index :users, [:created_at, :id], - name: NEW_INDEX_NAME, - where: "confirmed_at IS NULL AND state = 'active' AND user_type IN (0) AND sign_in_count = 0" - # rubocop:enable Migration/PreventIndexCreation - - remove_concurrent_index_by_name :users, OLD_INDEX_NAME - end - - def down - add_concurrent_index :users, [:created_at, :id], - name: OLD_INDEX_NAME, - where: "confirmed_at IS NULL AND state = 'active' AND user_type IN (0)" - - remove_concurrent_index_by_name :users, NEW_INDEX_NAME - end -end diff --git a/db/post_migrate/20230619072744_schedule_index_events_on_project_id_and_id_desc_on_merged_action_for_removal.rb b/db/post_migrate/20230619072744_schedule_index_events_on_project_id_and_id_desc_on_merged_action_for_removal.rb deleted file mode 100644 index b73ddfffad640366b300ead2ddb48af62ff47817..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230619072744_schedule_index_events_on_project_id_and_id_desc_on_merged_action_for_removal.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class ScheduleIndexEventsOnProjectIdAndIdDescOnMergedActionForRemoval < Gitlab::Database::Migration[2.1] - INDEX_NAME = 'index_events_on_project_id_and_id_desc_on_merged_action' - - # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/415091 - - def up - prepare_async_index_removal :events, [:project_id, :id], order: { id: :desc }, - where: "action = 7", name: INDEX_NAME - end - - def down - unprepare_async_index :events, [:project_id, :id], order: { id: :desc }, - where: "action = 7", name: INDEX_NAME - end -end diff --git a/db/post_migrate/20230619081412_add_index_to_ci_triggers_token.rb b/db/post_migrate/20230619081412_add_index_to_ci_triggers_token.rb deleted file mode 100644 index 861c9eafd9f1ed3d6303b7fec886dfe78166fd16..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230619081412_add_index_to_ci_triggers_token.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToCiTriggersToken < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'index_ci_triggers_on_token' - - def up - add_concurrent_index :ci_triggers, :token, unique: true, name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name(:ci_triggers, INDEX_NAME) - end -end diff --git a/db/post_migrate/20230619123701_schedule_removal_index_job_artifacts_id_and_expire_at.rb b/db/post_migrate/20230619123701_schedule_removal_index_job_artifacts_id_and_expire_at.rb deleted file mode 100644 index 0473032bb98c8ad81d6fc3b9d0698409537cdec5..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230619123701_schedule_removal_index_job_artifacts_id_and_expire_at.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class ScheduleRemovalIndexJobArtifactsIdAndExpireAt < Gitlab::Database::Migration[2.1] - INDEX_NAME = :tmp_index_ci_job_artifacts_on_id_expire_at_file_type_trace - TABLE_NAME = :ci_job_artifacts - COLUMN = :id - - # Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/368979 - def up - prepare_async_index_removal(TABLE_NAME, COLUMN, name: INDEX_NAME) - end - - def down - unprepare_async_index(TABLE_NAME, COLUMN, name: INDEX_NAME) - end -end diff --git a/db/post_migrate/20230619134106_prepare_index_for_vulnerability_reads_on_common_project_filters.rb b/db/post_migrate/20230619134106_prepare_index_for_vulnerability_reads_on_common_project_filters.rb deleted file mode 100644 index 60335f572d5964934aac7cfdba686751d0e476dd..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230619134106_prepare_index_for_vulnerability_reads_on_common_project_filters.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class PrepareIndexForVulnerabilityReadsOnCommonProjectFilters < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'index_project_vulnerability_reads_common_finder_query_desc' - - def up - prepare_async_index :vulnerability_reads, - [:project_id, :state, :report_type, :severity, :vulnerability_id], - order: { severity: :desc, vulnerability_id: :desc }, - name: INDEX_NAME - end - - def down - unprepare_async_index_by_name :vulnerability_reads, INDEX_NAME - end -end diff --git a/db/post_migrate/20230620072854_replace_old_fk_ci_build_pending_states_to_builds_v2.rb b/db/post_migrate/20230620072854_replace_old_fk_ci_build_pending_states_to_builds_v2.rb deleted file mode 100644 index dd6acb8a3651344f2ac9a4c2e89a19eddcdd6718..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620072854_replace_old_fk_ci_build_pending_states_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiBuildPendingStatesToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_build_pending_states, :ci_builds, - name: :fk_861cd17da3_p, reverse_lock_order: true - - rename_constraint :ci_build_pending_states, :temp_fk_861cd17da3_p, :fk_861cd17da3_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_build_pending_states, :ci_builds, - name: :temp_fk_861cd17da3_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_build_pending_states, :fk_861cd17da3_p, :temp_fk_861cd17da3_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_build_pending_states, :p_ci_builds, name: :fk_861cd17da3_p) - end -end diff --git a/db/post_migrate/20230620072856_replace_old_fk_ci_build_trace_chunks_to_builds_v2.rb b/db/post_migrate/20230620072856_replace_old_fk_ci_build_trace_chunks_to_builds_v2.rb deleted file mode 100644 index d715ba1150062c6e4bd8a95df5210663ed94d5ac..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620072856_replace_old_fk_ci_build_trace_chunks_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiBuildTraceChunksToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_build_trace_chunks, :ci_builds, - name: :fk_89e29fa5ee_p, reverse_lock_order: true - - rename_constraint :ci_build_trace_chunks, :temp_fk_89e29fa5ee_p, :fk_89e29fa5ee_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_build_trace_chunks, :ci_builds, - name: :temp_fk_89e29fa5ee_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_build_trace_chunks, :fk_89e29fa5ee_p, :temp_fk_89e29fa5ee_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_build_trace_chunks, :p_ci_builds, name: :fk_89e29fa5ee_p) - end -end diff --git a/db/post_migrate/20230620072900_replace_old_fk_ci_unit_test_failures_to_builds_v2.rb b/db/post_migrate/20230620072900_replace_old_fk_ci_unit_test_failures_to_builds_v2.rb deleted file mode 100644 index fe305ccd29d7749072ff1c4f5d840783a067d4c8..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620072900_replace_old_fk_ci_unit_test_failures_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiUnitTestFailuresToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_unit_test_failures, :ci_builds, - name: :fk_9e0fc58930_p, reverse_lock_order: true - - rename_constraint :ci_unit_test_failures, :temp_fk_9e0fc58930_p, :fk_9e0fc58930_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_unit_test_failures, :ci_builds, - name: :temp_fk_9e0fc58930_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_unit_test_failures, :fk_9e0fc58930_p, :temp_fk_9e0fc58930_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_unit_test_failures, :p_ci_builds, name: :fk_9e0fc58930_p) - end -end diff --git a/db/post_migrate/20230620072905_replace_old_fk_ci_sources_pipelines_to_builds_v2.rb b/db/post_migrate/20230620072905_replace_old_fk_ci_sources_pipelines_to_builds_v2.rb deleted file mode 100644 index 44a2418238214f9d8d0d34601aa7d4fff89c431f..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620072905_replace_old_fk_ci_sources_pipelines_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiSourcesPipelinesToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_sources_pipelines, :ci_builds, - name: :fk_be5624bf37_p, reverse_lock_order: true - - rename_constraint :ci_sources_pipelines, :temp_fk_be5624bf37_p, :fk_be5624bf37_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_sources_pipelines, :ci_builds, - name: :temp_fk_be5624bf37_p, - column: [:source_partition_id, :source_job_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_sources_pipelines, :fk_be5624bf37_p, :temp_fk_be5624bf37_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_sources_pipelines, :p_ci_builds, name: :fk_be5624bf37_p) - end -end diff --git a/db/post_migrate/20230620072908_replace_old_fk_ci_resources_to_builds_v2.rb b/db/post_migrate/20230620072908_replace_old_fk_ci_resources_to_builds_v2.rb deleted file mode 100644 index ad4773f5b9d4cb4b6fa0655ebf731dee95d0c970..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620072908_replace_old_fk_ci_resources_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiResourcesToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_resources, :ci_builds, - name: :fk_e169a8e3d5_p, reverse_lock_order: true - - rename_constraint :ci_resources, :temp_fk_e169a8e3d5_p, :fk_e169a8e3d5_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_resources, :ci_builds, - name: :temp_fk_e169a8e3d5_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :nullify, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_resources, :fk_e169a8e3d5_p, :temp_fk_e169a8e3d5_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_resources, :p_ci_builds, name: :fk_e169a8e3d5_p) - end -end diff --git a/db/post_migrate/20230620072911_replace_old_fk_ci_build_report_results_to_builds_v2.rb b/db/post_migrate/20230620072911_replace_old_fk_ci_build_report_results_to_builds_v2.rb deleted file mode 100644 index f7d5e703e615a4a661f15290ab227bf77aa66ff2..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620072911_replace_old_fk_ci_build_report_results_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiBuildReportResultsToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_build_report_results, :ci_builds, - name: :fk_rails_16cb1ff064_p, reverse_lock_order: true - - rename_constraint :ci_build_report_results, :temp_fk_rails_16cb1ff064_p, :fk_rails_16cb1ff064_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_build_report_results, :ci_builds, - name: :temp_fk_rails_16cb1ff064_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_build_report_results, :fk_rails_16cb1ff064_p, :temp_fk_rails_16cb1ff064_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_build_report_results, :p_ci_builds, name: :fk_rails_16cb1ff064_p) - end -end diff --git a/db/post_migrate/20230620072915_replace_old_fk_ci_build_needs_to_builds_v2.rb b/db/post_migrate/20230620072915_replace_old_fk_ci_build_needs_to_builds_v2.rb deleted file mode 100644 index a6f93eee035686472f69c5fa5d41b073cc373d63..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620072915_replace_old_fk_ci_build_needs_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiBuildNeedsToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_build_needs, :ci_builds, - name: :fk_rails_3cf221d4ed_p, reverse_lock_order: true - - rename_constraint :ci_build_needs, :temp_fk_rails_3cf221d4ed_p, :fk_rails_3cf221d4ed_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_build_needs, :ci_builds, - name: :temp_fk_rails_3cf221d4ed_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_build_needs, :fk_rails_3cf221d4ed_p, :temp_fk_rails_3cf221d4ed_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_build_needs, :p_ci_builds, name: :fk_rails_3cf221d4ed_p) - end -end diff --git a/db/post_migrate/20230620072917_replace_old_fk_ci_builds_runner_session_to_builds_v2.rb b/db/post_migrate/20230620072917_replace_old_fk_ci_builds_runner_session_to_builds_v2.rb deleted file mode 100644 index 01b9bbee633ba9b0a2c0b1398346b4741d6c046d..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620072917_replace_old_fk_ci_builds_runner_session_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiBuildsRunnerSessionToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_builds_runner_session, :ci_builds, - name: :fk_rails_70707857d3_p, reverse_lock_order: true - - rename_constraint :ci_builds_runner_session, :temp_fk_rails_70707857d3_p, :fk_rails_70707857d3_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_builds_runner_session, :ci_builds, - name: :temp_fk_rails_70707857d3_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_builds_runner_session, :fk_rails_70707857d3_p, :temp_fk_rails_70707857d3_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_builds_runner_session, :p_ci_builds, name: :fk_rails_70707857d3_p) - end -end diff --git a/db/post_migrate/20230620072920_replace_old_fk_ci_pending_builds_to_builds_v2.rb b/db/post_migrate/20230620072920_replace_old_fk_ci_pending_builds_to_builds_v2.rb deleted file mode 100644 index 4861bb646f5972673fd78c32dbdd6b6228e27278..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620072920_replace_old_fk_ci_pending_builds_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiPendingBuildsToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_pending_builds, :ci_builds, - name: :fk_rails_725a2644a3_p, reverse_lock_order: true - - rename_constraint :ci_pending_builds, :temp_fk_rails_725a2644a3_p, :fk_rails_725a2644a3_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_pending_builds, :ci_builds, - name: :temp_fk_rails_725a2644a3_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_pending_builds, :fk_rails_725a2644a3_p, :temp_fk_rails_725a2644a3_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_pending_builds, :p_ci_builds, name: :fk_rails_725a2644a3_p) - end -end diff --git a/db/post_migrate/20230620072925_replace_old_fk_ci_build_trace_metadata_to_builds_v2.rb b/db/post_migrate/20230620072925_replace_old_fk_ci_build_trace_metadata_to_builds_v2.rb deleted file mode 100644 index be004eb512151e81978723a1d049c09aae4c53ba..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620072925_replace_old_fk_ci_build_trace_metadata_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiBuildTraceMetadataToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_build_trace_metadata, :ci_builds, - name: :fk_rails_aebc78111f_p, reverse_lock_order: true - - rename_constraint :ci_build_trace_metadata, :temp_fk_rails_aebc78111f_p, :fk_rails_aebc78111f_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_build_trace_metadata, :ci_builds, - name: :temp_fk_rails_aebc78111f_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_build_trace_metadata, :fk_rails_aebc78111f_p, :temp_fk_rails_aebc78111f_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_build_trace_metadata, :p_ci_builds, name: :fk_rails_aebc78111f_p) - end -end diff --git a/db/post_migrate/20230620105919_replace_old_fk_ci_job_artifacts_to_builds.rb b/db/post_migrate/20230620105919_replace_old_fk_ci_job_artifacts_to_builds.rb deleted file mode 100644 index 33aca3bc858530afcdac57be22ff20c321154512..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620105919_replace_old_fk_ci_job_artifacts_to_builds.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiJobArtifactsToBuilds < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - disable_ddl_transaction! - - def up - return unless should_run? - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_job_artifacts, :ci_builds, - name: :fk_rails_c5137cb2c1_p, reverse_lock_order: true - - rename_constraint :ci_job_artifacts, :temp_fk_rails_c5137cb2c1_p, :fk_rails_c5137cb2c1_p - end - end - - def down - return unless should_run? - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_job_artifacts, :ci_builds, - name: :temp_fk_rails_c5137cb2c1_p, - column: [:partition_id, :job_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_job_artifacts, :fk_rails_c5137cb2c1_p, :temp_fk_rails_c5137cb2c1_p - end - - private - - def should_run? - can_execute_on?(:ci_job_artifacts, :ci_builds) - end - - def new_foreign_key_exists? - foreign_key_exists?(:ci_job_artifacts, :p_ci_builds, name: :fk_rails_c5137cb2c1_p) - end -end diff --git a/db/post_migrate/20230620110004_replace_old_fk_ci_running_builds_to_builds.rb b/db/post_migrate/20230620110004_replace_old_fk_ci_running_builds_to_builds.rb deleted file mode 100644 index 77a6e24f4faddf9f1e0dbcc4d24e675f031d0afe..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620110004_replace_old_fk_ci_running_builds_to_builds.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiRunningBuildsToBuilds < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - disable_ddl_transaction! - - def up - return unless should_run? - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_running_builds, :ci_builds, - name: :fk_rails_da45cfa165_p, reverse_lock_order: true - - rename_constraint :ci_running_builds, :temp_fk_rails_da45cfa165_p, :fk_rails_da45cfa165_p - end - end - - def down - return unless should_run? - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_running_builds, :ci_builds, - name: :temp_fk_rails_da45cfa165_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_running_builds, :fk_rails_da45cfa165_p, :temp_fk_rails_da45cfa165_p - end - - private - - def should_run? - can_execute_on?(:ci_running_builds, :ci_builds) - end - - def new_foreign_key_exists? - foreign_key_exists?(:ci_running_builds, :p_ci_builds, name: :fk_rails_da45cfa165_p) - end -end diff --git a/db/post_migrate/20230620110021_replace_old_fk_ci_job_variables_to_builds.rb b/db/post_migrate/20230620110021_replace_old_fk_ci_job_variables_to_builds.rb deleted file mode 100644 index 9d90c03d38a01f22bca76b2a0ab2e4017c901eac..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620110021_replace_old_fk_ci_job_variables_to_builds.rb +++ /dev/null @@ -1,45 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiJobVariablesToBuilds < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - disable_ddl_transaction! - - def up - return unless should_run? - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_job_variables, :ci_builds, - name: :fk_rails_fbf3b34792_p, reverse_lock_order: true - - rename_constraint :ci_job_variables, :temp_fk_rails_fbf3b34792_p, :fk_rails_fbf3b34792_p - end - end - - def down - return unless should_run? - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_job_variables, :ci_builds, - name: :temp_fk_rails_fbf3b34792_p, - column: [:partition_id, :job_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_job_variables, :fk_rails_fbf3b34792_p, :temp_fk_rails_fbf3b34792_p - end - - private - - def should_run? - can_execute_on?(:ci_job_variables, :ci_builds) - end - - def new_foreign_key_exists? - foreign_key_exists?(:ci_job_variables, :p_ci_builds, name: :fk_rails_fbf3b34792_p) - end -end diff --git a/db/post_migrate/20230620134708_validate_user_type_constraint.rb b/db/post_migrate/20230620134708_validate_user_type_constraint.rb deleted file mode 100644 index cf06e3562d58d058dd71eccb23e0a3a48bfd2e7e..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620134708_validate_user_type_constraint.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class ValidateUserTypeConstraint < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - validate_not_null_constraint(:users, :user_type) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20230620201738_add_index_issues_on_project_health_status_asc_work_item_type.rb b/db/post_migrate/20230620201738_add_index_issues_on_project_health_status_asc_work_item_type.rb deleted file mode 100644 index a1777baa1c2f2745f1eea52d7a2d46c2492f9823..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620201738_add_index_issues_on_project_health_status_asc_work_item_type.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexIssuesOnProjectHealthStatusAscWorkItemType < Gitlab::Database::Migration[2.1] - INDEX_NAME = 'index_issues_on_project_health_status_asc_work_item_type' - - disable_ddl_transaction! - - def up - add_concurrent_index :issues, - [:project_id, :health_status, :id, :state_id, :work_item_type_id], - order: { health_status: 'ASC NULLS LAST', id: :desc }, - name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :issues, INDEX_NAME - end -end diff --git a/db/post_migrate/20230620201817_add_index_issues_on_project_health_status_desc_work_item_type.rb b/db/post_migrate/20230620201817_add_index_issues_on_project_health_status_desc_work_item_type.rb deleted file mode 100644 index 7eaa85bff568fff5ea2b8580c7e7cf0a565895d4..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230620201817_add_index_issues_on_project_health_status_desc_work_item_type.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class AddIndexIssuesOnProjectHealthStatusDescWorkItemType < Gitlab::Database::Migration[2.1] - INDEX_NAME = 'index_issues_on_project_health_status_desc_work_item_type' - - disable_ddl_transaction! - - def up - add_concurrent_index :issues, - [:project_id, :health_status, :id, :state_id, :work_item_type_id], - order: { health_status: 'DESC NULLS LAST', id: :desc }, - name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :issues, INDEX_NAME - end -end diff --git a/db/post_migrate/20230621072848_add_text_limit_to_ci_variable_description.rb b/db/post_migrate/20230621072848_add_text_limit_to_ci_variable_description.rb deleted file mode 100644 index 485ac8bae616a1fcae12c1b3fe2140bca25771a2..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230621072848_add_text_limit_to_ci_variable_description.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToCiVariableDescription < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - TABLE_NAME = :ci_variables - COLUMN_NAME = :description - - def up - add_text_limit(TABLE_NAME, COLUMN_NAME, 255) - end - - def down - remove_text_limit(TABLE_NAME, COLUMN_NAME) - end -end diff --git a/db/post_migrate/20230621083052_add_text_limit_to_ci_group_variable_description.rb b/db/post_migrate/20230621083052_add_text_limit_to_ci_group_variable_description.rb deleted file mode 100644 index b0a5a3d539bb56ab8667ff68b7c756ee829ae34f..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230621083052_add_text_limit_to_ci_group_variable_description.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddTextLimitToCiGroupVariableDescription < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - TABLE_NAME = :ci_group_variables - COLUMN_NAME = :description - - def up - add_text_limit(TABLE_NAME, COLUMN_NAME, 255) - end - - def down - remove_text_limit(TABLE_NAME, COLUMN_NAME) - end -end diff --git a/db/post_migrate/20230621102941_replace_old_fk_ci_job_artifacts_to_builds_v2.rb b/db/post_migrate/20230621102941_replace_old_fk_ci_job_artifacts_to_builds_v2.rb deleted file mode 100644 index 416b1c629c0c7e07e82ddf232b37c624e46c14f9..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230621102941_replace_old_fk_ci_job_artifacts_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiJobArtifactsToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_job_artifacts, :ci_builds, - name: :fk_rails_c5137cb2c1_p, reverse_lock_order: true - - rename_constraint :ci_job_artifacts, :temp_fk_rails_c5137cb2c1_p, :fk_rails_c5137cb2c1_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_job_artifacts, :ci_builds, - name: :temp_fk_rails_c5137cb2c1_p, - column: [:partition_id, :job_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_job_artifacts, :fk_rails_c5137cb2c1_p, :temp_fk_rails_c5137cb2c1_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_job_artifacts, :p_ci_builds, name: :fk_rails_c5137cb2c1_p) - end -end diff --git a/db/post_migrate/20230621103000_replace_old_fk_ci_running_builds_to_builds_v2.rb b/db/post_migrate/20230621103000_replace_old_fk_ci_running_builds_to_builds_v2.rb deleted file mode 100644 index 32702eceb1788c2c7216c03cda42dd4353d053b1..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230621103000_replace_old_fk_ci_running_builds_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiRunningBuildsToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_running_builds, :ci_builds, - name: :fk_rails_da45cfa165_p, reverse_lock_order: true - - rename_constraint :ci_running_builds, :temp_fk_rails_da45cfa165_p, :fk_rails_da45cfa165_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_running_builds, :ci_builds, - name: :temp_fk_rails_da45cfa165_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_running_builds, :fk_rails_da45cfa165_p, :temp_fk_rails_da45cfa165_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_running_builds, :p_ci_builds, name: :fk_rails_da45cfa165_p) - end -end diff --git a/db/post_migrate/20230621103043_replace_old_fk_ci_job_variables_to_builds_v2.rb b/db/post_migrate/20230621103043_replace_old_fk_ci_job_variables_to_builds_v2.rb deleted file mode 100644 index 68ae3dc56afc6f89f70dc5ed5341d5314e7ebd8c..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230621103043_replace_old_fk_ci_job_variables_to_builds_v2.rb +++ /dev/null @@ -1,37 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkCiJobVariablesToBuildsV2 < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - def up - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :ci_job_variables, :ci_builds, - name: :fk_rails_fbf3b34792_p, reverse_lock_order: true - - rename_constraint :ci_job_variables, :temp_fk_rails_fbf3b34792_p, :fk_rails_fbf3b34792_p - end - end - - def down - return unless new_foreign_key_exists? - - add_concurrent_foreign_key :ci_job_variables, :ci_builds, - name: :temp_fk_rails_fbf3b34792_p, - column: [:partition_id, :job_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :ci_job_variables, :fk_rails_fbf3b34792_p, :temp_fk_rails_fbf3b34792_p - end - - private - - def new_foreign_key_exists? - foreign_key_exists?(:ci_job_variables, :p_ci_builds, name: :fk_rails_fbf3b34792_p) - end -end diff --git a/db/post_migrate/20230622052046_remove_ci_pipeline_variables_trigger_and_old_column.rb b/db/post_migrate/20230622052046_remove_ci_pipeline_variables_trigger_and_old_column.rb deleted file mode 100644 index 81ce42c3aabf410f2ec8891d7a1f2ebfef540b52..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230622052046_remove_ci_pipeline_variables_trigger_and_old_column.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class RemoveCiPipelineVariablesTriggerAndOldColumn < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - TABLE = :ci_pipeline_variables - COLUMNS = [:id] - - def up - cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - restore_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end -end diff --git a/db/post_migrate/20230622073752_ensure_backfill_ci_pipelines_bigint_id_is_completed.rb b/db/post_migrate/20230622073752_ensure_backfill_ci_pipelines_bigint_id_is_completed.rb deleted file mode 100644 index 56aeafc0a66bc2c66c260cc5ba7dcb50acfd4cc9..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230622073752_ensure_backfill_ci_pipelines_bigint_id_is_completed.rb +++ /dev/null @@ -1,23 +0,0 @@ -# frozen_string_literal: true - -class EnsureBackfillCiPipelinesBigintIdIsCompleted < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::ConvertToBigint - - restrict_gitlab_migration gitlab_schema: :gitlab_ci - disable_ddl_transaction! - - TABLE_NAME = :ci_pipelines - - def up - ensure_batched_background_migration_is_finished( - job_class_name: 'CopyColumnUsingBackgroundMigrationJob', - table_name: TABLE_NAME, - column_name: 'id', - job_arguments: [['id'], ['id_convert_to_bigint']] - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20230623073906_prepare_async_index_for_ci_pipelines_bigint_id.rb b/db/post_migrate/20230623073906_prepare_async_index_for_ci_pipelines_bigint_id.rb deleted file mode 100644 index 57d4e37ca7cf0bc2e51909d1ca8c2c467a54d66f..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230623073906_prepare_async_index_for_ci_pipelines_bigint_id.rb +++ /dev/null @@ -1,15 +0,0 @@ -# frozen_string_literal: true - -class PrepareAsyncIndexForCiPipelinesBigintId < Gitlab::Database::Migration[2.1] - TABLE_NAME = :ci_pipelines - INDEX_NAME = "index_#{TABLE_NAME}_on_id_convert_to_bigint" - - # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/397000 - def up - prepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: INDEX_NAME - end - - def down - unprepare_async_index TABLE_NAME, :id_convert_to_bigint, unique: true, name: INDEX_NAME - end -end diff --git a/db/post_migrate/20230626070723_drop_unused_sent_notification_columns.rb b/db/post_migrate/20230626070723_drop_unused_sent_notification_columns.rb deleted file mode 100644 index 82a125c1ff53ea68e03cc2300ad1b71dabb29502..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230626070723_drop_unused_sent_notification_columns.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class DropUnusedSentNotificationColumns < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def up - remove_column :sent_notifications, :line_code - remove_column :sent_notifications, :note_type - remove_column :sent_notifications, :position - end - - def down - add_column :sent_notifications, :line_code, :string - add_column :sent_notifications, :note_type, :string - add_column :sent_notifications, :position, :text - end -end diff --git a/db/post_migrate/20230626072436_drop_tmp_index_job_artifacts_id_and_expire_at.rb b/db/post_migrate/20230626072436_drop_tmp_index_job_artifacts_id_and_expire_at.rb deleted file mode 100644 index 3b986a0dc5d6e3ba8d8a7a4775d1b319d385c953..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230626072436_drop_tmp_index_job_artifacts_id_and_expire_at.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class DropTmpIndexJobArtifactsIdAndExpireAt < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - TABLE_NAME = :ci_job_artifacts - INDEX_NAME = :tmp_index_ci_job_artifacts_on_id_expire_at_file_type_trace - - EXPIRE_AT_ON_22_MIDNIGHT_IN_TIMEZONE_OR_TRACE = <<~SQL - (EXTRACT(day FROM timezone('UTC', expire_at)) IN (21, 22, 23) - AND EXTRACT(minute FROM timezone('UTC', expire_at)) IN (0, 30, 45) - AND EXTRACT(second FROM timezone('UTC', expire_at)) = 0) - OR file_type = 3 - SQL - - def up - remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) - end - - def down - add_concurrent_index( - TABLE_NAME, - :id, - where: EXPIRE_AT_ON_22_MIDNIGHT_IN_TIMEZONE_OR_TRACE, - name: INDEX_NAME - ) - end -end diff --git a/db/post_migrate/20230626101519_create_index_for_vulnerability_reads_on_common_project_filters.rb b/db/post_migrate/20230626101519_create_index_for_vulnerability_reads_on_common_project_filters.rb deleted file mode 100644 index 209a2295f22cdc8fef7003eeab1f398dde422786..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230626101519_create_index_for_vulnerability_reads_on_common_project_filters.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class CreateIndexForVulnerabilityReadsOnCommonProjectFilters < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'index_project_vulnerability_reads_common_finder_query_desc' - - def up - add_concurrent_index :vulnerability_reads, - [:project_id, :state, :report_type, :severity, :vulnerability_id], - order: { severity: :desc, vulnerability_id: :desc }, - name: INDEX_NAME - end - - def down - remove_concurrent_index_by_name :vulnerability_reads, INDEX_NAME - end -end diff --git a/db/post_migrate/20230626115046_add_temporary_index_on_vulnerability_reads.rb b/db/post_migrate/20230626115046_add_temporary_index_on_vulnerability_reads.rb deleted file mode 100644 index 8aa5cff2b96e5dd6336172159859db1b2f4f2440..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230626115046_add_temporary_index_on_vulnerability_reads.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class AddTemporaryIndexOnVulnerabilityReads < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = "tmp_idx_vuln_reads_where_dismissal_reason_null" - DISMISSED_STATE = 2 - - def up - add_concurrent_index( - :vulnerability_reads, - %i[id], - where: "state = #{DISMISSED_STATE} AND dismissal_reason IS NULL", - name: INDEX_NAME - ) - end - - def down - remove_concurrent_index_by_name( - :vulnerability_reads, - INDEX_NAME - ) - end -end diff --git a/db/post_migrate/20230627115305_replace_p_ci_builds_metadata_foreign_key_v4.rb b/db/post_migrate/20230627115305_replace_p_ci_builds_metadata_foreign_key_v4.rb deleted file mode 100644 index cb5a5c96b3ce1bac50782da5ffd53a7d28c21ae6..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230627115305_replace_p_ci_builds_metadata_foreign_key_v4.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -class ReplacePCiBuildsMetadataForeignKeyV4 < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - disable_ddl_transaction! - - def up - return unless should_run? - return if foreign_key_exists?(:p_ci_builds_metadata, :p_ci_builds, name: :temp_fk_e20479742e_p) - - with_lock_retries do - execute(<<~SQL.squish) - LOCK TABLE ci_builds, p_ci_builds, p_ci_builds_metadata IN ACCESS EXCLUSIVE MODE; - - ALTER TABLE p_ci_builds_metadata - ADD CONSTRAINT temp_fk_e20479742e_p - FOREIGN KEY (partition_id, build_id) - REFERENCES p_ci_builds (partition_id, id) - ON UPDATE CASCADE ON DELETE CASCADE; - SQL - end - end - - def down - return unless should_run? - - with_lock_retries do - remove_foreign_key_if_exists :p_ci_builds_metadata, :p_ci_builds, - name: :temp_fk_e20479742e_p, - reverse_lock_order: true - end - end - - private - - def should_run? - can_execute_on?(:ci_builds_metadata, :ci_builds) - end -end diff --git a/db/post_migrate/20230627140707_async_index_for_vulnerabilities_uuid_type_migration.rb b/db/post_migrate/20230627140707_async_index_for_vulnerabilities_uuid_type_migration.rb deleted file mode 100644 index cfca60eb02cfc86c470e21167038f783f83bc655..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230627140707_async_index_for_vulnerabilities_uuid_type_migration.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class AsyncIndexForVulnerabilitiesUuidTypeMigration < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = "tmp_idx_vulns_on_converted_uuid" - WHERE_CLAUSE = "uuid_convert_string_to_uuid = '00000000-0000-0000-0000-000000000000'::uuid" - - def up - prepare_async_index( - :vulnerability_occurrences, - %i[id uuid_convert_string_to_uuid], - name: INDEX_NAME, - where: WHERE_CLAUSE - ) - end - - def down - unprepare_async_index( - :vulnerability_occurrences, - %i[id uuid_convert_string_to_uuid], - name: INDEX_NAME - ) - end -end diff --git a/db/post_migrate/20230627174139_add_index_to_pool_repositories.rb b/db/post_migrate/20230627174139_add_index_to_pool_repositories.rb deleted file mode 100644 index bb0ea0609da19807ff2a40763bae89c9f6ae2be2..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230627174139_add_index_to_pool_repositories.rb +++ /dev/null @@ -1,21 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToPoolRepositories < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - TABLE_NAME = :pool_repositories - OLD_INDEX_NAME = :index_pool_repositories_on_disk_path - NEW_INDEX_NAME = :unique_pool_repositories_on_disk_path_and_shard_id - - def up - add_concurrent_index(TABLE_NAME, [:disk_path, :shard_id], name: NEW_INDEX_NAME, unique: true) - - remove_concurrent_index_by_name(TABLE_NAME, OLD_INDEX_NAME) - end - - def down - add_concurrent_index(TABLE_NAME, [:disk_path], name: OLD_INDEX_NAME, unique: true) - - remove_concurrent_index_by_name(TABLE_NAME, NEW_INDEX_NAME) - end -end diff --git a/db/post_migrate/20230628023103_queue_backfill_missing_ci_cd_settings.rb b/db/post_migrate/20230628023103_queue_backfill_missing_ci_cd_settings.rb deleted file mode 100644 index 0fc39e96e183899b62b20a7518ee5f06fb15b5f7..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230628023103_queue_backfill_missing_ci_cd_settings.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class QueueBackfillMissingCiCdSettings < Gitlab::Database::Migration[2.1] - MIGRATION = "BackfillMissingCiCdSettings" - DELAY_INTERVAL = 2.minutes - BATCH_SIZE = 10_000 - SUB_BATCH_SIZE = 500 - - restrict_gitlab_migration gitlab_schema: :gitlab_main - - def up - queue_batched_background_migration( - MIGRATION, - :projects, - :id, - job_interval: DELAY_INTERVAL, - batch_size: BATCH_SIZE, - sub_batch_size: SUB_BATCH_SIZE - ) - end - - def down - delete_batched_background_migration(MIGRATION, :projects, :id, []) - end -end diff --git a/db/post_migrate/20230629011859_cleanup_bigint_conversion_for_notes_for_gitlab_com.rb b/db/post_migrate/20230629011859_cleanup_bigint_conversion_for_notes_for_gitlab_com.rb deleted file mode 100644 index 5b99f4e4778e5f28f246dd876b913cbd94f129be..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230629011859_cleanup_bigint_conversion_for_notes_for_gitlab_com.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class CleanupBigintConversionForNotesForGitlabCom < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::ConvertToBigint - - enable_lock_retries! - - TABLE = :notes - COLUMNS = [:id] - - def up - return unless should_run? - - cleanup_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - def down - return unless should_run? - - restore_conversion_of_integer_to_bigint(TABLE, COLUMNS) - end - - private - - def should_run? - com_or_dev_or_test_but_not_jh? - end -end diff --git a/db/post_migrate/20230629024032_ensure_events_bigint_backfill_is_finished_for_gitlab_dot_com.rb b/db/post_migrate/20230629024032_ensure_events_bigint_backfill_is_finished_for_gitlab_dot_com.rb deleted file mode 100644 index 236b785c163f7161fe894bc2148503a492ffe525..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230629024032_ensure_events_bigint_backfill_is_finished_for_gitlab_dot_com.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class EnsureEventsBigintBackfillIsFinishedForGitlabDotCom < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::ConvertToBigint - - restrict_gitlab_migration gitlab_schema: :gitlab_main - disable_ddl_transaction! - - def up - return unless should_run? - - ensure_batched_background_migration_is_finished( - job_class_name: 'CopyColumnUsingBackgroundMigrationJob', - table_name: 'events', - column_name: 'id', - job_arguments: [['target_id'], ['target_id_convert_to_bigint']] - ) - end - - def down - # no-op - end - - private - - def should_run? - com_or_dev_or_test_but_not_jh? - end -end diff --git a/db/post_migrate/20230629024403_events_bigint_create_indexe_async_for_gitlab_dot_com.rb b/db/post_migrate/20230629024403_events_bigint_create_indexe_async_for_gitlab_dot_com.rb deleted file mode 100644 index 13691034fd7d00c42ffe17eec04a390fedaac94a..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230629024403_events_bigint_create_indexe_async_for_gitlab_dot_com.rb +++ /dev/null @@ -1,28 +0,0 @@ -# frozen_string_literal: true - -class EventsBigintCreateIndexeAsyncForGitlabDotCom < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::ConvertToBigint - - def up - return unless should_run? - - prepare_async_index :events, - [:target_type, :target_id_convert_to_bigint, :fingerprint], - name: :index_events_on_target_type_and_target_id_bigint_fingerprint, - unique: true - end - - def down - return unless should_run? - - unprepare_async_index :events, - [:target_type, :target_id_convert_to_bigint, :fingerprint], - name: :index_events_on_target_type_and_target_id_bigint_fingerprint - end - - private - - def should_run? - com_or_dev_or_test_but_not_jh? - end -end diff --git a/db/post_migrate/20230629095819_queue_backfill_uuid_conversion_column_in_vulnerability_occurrences.rb b/db/post_migrate/20230629095819_queue_backfill_uuid_conversion_column_in_vulnerability_occurrences.rb deleted file mode 100644 index 0ea7e2da38ce4864541e439b5fa2f349a13dc10e..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230629095819_queue_backfill_uuid_conversion_column_in_vulnerability_occurrences.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -class QueueBackfillUuidConversionColumnInVulnerabilityOccurrences < Gitlab::Database::Migration[2.1] - MIGRATION = "BackfillUuidConversionColumnInVulnerabilityOccurrences" - DELAY_INTERVAL = 2.minutes - BATCH_SIZE = 10_000 - SUB_BATCH_SIZE = 1000 - - restrict_gitlab_migration gitlab_schema: :gitlab_main - - def up - queue_batched_background_migration( - MIGRATION, - :vulnerability_occurrences, - :id, - job_interval: DELAY_INTERVAL, - batch_size: BATCH_SIZE, - sub_batch_size: SUB_BATCH_SIZE - ) - end - - def down - delete_batched_background_migration(MIGRATION, :vulnerability_occurrences, :id, []) - end -end diff --git a/db/post_migrate/20230703024031_cleanup_project_pipeline_status_key.rb b/db/post_migrate/20230703024031_cleanup_project_pipeline_status_key.rb deleted file mode 100644 index 5b457c277b6b11b5ede76c1f6d97e39592f94b30..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230703024031_cleanup_project_pipeline_status_key.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class CleanupProjectPipelineStatusKey < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - restrict_gitlab_migration gitlab_schema: :gitlab_main - - MIGRATION_WORKER_CLASS = 'BackfillProjectPipelineStatusTtl' - - def up - queue_redis_migration_job(MIGRATION_WORKER_CLASS) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20230703122803_create_vulnerability_uuid_type_migration_index.rb b/db/post_migrate/20230703122803_create_vulnerability_uuid_type_migration_index.rb deleted file mode 100644 index f5ac2c2d0b972812ad735161899a2b0c47202371..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230703122803_create_vulnerability_uuid_type_migration_index.rb +++ /dev/null @@ -1,11 +0,0 @@ -# frozen_string_literal: true - -class CreateVulnerabilityUuidTypeMigrationIndex < Gitlab::Database::Migration[2.1] - def up - # no-op due to https://gitlab.com/gitlab-com/gl-infra/production/-/issues/15983 - end - - def down - # no-op due to https://gitlab.com/gitlab-com/gl-infra/production/-/issues/15983 - end -end diff --git a/db/post_migrate/20230704042302_prepare_removal_index_deployments_on_project_id_sha.rb b/db/post_migrate/20230704042302_prepare_removal_index_deployments_on_project_id_sha.rb deleted file mode 100644 index 3ab42c70d8aa4be45f6d153d1e1b8198107b00cc..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230704042302_prepare_removal_index_deployments_on_project_id_sha.rb +++ /dev/null @@ -1,14 +0,0 @@ -# frozen_string_literal: true - -class PrepareRemovalIndexDeploymentsOnProjectIdSha < Gitlab::Database::Migration[2.1] - INDEX_NAME = 'index_deployments_on_project_id_sha' - - # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/402512 - def up - prepare_async_index_removal :deployments, %i[project_id sha], name: INDEX_NAME - end - - def down - unprepare_async_index :deployments, %i[project_id sha], name: INDEX_NAME - end -end diff --git a/db/post_migrate/20230704044541_prepare_removal_index_deployments_on_project_id_and_status.rb b/db/post_migrate/20230704044541_prepare_removal_index_deployments_on_project_id_and_status.rb deleted file mode 100644 index 0098eaabf76e6ce6bcaf1f1575afc9c04300cd5d..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230704044541_prepare_removal_index_deployments_on_project_id_and_status.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class PrepareRemovalIndexDeploymentsOnProjectIdAndStatus < Gitlab::Database::Migration[2.1] - INDEX_NAME = 'index_deployments_on_project_id_and_status' - - def up - prepare_async_index_removal :deployments, %i[project_id status], name: INDEX_NAME - end - - def down - unprepare_async_index :deployments, %i[project_id status], name: INDEX_NAME - end -end diff --git a/db/post_migrate/20230704050739_prepare_removal_index_deployments_on_environment_id_and_iid_and_project_id.rb b/db/post_migrate/20230704050739_prepare_removal_index_deployments_on_environment_id_and_iid_and_project_id.rb deleted file mode 100644 index 204579d6e1872889fb6ab205cb178a070d4cbbd2..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230704050739_prepare_removal_index_deployments_on_environment_id_and_iid_and_project_id.rb +++ /dev/null @@ -1,13 +0,0 @@ -# frozen_string_literal: true - -class PrepareRemovalIndexDeploymentsOnEnvironmentIdAndIidAndProjectId < Gitlab::Database::Migration[2.1] - INDEX_NAME = 'index_deployments_on_environment_id_and_iid_and_project_id' - - def up - prepare_async_index_removal :deployments, %i[environment_id iid project_id], name: INDEX_NAME - end - - def down - unprepare_async_index :deployments, %i[environment_id iid project_id], name: INDEX_NAME - end -end diff --git a/db/post_migrate/20230704062132_replace_p_ci_builds_metadata_foreign_key_v5.rb b/db/post_migrate/20230704062132_replace_p_ci_builds_metadata_foreign_key_v5.rb deleted file mode 100644 index c535c54b0227b018bb3103404c514dd35d3b28f4..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230704062132_replace_p_ci_builds_metadata_foreign_key_v5.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class ReplacePCiBuildsMetadataForeignKeyV5 < Gitlab::Database::Migration[2.1] - include Gitlab::Database::PartitioningMigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_partitioned_foreign_key :p_ci_builds_metadata, :p_ci_builds, - name: :temp_fk_e20479742e_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :p_ci_builds_metadata, :p_ci_builds, - name: :temp_fk_e20479742e_p, - reverse_lock_order: true - end - end -end diff --git a/db/post_migrate/20230704062136_replace_p_ci_runner_machine_builds_foreign_key_v4.rb b/db/post_migrate/20230704062136_replace_p_ci_runner_machine_builds_foreign_key_v4.rb deleted file mode 100644 index 6cb8440bee8b112b6d41b0020b4f1d2898d9d8d9..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230704062136_replace_p_ci_runner_machine_builds_foreign_key_v4.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -class ReplacePCiRunnerMachineBuildsForeignKeyV4 < Gitlab::Database::Migration[2.1] - include Gitlab::Database::PartitioningMigrationHelpers - - disable_ddl_transaction! - - def up - add_concurrent_partitioned_foreign_key :p_ci_runner_machine_builds, :p_ci_builds, - name: :temp_fk_bb490f12fe_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - end - - def down - with_lock_retries do - remove_foreign_key_if_exists :p_ci_runner_machine_builds, :p_ci_builds, - name: :temp_fk_bb490f12fe_p, - reverse_lock_order: true - end - end -end diff --git a/db/post_migrate/20230704074120_replace_old_fk_p_ci_builds_metadata_to_builds.rb b/db/post_migrate/20230704074120_replace_old_fk_p_ci_builds_metadata_to_builds.rb deleted file mode 100644 index 49f2066d7bff14dea4128a9d9ca6831120beb60b..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230704074120_replace_old_fk_p_ci_builds_metadata_to_builds.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkPCiBuildsMetadataToBuilds < Gitlab::Database::Migration[2.1] - include Gitlab::Database::PartitioningMigrationHelpers - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - disable_ddl_transaction! - - def up - return unless should_run? - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :p_ci_builds_metadata, :ci_builds, - name: :fk_e20479742e_p, reverse_lock_order: true - - rename_constraint :p_ci_builds_metadata, :temp_fk_e20479742e_p, :fk_e20479742e_p - - Gitlab::Database::PostgresPartitionedTable.each_partition(:p_ci_builds_metadata) do |partition| - rename_constraint partition.identifier, :temp_fk_e20479742e_p, :fk_e20479742e_p - end - end - end - - def down - return unless should_run? - return unless new_foreign_key_exists? - - add_concurrent_partitioned_foreign_key :p_ci_builds_metadata, :ci_builds, - name: :temp_fk_e20479742e_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :p_ci_builds_metadata, :fk_e20479742e_p, :temp_fk_e20479742e_p - - Gitlab::Database::PostgresPartitionedTable.each_partition(:p_ci_builds_metadata) do |partition| - switch_constraint_names partition.identifier, :fk_e20479742e_p, :temp_fk_e20479742e_p - end - end - - private - - def should_run? - can_execute_on?(:ci_builds_metadata, :ci_builds) - end - - def new_foreign_key_exists? - foreign_key_exists?(:p_ci_builds_metadata, :p_ci_builds, name: :fk_e20479742e_p) - end -end diff --git a/db/post_migrate/20230704074124_replace_old_fk_p_ci_runner_machine_builds_to_builds.rb b/db/post_migrate/20230704074124_replace_old_fk_p_ci_runner_machine_builds_to_builds.rb deleted file mode 100644 index b1d58058cef95d1072c31f6d55e70737040d44e0..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230704074124_replace_old_fk_p_ci_runner_machine_builds_to_builds.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkPCiRunnerMachineBuildsToBuilds < Gitlab::Database::Migration[2.1] - include Gitlab::Database::PartitioningMigrationHelpers - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - disable_ddl_transaction! - - def up - return unless should_run? - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :p_ci_runner_machine_builds, :ci_builds, - name: :fk_bb490f12fe_p, reverse_lock_order: true - - rename_constraint :p_ci_runner_machine_builds, :temp_fk_bb490f12fe_p, :fk_bb490f12fe_p - - Gitlab::Database::PostgresPartitionedTable.each_partition(:p_ci_runner_machine_builds) do |partition| - rename_constraint partition.identifier, :temp_fk_bb490f12fe_p, :fk_bb490f12fe_p - end - end - end - - def down - return unless should_run? - return unless new_foreign_key_exists? - - add_concurrent_partitioned_foreign_key :p_ci_runner_machine_builds, :ci_builds, - name: :temp_fk_bb490f12fe_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :p_ci_runner_machine_builds, :fk_bb490f12fe_p, :temp_fk_bb490f12fe_p - - Gitlab::Database::PostgresPartitionedTable.each_partition(:p_ci_runner_machine_builds) do |partition| - switch_constraint_names partition.identifier, :fk_bb490f12fe_p, :temp_fk_bb490f12fe_p - end - end - - private - - def should_run? - can_execute_on?(:ci_builds) - end - - def new_foreign_key_exists? - foreign_key_exists?(:p_ci_runner_machine_builds, :p_ci_builds, name: :fk_bb490f12fe_p) - end -end diff --git a/db/post_migrate/20230705115215_remove_user_details_provisioned_by_group_at_column.rb b/db/post_migrate/20230705115215_remove_user_details_provisioned_by_group_at_column.rb deleted file mode 100644 index 33844f6714e7517a8d18375abef848e12f66f066..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230705115215_remove_user_details_provisioned_by_group_at_column.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class RemoveUserDetailsProvisionedByGroupAtColumn < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def change - remove_column :user_details, :provisioned_by_group_at, :datetime_with_timezone - end -end diff --git a/db/post_migrate/20230705141703_rollback_vulnerability_advisories_foreign_key_on_vulnerable_component_versions.rb b/db/post_migrate/20230705141703_rollback_vulnerability_advisories_foreign_key_on_vulnerable_component_versions.rb deleted file mode 100644 index 92feca765114bd37baf60a5bdc372755b9d5c7af..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230705141703_rollback_vulnerability_advisories_foreign_key_on_vulnerable_component_versions.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RollbackVulnerabilityAdvisoriesForeignKeyOnVulnerableComponentVersions < Gitlab::Database::Migration[2.1] - SOURCE_TABLE = :sbom_vulnerable_component_versions - TARGET_TABLE = :vulnerability_advisories - COLUMN = :vulnerability_advisory_id - - disable_ddl_transaction! - - def up - # Foreign key is removed when the table is dropped in the next migration. - end - - def down - add_concurrent_foreign_key SOURCE_TABLE, TARGET_TABLE, column: COLUMN, on_delete: :cascade - end -end diff --git a/db/post_migrate/20230705141733_rollback_component_version_foreign_key_on_vulnerable_component_versions.rb b/db/post_migrate/20230705141733_rollback_component_version_foreign_key_on_vulnerable_component_versions.rb deleted file mode 100644 index c54d4ebd1e30869f76495744b4514bd4f51167f2..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230705141733_rollback_component_version_foreign_key_on_vulnerable_component_versions.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RollbackComponentVersionForeignKeyOnVulnerableComponentVersions < Gitlab::Database::Migration[2.1] - SOURCE_TABLE = :sbom_vulnerable_component_versions - TARGET_TABLE = :sbom_component_versions - COLUMN = :sbom_component_version_id - - disable_ddl_transaction! - - def up - # Foreign key is removed when the table is dropped in the next migration. - end - - def down - add_concurrent_foreign_key SOURCE_TABLE, TARGET_TABLE, column: COLUMN, on_delete: :cascade - end -end diff --git a/db/post_migrate/20230705142241_drop_vulnerable_component_versions.rb b/db/post_migrate/20230705142241_drop_vulnerable_component_versions.rb deleted file mode 100644 index 10432f6b5158f9b7a99e92416b0e1cffe1471126..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230705142241_drop_vulnerable_component_versions.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class DropVulnerableComponentVersions < Gitlab::Database::Migration[2.1] - ADVISORY_INDEX_NAME = "index_vulnerable_component_versions_on_vulnerability_advisory" - SBOM_COMPONENT_INDEX_NAME = "index_vulnerable_component_versions_on_sbom_component_version" - - def up - drop_table :sbom_vulnerable_component_versions - end - - def down - create_table :sbom_vulnerable_component_versions do |t| - t.references :vulnerability_advisory, - index: { name: ADVISORY_INDEX_NAME } - - t.references :sbom_component_version, - index: { name: SBOM_COMPONENT_INDEX_NAME } - - t.timestamps_with_timezone null: false - end - end -end diff --git a/db/post_migrate/20230705142334_drop_vulnerabilities_advisories.rb b/db/post_migrate/20230705142334_drop_vulnerabilities_advisories.rb deleted file mode 100644 index e6bee52eb0cd09284f1c58045d9f43d82a9059cc..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230705142334_drop_vulnerabilities_advisories.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class DropVulnerabilitiesAdvisories < Gitlab::Database::Migration[2.1] - def up - drop_table :vulnerability_advisories - end - - def down - create_table :vulnerability_advisories, id: false do |t| - t.uuid :uuid, null: false - t.timestamps_with_timezone null: false - t.primary_key :id - t.date :created_date, null: false - t.date :published_date, null: false - t.text :description, limit: 2048 - t.text :title, limit: 2048 - t.text :component_name, limit: 2048 - t.text :solution, limit: 2048 - t.text :not_impacted, limit: 2048 - t.text :cvss_v2, limit: 128 - t.text :cvss_v3, limit: 128 - t.text :affected_range, limit: 32 - t.text :identifiers, array: true, default: [] - t.text :fixed_versions, array: true, default: [] - t.text :urls, array: true, default: [] - t.text :links, array: true, default: [] - end - end -end diff --git a/db/post_migrate/20230705145827_drop_wrong_index_on_vulnerability_occurrences.rb b/db/post_migrate/20230705145827_drop_wrong_index_on_vulnerability_occurrences.rb deleted file mode 100644 index 6b4089f72fe63e0df3d3ff94dffa8df2ad59269e..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230705145827_drop_wrong_index_on_vulnerability_occurrences.rb +++ /dev/null @@ -1,22 +0,0 @@ -# frozen_string_literal: true - -class DropWrongIndexOnVulnerabilityOccurrences < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'tmp_idx_vulns_on_converted_uuid' - - def up - # We do not want to drop this from Gitlab.com - # because it was created correctly there - return if Gitlab.com? && !Gitlab.dev_or_test_env? - - remove_concurrent_index_by_name( - :vulnerability_occurrences, - INDEX_NAME - ) - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20230705150100_recreate_type_migration_index_on_vulnerability_occurrences.rb b/db/post_migrate/20230705150100_recreate_type_migration_index_on_vulnerability_occurrences.rb deleted file mode 100644 index 9e426c61874cec3870d0a492567bc092ae12639b..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230705150100_recreate_type_migration_index_on_vulnerability_occurrences.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class RecreateTypeMigrationIndexOnVulnerabilityOccurrences < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'tmp_idx_vulns_on_converted_uuid' - WHERE_CLAUSE = "uuid_convert_string_to_uuid = '00000000-0000-0000-0000-000000000000'::uuid" - - def up - add_concurrent_index( - :vulnerability_occurrences, - %i[id uuid_convert_string_to_uuid], - name: INDEX_NAME, - where: WHERE_CLAUSE - ) - end - - def down - remove_concurrent_index_by_name( - :vulnerability_occurrences, - INDEX_NAME - ) - end -end diff --git a/db/post_migrate/20230706011541_add_user_id_foreign_key_to_ml_experiments.rb b/db/post_migrate/20230706011541_add_user_id_foreign_key_to_ml_experiments.rb deleted file mode 100644 index 77059d89d300980707946deae2a0b0f2db11cd2d..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230706011541_add_user_id_foreign_key_to_ml_experiments.rb +++ /dev/null @@ -1,31 +0,0 @@ -# frozen_string_literal: true - -class AddUserIdForeignKeyToMlExperiments < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - NEW_FK_NAME = 'fk_ml_experiments_on_user_id' - OLD_FK_NAME = 'fk_rails_1fbc5e001f' - - def up - add_concurrent_foreign_key(:ml_experiments, :users, column: :user_id, on_delete: :nullify, - name: NEW_FK_NAME, validate: true) - - with_lock_retries do - remove_foreign_key_if_exists(:ml_experiments, name: OLD_FK_NAME) - end - end - - def down - unless foreign_key_exists?(:ml_experiments, :users, name: OLD_FK_NAME) - with_lock_retries do - execute(<<~SQL.squish) - ALTER TABLE ml_experiments ADD CONSTRAINT #{OLD_FK_NAME} FOREIGN KEY (user_id) REFERENCES users (id) - SQL - end - end - - with_lock_retries do - remove_foreign_key_if_exists(:ml_experiments, name: NEW_FK_NAME) - end - end -end diff --git a/db/post_migrate/20230706073937_remove_index_events_on_project_id_and_id_desc_on_merged_action.rb b/db/post_migrate/20230706073937_remove_index_events_on_project_id_and_id_desc_on_merged_action.rb deleted file mode 100644 index 4d7cdc000d56a46223757c8936237c403da0c77c..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230706073937_remove_index_events_on_project_id_and_id_desc_on_merged_action.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class RemoveIndexEventsOnProjectIdAndIdDescOnMergedAction < Gitlab::Database::Migration[2.1] - INDEX_NAME = 'index_events_on_project_id_and_id_desc_on_merged_action' - - disable_ddl_transaction! - - def up - remove_concurrent_index(:events, [:project_id, :id], order: { id: :desc }, - where: "action = 7", name: INDEX_NAME) - end - - def down - add_concurrent_index(:events, [:project_id, :id], order: { id: :desc }, - where: "action = 7", name: INDEX_NAME) - end -end diff --git a/db/post_migrate/20230706080234_add_trigger_on_organizations.rb b/db/post_migrate/20230706080234_add_trigger_on_organizations.rb deleted file mode 100644 index e21a5e0eb23b4e5e8c89c846c807446c11c59095..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230706080234_add_trigger_on_organizations.rb +++ /dev/null @@ -1,29 +0,0 @@ -# frozen_string_literal: true - -class AddTriggerOnOrganizations < Gitlab::Database::Migration[2.1] - include Gitlab::Database::SchemaHelpers - - TABLE_NAME = 'organizations' - FUNCTION_NAME = 'prevent_delete_of_default_organization' - TRIGGER_NAME = 'prevent_delete_of_default_organization_before_destroy' - - def up - default_org_id = Organizations::Organization::DEFAULT_ORGANIZATION_ID - - create_trigger_function(FUNCTION_NAME) do - <<~SQL - IF OLD.id = #{default_org_id} THEN - RAISE EXCEPTION 'Deletion of the default Organization is not allowed.'; - END IF; - RETURN OLD; - SQL - end - - create_trigger(TABLE_NAME, TRIGGER_NAME, FUNCTION_NAME, fires: 'BEFORE DELETE') - end - - def down - drop_trigger(TABLE_NAME, TRIGGER_NAME) - drop_function(FUNCTION_NAME) - end -end diff --git a/db/post_migrate/20230707114012_change_project_view_default.rb b/db/post_migrate/20230707114012_change_project_view_default.rb deleted file mode 100644 index 6437a650261b2159439b188972613295979f3b68..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230707114012_change_project_view_default.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -class ChangeProjectViewDefault < Gitlab::Database::Migration[2.1] - enable_lock_retries! - - def change - change_column_default(:users, :project_view, from: 0, to: 2) - end -end diff --git a/db/post_migrate/20230707211358_deduplicate_inactive_alert_integrations.rb b/db/post_migrate/20230707211358_deduplicate_inactive_alert_integrations.rb deleted file mode 100644 index 041ce659da6ccd2652fb633b59a414c48b6b0a19..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230707211358_deduplicate_inactive_alert_integrations.rb +++ /dev/null @@ -1,40 +0,0 @@ -# frozen_string_literal: true - -class DeduplicateInactiveAlertIntegrations < Gitlab::Database::Migration[2.1] - restrict_gitlab_migration gitlab_schema: :gitlab_main - - class HttpIntegration < MigrationRecord - self.table_name = 'alert_management_http_integrations' - end - - # Existing unique index ensures that all active integrations are already unique. - # Any non-unique records must be inactive by definition, but dups are unlikely. - # At time of writing, gitlab.com has 0 records in this state. - # Of the ~1600 integrations, only ~100 are even inactive. - def up - duplicated_identifiers.each do |(project_id, endpoint_identifier)| - find_inactive_integrations(project_id, endpoint_identifier).delete_all - end - end - - def down - # no-op -> unable to identify duplicates retroactively - end - - private - - def duplicated_identifiers - HttpIntegration - .group(:project_id, :endpoint_identifier) - .having('count(id) > 1') - .pluck(:project_id, :endpoint_identifier) - end - - def find_inactive_integrations(project_id, endpoint_identifier) - HttpIntegration.where( - project_id: project_id, - endpoint_identifier: endpoint_identifier, - active: false - ) - end -end diff --git a/db/post_migrate/20230707211359_change_alert_integrations_unique_index.rb b/db/post_migrate/20230707211359_change_alert_integrations_unique_index.rb deleted file mode 100644 index eac5d057b40ca7bc7a5618c458195b5fec2d4cdd..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230707211359_change_alert_integrations_unique_index.rb +++ /dev/null @@ -1,33 +0,0 @@ -# frozen_string_literal: true - -# Swaps the unique index for AlertManagement::HttpIntegration to include -# inactive integrations, making performance optimizations easier. -# -# At time of writing, gitlab.com has 0 records which would be invalidated -# by the new index. Of the ~1600 integrations, only ~100 are inactive, so the -# size of the index will not significantly change. -class ChangeAlertIntegrationsUniqueIndex < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - UNIQUE_INDEX_NAME = 'index_http_integrations_on_project_and_endpoint' - OLD_INDEX_NAME = 'index_http_integrations_on_active_and_project_and_endpoint' - - def up - add_concurrent_index :alert_management_http_integrations, - [:project_id, :endpoint_identifier], - name: UNIQUE_INDEX_NAME, - unique: true - - remove_concurrent_index_by_name :alert_management_http_integrations, OLD_INDEX_NAME - end - - def down - add_concurrent_index :alert_management_http_integrations, - [:active, :project_id, :endpoint_identifier], - unique: true, - name: OLD_INDEX_NAME, - where: 'active' - - remove_concurrent_index_by_name :alert_management_http_integrations, UNIQUE_INDEX_NAME - end -end diff --git a/db/post_migrate/20230707220646_add_index_to_vulnerability_findings_on_uuid_again.rb b/db/post_migrate/20230707220646_add_index_to_vulnerability_findings_on_uuid_again.rb deleted file mode 100644 index 06d0117d50ed7f7c330d56e022826b97c359e690..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230707220646_add_index_to_vulnerability_findings_on_uuid_again.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true - -class AddIndexToVulnerabilityFindingsOnUuidAgain < Gitlab::Database::Migration[2.1] - INDEX_NAME = 'index_vuln_findings_on_uuid_including_vuln_id' - - def up - Gitlab::Database::AsyncIndexes::PostgresAsyncIndex.where(name: INDEX_NAME).find_each do |record| - record.definition = record.definition.strip - record.save! - end - end - - def down - # no-op - end -end diff --git a/db/post_migrate/20230711093010_drop_default_partition_id_value_for_ci_tables.rb b/db/post_migrate/20230711093010_drop_default_partition_id_value_for_ci_tables.rb deleted file mode 100644 index 733cab057f6d1fe4e4b0d4c325dc1408c6831298..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230711093010_drop_default_partition_id_value_for_ci_tables.rb +++ /dev/null @@ -1,39 +0,0 @@ -# frozen_string_literal: true - -class DropDefaultPartitionIdValueForCiTables < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - TABLES = { - ci_build_needs: [:partition_id], - ci_build_pending_states: [:partition_id], - ci_build_report_results: [:partition_id], - ci_build_trace_chunks: [:partition_id], - ci_builds_runner_session: [:partition_id], - ci_job_variables: [:partition_id], - ci_pending_builds: [:partition_id], - ci_pipelines: [:partition_id], - ci_running_builds: [:partition_id], - ci_sources_pipelines: [:partition_id, :source_partition_id], - ci_unit_test_failures: [:partition_id] - } - - def up - TABLES.each do |table_name, columns| - with_lock_retries do - columns.each do |column_name| # rubocop:disable Migration/WithLockRetriesDisallowedMethod - change_column_default(table_name, column_name, from: 100, to: nil) - end - end - end - end - - def down - TABLES.each do |table_name, columns| - with_lock_retries do - columns.each do |column_name| # rubocop:disable Migration/WithLockRetriesDisallowedMethod - change_column_default(table_name, column_name, from: nil, to: 100) - end - end - end - end -end diff --git a/db/post_migrate/20230712020407_remove_temporary_index_from_system_note_metadata.rb b/db/post_migrate/20230712020407_remove_temporary_index_from_system_note_metadata.rb deleted file mode 100644 index 9000ef208d65ed7d9abd0f4f900d7655ec3af3a0..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230712020407_remove_temporary_index_from_system_note_metadata.rb +++ /dev/null @@ -1,18 +0,0 @@ -# frozen_string_literal: true - -class RemoveTemporaryIndexFromSystemNoteMetadata < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - INDEX_NAME = 'tmp_index_for_backfilling_resource_link_events' - CONDITION = "action='relate_to_parent' OR action='unrelate_from_parent'" - - def up - remove_concurrent_index_by_name :system_note_metadata, INDEX_NAME - end - - def down - add_concurrent_index :system_note_metadata, :id, - where: CONDITION, - name: INDEX_NAME - end -end diff --git a/db/post_migrate/20230712064637_replace_old_fk_p_ci_builds_metadata_to_builds_v2.rb b/db/post_migrate/20230712064637_replace_old_fk_p_ci_builds_metadata_to_builds_v2.rb deleted file mode 100644 index 6165029d855e77ffba0cad03312db161a2497eee..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230712064637_replace_old_fk_p_ci_builds_metadata_to_builds_v2.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkPCiBuildsMetadataToBuildsV2 < Gitlab::Database::Migration[2.1] - include Gitlab::Database::PartitioningMigrationHelpers - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - disable_ddl_transaction! - - def up - return unless should_run? - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :p_ci_builds_metadata, :ci_builds, - name: :fk_e20479742e_p, reverse_lock_order: true - - rename_constraint :p_ci_builds_metadata, :temp_fk_e20479742e_p, :fk_e20479742e_p - - Gitlab::Database::PostgresPartitionedTable.each_partition(:p_ci_builds_metadata) do |partition| - rename_constraint partition.identifier, :temp_fk_e20479742e_p, :fk_e20479742e_p - end - end - end - - def down - return unless should_run? - return unless new_foreign_key_exists? - - add_concurrent_partitioned_foreign_key :p_ci_builds_metadata, :ci_builds, - name: :temp_fk_e20479742e_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :p_ci_builds_metadata, :fk_e20479742e_p, :temp_fk_e20479742e_p - - Gitlab::Database::PostgresPartitionedTable.each_partition(:p_ci_builds_metadata) do |partition| - switch_constraint_names partition.identifier, :fk_e20479742e_p, :temp_fk_e20479742e_p - end - end - - private - - def should_run? - can_execute_on?(:ci_builds_metadata, :ci_builds) - end - - def new_foreign_key_exists? - foreign_key_exists?(:p_ci_builds_metadata, :p_ci_builds, name: :fk_e20479742e_p) - end -end diff --git a/db/post_migrate/20230712064655_replace_old_fk_p_ci_runner_machine_builds_to_builds_v2.rb b/db/post_migrate/20230712064655_replace_old_fk_p_ci_runner_machine_builds_to_builds_v2.rb deleted file mode 100644 index 8f1c1872e045d4f0a44a401512ea3c37286d8381..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230712064655_replace_old_fk_p_ci_runner_machine_builds_to_builds_v2.rb +++ /dev/null @@ -1,54 +0,0 @@ -# frozen_string_literal: true - -class ReplaceOldFkPCiRunnerMachineBuildsToBuildsV2 < Gitlab::Database::Migration[2.1] - include Gitlab::Database::PartitioningMigrationHelpers - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - disable_ddl_transaction! - - def up - return unless should_run? - return if new_foreign_key_exists? - - with_lock_retries do - remove_foreign_key_if_exists :p_ci_runner_machine_builds, :ci_builds, - name: :fk_bb490f12fe_p, reverse_lock_order: true - - rename_constraint :p_ci_runner_machine_builds, :temp_fk_bb490f12fe_p, :fk_bb490f12fe_p - - Gitlab::Database::PostgresPartitionedTable.each_partition(:p_ci_runner_machine_builds) do |partition| - rename_constraint partition.identifier, :temp_fk_bb490f12fe_p, :fk_bb490f12fe_p - end - end - end - - def down - return unless should_run? - return unless new_foreign_key_exists? - - add_concurrent_partitioned_foreign_key :p_ci_runner_machine_builds, :ci_builds, - name: :temp_fk_bb490f12fe_p, - column: [:partition_id, :build_id], - target_column: [:partition_id, :id], - on_update: :cascade, - on_delete: :cascade, - validate: true, - reverse_lock_order: true - - switch_constraint_names :p_ci_runner_machine_builds, :fk_bb490f12fe_p, :temp_fk_bb490f12fe_p - - Gitlab::Database::PostgresPartitionedTable.each_partition(:p_ci_runner_machine_builds) do |partition| - switch_constraint_names partition.identifier, :fk_bb490f12fe_p, :temp_fk_bb490f12fe_p - end - end - - private - - def should_run? - can_execute_on?(:ci_builds) - end - - def new_foreign_key_exists? - foreign_key_exists?(:p_ci_runner_machine_builds, :p_ci_builds, name: :fk_bb490f12fe_p) - end -end diff --git a/db/post_migrate/20230712145323_drop_ci_job_artifacts_partition_id_default.rb b/db/post_migrate/20230712145323_drop_ci_job_artifacts_partition_id_default.rb deleted file mode 100644 index af475ba62d0fdc48ac16e113131dd0f865b8308c..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230712145323_drop_ci_job_artifacts_partition_id_default.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class DropCiJobArtifactsPartitionIdDefault < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - enable_lock_retries! - - TABLE_NAME = :ci_job_artifacts - COLUMN_NAME = :partition_id - - def up - change_column_default(TABLE_NAME, COLUMN_NAME, from: 100, to: nil) if should_run? - end - - def down - change_column_default(TABLE_NAME, COLUMN_NAME, from: nil, to: 100) if should_run? - end - - private - - def should_run? - can_execute_on?(TABLE_NAME) - end -end diff --git a/db/post_migrate/20230712145821_drop_ci_stages_partition_id_default.rb b/db/post_migrate/20230712145821_drop_ci_stages_partition_id_default.rb deleted file mode 100644 index a7c23ac35d2b882f2bb80887fa1fd388386ba68b..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230712145821_drop_ci_stages_partition_id_default.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class DropCiStagesPartitionIdDefault < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - enable_lock_retries! - - TABLE_NAME = :ci_stages - COLUMN_NAME = :partition_id - - def up - change_column_default(TABLE_NAME, COLUMN_NAME, from: 100, to: nil) if should_run? - end - - def down - change_column_default(TABLE_NAME, COLUMN_NAME, from: nil, to: 100) if should_run? - end - - private - - def should_run? - can_execute_on?(TABLE_NAME) - end -end diff --git a/db/post_migrate/20230712145926_drop_ci_build_trace_metadata_partition_id_default.rb b/db/post_migrate/20230712145926_drop_ci_build_trace_metadata_partition_id_default.rb deleted file mode 100644 index dad647246a57469f092e848aa80feb7a7bff15f5..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230712145926_drop_ci_build_trace_metadata_partition_id_default.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class DropCiBuildTraceMetadataPartitionIdDefault < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - enable_lock_retries! - - TABLE_NAME = :ci_build_trace_metadata - COLUMN_NAME = :partition_id - - def up - change_column_default(TABLE_NAME, COLUMN_NAME, from: 100, to: nil) if should_run? - end - - def down - change_column_default(TABLE_NAME, COLUMN_NAME, from: nil, to: 100) if should_run? - end - - private - - def should_run? - can_execute_on?(TABLE_NAME) - end -end diff --git a/db/post_migrate/20230713020247_change_pm_advisories_urls_constraint.rb b/db/post_migrate/20230713020247_change_pm_advisories_urls_constraint.rb deleted file mode 100644 index 4611f657d0deb7be94512b89adfa18e9999a32e7..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230713020247_change_pm_advisories_urls_constraint.rb +++ /dev/null @@ -1,17 +0,0 @@ -# frozen_string_literal: true - -class ChangePmAdvisoriesUrlsConstraint < Gitlab::Database::Migration[2.1] - disable_ddl_transaction! - - CONSTRAINT_NAME = "chk_rails_e73af9de76" - - def up - remove_check_constraint :pm_advisories, CONSTRAINT_NAME - add_check_constraint :pm_advisories, "CARDINALITY(urls) <= 20", CONSTRAINT_NAME - end - - def down - remove_check_constraint :pm_advisories, CONSTRAINT_NAME - add_check_constraint :pm_advisories, "CARDINALITY(urls) <= 10", CONSTRAINT_NAME - end -end diff --git a/db/post_migrate/20230713100100_drop_ci_pipeline_variable_partition_id_default.rb b/db/post_migrate/20230713100100_drop_ci_pipeline_variable_partition_id_default.rb deleted file mode 100644 index 5ef3a2caa823badd7443b3b2188c240b31117439..0000000000000000000000000000000000000000 --- a/db/post_migrate/20230713100100_drop_ci_pipeline_variable_partition_id_default.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -class DropCiPipelineVariablePartitionIdDefault < Gitlab::Database::Migration[2.1] - include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum - - enable_lock_retries! - - TABLE_NAME = :ci_pipeline_variables - COLUMN_NAME = :partition_id - - def up - change_column_default(TABLE_NAME, COLUMN_NAME, from: 100, to: nil) if should_run? - end - - def down - change_column_default(TABLE_NAME, COLUMN_NAME, from: nil, to: 100) if should_run? - end - - private - - def should_run? - can_execute_on?(TABLE_NAME) - end -end diff --git a/db/schema_migrations/20230314094213 b/db/schema_migrations/20230314094213 deleted file mode 100644 index e2741f5ea30675be6bb0d272a499abb82792fa3a..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230314094213 +++ /dev/null @@ -1 +0,0 @@ -ccf7548dc1916a60da14f9545039d7ac3666e44e96ccd59c0f6db4117b15515a \ No newline at end of file diff --git a/db/schema_migrations/20230314094215 b/db/schema_migrations/20230314094215 deleted file mode 100644 index a030527fac4d6c902a6f64ccdcc17a225aad9b72..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230314094215 +++ /dev/null @@ -1 +0,0 @@ -5549548b53710624294aed31af6ed8aeb26263e538d2e2d7eac254a5c105d08a \ No newline at end of file diff --git a/db/schema_migrations/20230522162742 b/db/schema_migrations/20230522162742 deleted file mode 100644 index ba41bc2a54da49aed94f203c5c92cdbdf10512f1..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230522162742 +++ /dev/null @@ -1 +0,0 @@ -ae56cc5feed51f3b48bf2f2d51bb32bf140e2ade7d7bdbfec16bb5ce2fead5c1 \ No newline at end of file diff --git a/db/schema_migrations/20230523101514 b/db/schema_migrations/20230523101514 deleted file mode 100644 index 76c331d425d8a53c2e71feeae8e591ff6bd35ba7..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230523101514 +++ /dev/null @@ -1 +0,0 @@ -d9efa5185994ecc7d2025d450a1072286674a0a2d94f7f2aa11a6b6b24d4f5da \ No newline at end of file diff --git a/db/schema_migrations/20230528203340 b/db/schema_migrations/20230528203340 deleted file mode 100644 index 27e5d44f4808579f0285f5b6dc4c69405b5e35ca..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230528203340 +++ /dev/null @@ -1 +0,0 @@ -0503c864e706c1255a9dbb27d7d83fe2be7e9b8690bb26bbbe327654a090cc90 \ No newline at end of file diff --git a/db/schema_migrations/20230530012406 b/db/schema_migrations/20230530012406 deleted file mode 100644 index ec6210939c576a2606fcb236b7b17a26723c443a..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230530012406 +++ /dev/null @@ -1 +0,0 @@ -bef78410f5088ab1e230ff21118dae186f363ee215f1cdab7cbff4e223bf20ec \ No newline at end of file diff --git a/db/schema_migrations/20230601211635 b/db/schema_migrations/20230601211635 deleted file mode 100644 index a92c327bce6aedd375eda051ec85bb766ef5a2ee..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230601211635 +++ /dev/null @@ -1 +0,0 @@ -c987632b4c7628e5fef9d5c6c0876ae2af7a34db2bdd87df8560c82adbdb604f \ No newline at end of file diff --git a/db/schema_migrations/20230601213750 b/db/schema_migrations/20230601213750 deleted file mode 100644 index 494b48356ca2d88bb7687c96f198df2b577f2b57..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230601213750 +++ /dev/null @@ -1 +0,0 @@ -f3e1bffc9586ee332497c3b6a72f86a8678b171c8a3eb538df4c4a5147bec04b \ No newline at end of file diff --git a/db/schema_migrations/20230605125735 b/db/schema_migrations/20230605125735 deleted file mode 100644 index 7592cd8ffa12ddc23fca143d34e99a839820dbf5..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230605125735 +++ /dev/null @@ -1 +0,0 @@ -348128b62afecd48dc65f1cf2c4f5ad37e98e837aca183c1283189283e074890 \ No newline at end of file diff --git a/db/schema_migrations/20230607124754 b/db/schema_migrations/20230607124754 deleted file mode 100644 index 2c49744ec26ac7a2e0502105b7ea9a99d4ba0756..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230607124754 +++ /dev/null @@ -1 +0,0 @@ -3aca70a09ce278454f38740817bba4e88501b8e68d719b9ef3f922cb09b7c7d3 \ No newline at end of file diff --git a/db/schema_migrations/20230608113106 b/db/schema_migrations/20230608113106 deleted file mode 100644 index 82a65911642af38047446a69e2f6bc0085ca154e..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230608113106 +++ /dev/null @@ -1 +0,0 @@ -137039d31d0e8b4abce8260f067783334538787c3f22c638d5c65c8b7016aad7 \ No newline at end of file diff --git a/db/schema_migrations/20230608145500 b/db/schema_migrations/20230608145500 deleted file mode 100644 index ddf0ac83819f95da1d8b8c5a542b83caf9629bbe..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230608145500 +++ /dev/null @@ -1 +0,0 @@ -e8070bd79c6c523fe5565951877f2f44ff25c6f7e0ce8713ac9887cd1296f087 \ No newline at end of file diff --git a/db/schema_migrations/20230609065641 b/db/schema_migrations/20230609065641 deleted file mode 100644 index 31bfe4d1d94f6280d5d3b378733a5e549fe6bcff..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230609065641 +++ /dev/null @@ -1 +0,0 @@ -8dbbe0c959e263ba04e2b68dd4b868fb4f5e4809c0724fe1c14aebee6e924132 \ No newline at end of file diff --git a/db/schema_migrations/20230609065942 b/db/schema_migrations/20230609065942 deleted file mode 100644 index 5b6454c7cf13ba49a401134471e6decf37203b05..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230609065942 +++ /dev/null @@ -1 +0,0 @@ -08b97855a2d1bfe7f1cb2118744b6968eb117eda2521e2287ec5b201114e9eec \ No newline at end of file diff --git a/db/schema_migrations/20230612074428 b/db/schema_migrations/20230612074428 deleted file mode 100644 index a763ffafa46662789c7bcb12fc5d9b52dd3e0e56..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230612074428 +++ /dev/null @@ -1 +0,0 @@ -65df1d9bfc31a41210d9a18a63786d35bde456d0fd94520be186e8eb06214d7e \ No newline at end of file diff --git a/db/schema_migrations/20230612091526 b/db/schema_migrations/20230612091526 deleted file mode 100644 index 04fa44523f95ea0336ddd43c65d38464e0e179d4..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230612091526 +++ /dev/null @@ -1 +0,0 @@ -f03f81f50c0777502aeb1040f5e2805b296d77979760156f5e2e1e184792d503 \ No newline at end of file diff --git a/db/schema_migrations/20230612091747 b/db/schema_migrations/20230612091747 deleted file mode 100644 index fbc9998118ad378db8d0ebdefbf9d10957894103..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230612091747 +++ /dev/null @@ -1 +0,0 @@ -ca928191459eeeeed6c10b444053eedb5e7236e94403a36ee8aa86a448d352c6 \ No newline at end of file diff --git a/db/schema_migrations/20230612091910 b/db/schema_migrations/20230612091910 deleted file mode 100644 index 8446746db36edb5b241aac50393b8880e44bfe9b..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230612091910 +++ /dev/null @@ -1 +0,0 @@ -6e534b91092c00e405dd621ea4d05b732b075007563f776b1fb88087f7edeaf9 \ No newline at end of file diff --git a/db/schema_migrations/20230613122211 b/db/schema_migrations/20230613122211 deleted file mode 100644 index ccdecf690190b35400244d31985f49a4c63e2f66..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230613122211 +++ /dev/null @@ -1 +0,0 @@ -da2cc429052e2db307e8eff2de61049ce93db4a7f6321a265889edeff1e7897d \ No newline at end of file diff --git a/db/schema_migrations/20230613192703 b/db/schema_migrations/20230613192703 deleted file mode 100644 index 0b4525d8e2c8ba2753072baad489f3df662c4580..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230613192703 +++ /dev/null @@ -1 +0,0 @@ -9a59cadd56d144591e828f8b64a7aa7887c156e86c75e1d57cc1e83fb8afbd01 \ No newline at end of file diff --git a/db/schema_migrations/20230613192802 b/db/schema_migrations/20230613192802 deleted file mode 100644 index 5184009df5c3d533a41dcc00fc43479cab9a249c..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230613192802 +++ /dev/null @@ -1 +0,0 @@ -3cf9c170bd70e70f0eef49c13317dcfbf79630d166417a61c6a2029ae40490c9 \ No newline at end of file diff --git a/db/schema_migrations/20230614180651 b/db/schema_migrations/20230614180651 deleted file mode 100644 index 6aa4a30f5e4bc8a4e12b8c99181ae13cd5291298..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230614180651 +++ /dev/null @@ -1 +0,0 @@ -e29861e9c43ad7b225a077f1026fe2cbf569b8caebd5c9949200220cb2b68fd6 \ No newline at end of file diff --git a/db/schema_migrations/20230614181310 b/db/schema_migrations/20230614181310 deleted file mode 100644 index 6bdfc2ccb8f7eaf8d04555701899f617c18e3421..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230614181310 +++ /dev/null @@ -1 +0,0 @@ -4433251c5085ac4e9c74a3dedc08a153cad82e8c6e7484e47538948a0d28185a \ No newline at end of file diff --git a/db/schema_migrations/20230614182049 b/db/schema_migrations/20230614182049 deleted file mode 100644 index 6454c1c88df40a52761ddc90e35fdb6a673e25c8..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230614182049 +++ /dev/null @@ -1 +0,0 @@ -0154e8ee8108b47dd1ff6913f3697e996e6c98a41b5b9a04c660086f5d1a31d7 \ No newline at end of file diff --git a/db/schema_migrations/20230615030402 b/db/schema_migrations/20230615030402 deleted file mode 100644 index 1139ca531f19c985c18bfe23770dea8dda6e113c..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230615030402 +++ /dev/null @@ -1 +0,0 @@ -47b6c521709eb4b514965fa6e59eb10ff93a31ce4a56debc81e8959f04e32b15 \ No newline at end of file diff --git a/db/schema_migrations/20230615074515 b/db/schema_migrations/20230615074515 deleted file mode 100644 index 22f8ca20d747089f6e96c8fc63312812d7d81602..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230615074515 +++ /dev/null @@ -1 +0,0 @@ -bfbb49d6b6b263be1fc669807ceb5f2e6cedb0e68221cb17a9e4fe5c2bedb439 \ No newline at end of file diff --git a/db/schema_migrations/20230615074544 b/db/schema_migrations/20230615074544 deleted file mode 100644 index f9079d090a859bd0c737737a4225175af27d6313..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230615074544 +++ /dev/null @@ -1 +0,0 @@ -45c76efa0091f7b63ce476cd7d6909d3c11aec2d96e51087f44060d5192b76a5 \ No newline at end of file diff --git a/db/schema_migrations/20230615104902 b/db/schema_migrations/20230615104902 deleted file mode 100644 index 9d52b635ff0bcbe6c7bbe2d1fa71ca41d397cb87..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230615104902 +++ /dev/null @@ -1 +0,0 @@ -f96102edb32531bda4828af85709f7510f730617aea6c80859da697595c96fcc \ No newline at end of file diff --git a/db/schema_migrations/20230615113748 b/db/schema_migrations/20230615113748 deleted file mode 100644 index 63fd03faa083e9f067185b8f80f820ac7b3b4592..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230615113748 +++ /dev/null @@ -1 +0,0 @@ -886e52579245dc9d3dafbfca97bb7398c776fa343946f38d58c7b10d081752e1 \ No newline at end of file diff --git a/db/schema_migrations/20230615113840 b/db/schema_migrations/20230615113840 deleted file mode 100644 index 073f687039774c27899f47ae54ce36bd96d7e08e..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230615113840 +++ /dev/null @@ -1 +0,0 @@ -703e63f9a84e94ed87938f47952d661a626f156aa8325322abab8f9a9b9fcb8f \ No newline at end of file diff --git a/db/schema_migrations/20230615113858 b/db/schema_migrations/20230615113858 deleted file mode 100644 index 338d26a7f6251fcfca05feee5ec77d113b58f1b6..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230615113858 +++ /dev/null @@ -1 +0,0 @@ -c115e35b6b8f6e422bc1832671016f5956b524709aec36bb6d4d1707545d20d5 \ No newline at end of file diff --git a/db/schema_migrations/20230615121103 b/db/schema_migrations/20230615121103 deleted file mode 100644 index 9c77e1512c15c34ac73682f6ea6f577ddf66ada9..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230615121103 +++ /dev/null @@ -1 +0,0 @@ -37634ac8f82ed0fa043036b1aab2dffbd7a4f9a2fc51f18d53511f8a834eb312 \ No newline at end of file diff --git a/db/schema_migrations/20230615121122 b/db/schema_migrations/20230615121122 deleted file mode 100644 index 0704b5d0c8d8d5612a5a2a91c08aac1f6fbbdcd5..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230615121122 +++ /dev/null @@ -1 +0,0 @@ -7014d18db20d925d1bc41b4104b1ce57f2033f7c8debed8fd31e6afbba8efd78 \ No newline at end of file diff --git a/db/schema_migrations/20230615144627 b/db/schema_migrations/20230615144627 deleted file mode 100644 index 2baac116d9bb5adb3f0fd5332c31a0144903b723..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230615144627 +++ /dev/null @@ -1 +0,0 @@ -1d9bf54e8214caefcc0a5f851c2a644df97f047b4cc9d3e7fe6e7ca34fef8f41 \ No newline at end of file diff --git a/db/schema_migrations/20230616082958 b/db/schema_migrations/20230616082958 deleted file mode 100644 index 6def484b0127341ecbcb41d7478cb7ac5ed8972c..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230616082958 +++ /dev/null @@ -1 +0,0 @@ -2155cb2efd8a43c774f48b4d87dddf9f6d5a33fb9c0ee804590e12b3713cc4dd \ No newline at end of file diff --git a/db/schema_migrations/20230616164309 b/db/schema_migrations/20230616164309 deleted file mode 100644 index b9fbdc7d33eef0870b076336ac7efde7bedf7f46..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230616164309 +++ /dev/null @@ -1 +0,0 @@ -f3b14748f1702972e7f5069edd9ed25d9896dfb11f4fc4a4386ca9c94533e10a \ No newline at end of file diff --git a/db/schema_migrations/20230616164705 b/db/schema_migrations/20230616164705 deleted file mode 100644 index 1bcb723524bd11046a6e989e035c23a1a080f204..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230616164705 +++ /dev/null @@ -1 +0,0 @@ -75310614bb98a598b8425aa87a0a4a6561fa1b166461d55329c21aff849d71fc \ No newline at end of file diff --git a/db/schema_migrations/20230616164731 b/db/schema_migrations/20230616164731 deleted file mode 100644 index 2588271d9acd72d2e2f0e6acdd0f215ff25ac441..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230616164731 +++ /dev/null @@ -1 +0,0 @@ -e6308ee437b6e57da16e1b8aff1d6a571ef849c4c7cccafe940710c799fa6eea \ No newline at end of file diff --git a/db/schema_migrations/20230616200440 b/db/schema_migrations/20230616200440 deleted file mode 100644 index b67a9da8a990a99880d8219f2e492117d7398b28..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230616200440 +++ /dev/null @@ -1 +0,0 @@ -de2c254df58e13ffba7fef9bbf4fff2e244aa46ce58f8245646ed7ce4ab51770 \ No newline at end of file diff --git a/db/schema_migrations/20230616214220 b/db/schema_migrations/20230616214220 deleted file mode 100644 index 7f006c6e985181f1363a9f1ce50ca1d188e68e35..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230616214220 +++ /dev/null @@ -1 +0,0 @@ -29cf1dfb1429cb177f5b6cb2fae2a0bc388c0c6cbda5c4405456afcee8374a54 \ No newline at end of file diff --git a/db/schema_migrations/20230618020202 b/db/schema_migrations/20230618020202 deleted file mode 100644 index f07ea0b299422e2092d359ae1476b969e4331c7d..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230618020202 +++ /dev/null @@ -1 +0,0 @@ -aedea1ec886b1831a94831185aa493e42c777c8c1614f6541580cdaa4f76946e \ No newline at end of file diff --git a/db/schema_migrations/20230619005223 b/db/schema_migrations/20230619005223 deleted file mode 100644 index ce79f7ceed087665d0b374ac19773f6c5b3ea387..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230619005223 +++ /dev/null @@ -1 +0,0 @@ -e728befa42eb6749929e758ece0f29ec57cd7614a378b8c5e4dc24f134f39185 \ No newline at end of file diff --git a/db/schema_migrations/20230619072744 b/db/schema_migrations/20230619072744 deleted file mode 100644 index ba71e5cd39259492b93612f19c64616980ec20cf..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230619072744 +++ /dev/null @@ -1 +0,0 @@ -6bf4fa6d2e43f1b589204f3b58323f32d9db2344882507e14bc487913cbe6f8e \ No newline at end of file diff --git a/db/schema_migrations/20230619081412 b/db/schema_migrations/20230619081412 deleted file mode 100644 index e3a200aad1c65ceac7c83c554dc7cbaa0780b32c..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230619081412 +++ /dev/null @@ -1 +0,0 @@ -31e437da1c65308037bace06492ac1995979abf061717aadb84dca22708dccff \ No newline at end of file diff --git a/db/schema_migrations/20230619123701 b/db/schema_migrations/20230619123701 deleted file mode 100644 index f1bee23e3b9a5952ac55bf4df16473785fb525cf..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230619123701 +++ /dev/null @@ -1 +0,0 @@ -44dba614ff8883e5f8446e4c5f05964bb8ab7915d9caa06c908a9c24dd1dc1b1 \ No newline at end of file diff --git a/db/schema_migrations/20230619134106 b/db/schema_migrations/20230619134106 deleted file mode 100644 index a23db7839fac322e9c37f3bda5c506d15e7f46ff..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230619134106 +++ /dev/null @@ -1 +0,0 @@ -248e7dabf83e225c5f5ee0de87e0842e8c3ec13f6098720830ce3b817a4d36a8 \ No newline at end of file diff --git a/db/schema_migrations/20230620072854 b/db/schema_migrations/20230620072854 deleted file mode 100644 index dd1b2f51792cc3e30dbd3d2a33bd59c37e103cd2..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620072854 +++ /dev/null @@ -1 +0,0 @@ -2cfb38d13f843e13b770e1598bb221555e09c05b785c30989626857a0dc396e8 \ No newline at end of file diff --git a/db/schema_migrations/20230620072856 b/db/schema_migrations/20230620072856 deleted file mode 100644 index 614eb900d501c1470cb5612a513ca9a752f79723..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620072856 +++ /dev/null @@ -1 +0,0 @@ -f7917d437de6d3cc76c183c6682bf18b545ed5b10c2c1212dac46be6f5dfa505 \ No newline at end of file diff --git a/db/schema_migrations/20230620072900 b/db/schema_migrations/20230620072900 deleted file mode 100644 index e6f7bfe614d3d2975693f8c3f87c7d817dc1c0fa..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620072900 +++ /dev/null @@ -1 +0,0 @@ -cdd264bae9968d1a54cdbd2a848161070c91e4fd25b55de072b4822d99bf9b09 \ No newline at end of file diff --git a/db/schema_migrations/20230620072905 b/db/schema_migrations/20230620072905 deleted file mode 100644 index 14a8b5db0520232c253eb84ff9e0c390a7d9e955..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620072905 +++ /dev/null @@ -1 +0,0 @@ -c846d009e014869a969ba637440bc7d8ea9482aac12a567e888dd69582c8467e \ No newline at end of file diff --git a/db/schema_migrations/20230620072908 b/db/schema_migrations/20230620072908 deleted file mode 100644 index 01a4fc678107498b807958a0e3ddaad879858284..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620072908 +++ /dev/null @@ -1 +0,0 @@ -39c8125b1d159ff84627cd897830dcbe7be87fe0675b6f6582380019de7d05e5 \ No newline at end of file diff --git a/db/schema_migrations/20230620072911 b/db/schema_migrations/20230620072911 deleted file mode 100644 index 4010199d8fa59e192579dc85251235c0368d90a9..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620072911 +++ /dev/null @@ -1 +0,0 @@ -d16c032a8dfaecb6fc61f00b273b539cf0ba6a27b36e6b8119e66c9ee323f4a1 \ No newline at end of file diff --git a/db/schema_migrations/20230620072915 b/db/schema_migrations/20230620072915 deleted file mode 100644 index 9e8d8f80b0c731f220f9cc4f3dd0721232ed9379..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620072915 +++ /dev/null @@ -1 +0,0 @@ -c0a830c3fac01580d2e938fbbd618d6b28fba7f721bffb7861d4c2ac0206e862 \ No newline at end of file diff --git a/db/schema_migrations/20230620072917 b/db/schema_migrations/20230620072917 deleted file mode 100644 index ef80924ff250c69d3911396bdbf180d1f34a9c42..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620072917 +++ /dev/null @@ -1 +0,0 @@ -9ae676e0670c484b7ba385901d654eb6d05a9cedc550ee124121f0974158e2b3 \ No newline at end of file diff --git a/db/schema_migrations/20230620072920 b/db/schema_migrations/20230620072920 deleted file mode 100644 index 37ee5e05783d550dce29c22fd26b05fa81b11790..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620072920 +++ /dev/null @@ -1 +0,0 @@ -1fb33bd7af08a6213447e1f87531d4e285b69092ff5181276de0dfa9d1f40cc0 \ No newline at end of file diff --git a/db/schema_migrations/20230620072925 b/db/schema_migrations/20230620072925 deleted file mode 100644 index 46a5ca4c776de178422e4e83f0bcbfddc3467176..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620072925 +++ /dev/null @@ -1 +0,0 @@ -fa58b6885924405f9556340ffc2625da5f94f4b68942bcca4927adc0fc74ebd7 \ No newline at end of file diff --git a/db/schema_migrations/20230620101808 b/db/schema_migrations/20230620101808 deleted file mode 100644 index ecb74b1887038d39ae7e8b2deb59ed748b07eaf0..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620101808 +++ /dev/null @@ -1 +0,0 @@ -8c797f079ce4536559bbe73b9c18540f5793dc725eb970ac23bfeb1578f8adc2 \ No newline at end of file diff --git a/db/schema_migrations/20230620104217 b/db/schema_migrations/20230620104217 deleted file mode 100644 index f07e758bdbd099622bc26268e442f01981255206..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620104217 +++ /dev/null @@ -1 +0,0 @@ -cd2692308d23e12450ff96bf7a0cde9866b8d920babc1187e9e4b50fa5b2d43a \ No newline at end of file diff --git a/db/schema_migrations/20230620105919 b/db/schema_migrations/20230620105919 deleted file mode 100644 index b5922e4afc33f88fe6a6b3e4911a7dad88f905b9..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620105919 +++ /dev/null @@ -1 +0,0 @@ -fa1729c74f96263143b15e9a08fd4bf723dd55a75ee295ff7390020030fc1355 \ No newline at end of file diff --git a/db/schema_migrations/20230620110004 b/db/schema_migrations/20230620110004 deleted file mode 100644 index 4bfe9bdc6232859c36bed12391d2b2b71c7b4bdd..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620110004 +++ /dev/null @@ -1 +0,0 @@ -ca9564bcb051593478180c42c107be4f49a31df4a15ada3cba52a5779754b812 \ No newline at end of file diff --git a/db/schema_migrations/20230620110021 b/db/schema_migrations/20230620110021 deleted file mode 100644 index 646362e19056d6c129953dd0c94ca5759bd9a295..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620110021 +++ /dev/null @@ -1 +0,0 @@ -2ba72a003cb2a6560caa1351dc46113f370a59767c629127da6f7bfe43b8cbde \ No newline at end of file diff --git a/db/schema_migrations/20230620134708 b/db/schema_migrations/20230620134708 deleted file mode 100644 index 2a5da955fe1e53a838e83432f32774ee5a0dd299..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620134708 +++ /dev/null @@ -1 +0,0 @@ -5380771d2c97c44978ff78a310f682b185d97c56d80620ccda4322a22d000978 \ No newline at end of file diff --git a/db/schema_migrations/20230620201738 b/db/schema_migrations/20230620201738 deleted file mode 100644 index 1bc9933c362aa7af3101a2cae2144883e7872117..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620201738 +++ /dev/null @@ -1 +0,0 @@ -99ee0372604bb5cd0778407b4af5ff2971136583166e90aba37fadd8e90e4109 \ No newline at end of file diff --git a/db/schema_migrations/20230620201817 b/db/schema_migrations/20230620201817 deleted file mode 100644 index 04ab99b2d9bc050c2e1a18785f6c801b8bdc6f6e..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230620201817 +++ /dev/null @@ -1 +0,0 @@ -a4b69d82118f3cacd310a3dc369769e5ea767e763852ac4a27c138bccd500990 \ No newline at end of file diff --git a/db/schema_migrations/20230621065943 b/db/schema_migrations/20230621065943 deleted file mode 100644 index 4c918e07f34e8973c88d89cbd2415a68ec57d1c5..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230621065943 +++ /dev/null @@ -1 +0,0 @@ -f51d14579ace7c0b843c1371086218770c2c2083fec5d1088a49bf9bd6c6e572 \ No newline at end of file diff --git a/db/schema_migrations/20230621070810 b/db/schema_migrations/20230621070810 deleted file mode 100644 index e080764583d2751afb3e7b86dcb2e0a71827949c..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230621070810 +++ /dev/null @@ -1 +0,0 @@ -87393271016f643e4df201322e26f703ce9cf74d2189f0e0e586ff48697f994a \ No newline at end of file diff --git a/db/schema_migrations/20230621072726 b/db/schema_migrations/20230621072726 deleted file mode 100644 index 333aeda18b325959f18c5be70159b54a76518595..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230621072726 +++ /dev/null @@ -1 +0,0 @@ -56bf488ec781f8db5ec1723c6a749c0d80140781a1eb3a07984abeddd7d6e88e \ No newline at end of file diff --git a/db/schema_migrations/20230621072848 b/db/schema_migrations/20230621072848 deleted file mode 100644 index 0c69a850bd5ba05bc6e3bbdc8ea03bce129bb3cd..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230621072848 +++ /dev/null @@ -1 +0,0 @@ -4add5ff0aacac0f287e7aad63a5c0361091d9467bbabc03117750fdbd83681b5 \ No newline at end of file diff --git a/db/schema_migrations/20230621074446 b/db/schema_migrations/20230621074446 deleted file mode 100644 index 6344e8a2153911e97a81b0bc71d25d8aeec783dc..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230621074446 +++ /dev/null @@ -1 +0,0 @@ -f40ca52d92fd6c2c3a64b5b3c46c46f1f690b67b5320e84f55f62d4723c7d7e6 \ No newline at end of file diff --git a/db/schema_migrations/20230621074611 b/db/schema_migrations/20230621074611 deleted file mode 100644 index 4a7ac63ed34303aeb2583f794f1f6c6863004df6..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230621074611 +++ /dev/null @@ -1 +0,0 @@ -b44a08db74d15671a63afff9c41da67c0486c57bb893dc147ae073d78541457c \ No newline at end of file diff --git a/db/schema_migrations/20230621083004 b/db/schema_migrations/20230621083004 deleted file mode 100644 index 9cf899b3495ab1e7ea5e35f7d481804c9c6d4ca5..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230621083004 +++ /dev/null @@ -1 +0,0 @@ -e5b653b4cdee96f1160950ca6885609f393d49f9b7a4cdd3be3e1dac07fc3add \ No newline at end of file diff --git a/db/schema_migrations/20230621083052 b/db/schema_migrations/20230621083052 deleted file mode 100644 index edd3c6df2fee800e37cb0e3c0ed3fb9be2995db0..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230621083052 +++ /dev/null @@ -1 +0,0 @@ -7aa6e43678d3e7421fc80c6705daab68c219fa715b8a18ef6c9fdc5df304f8c0 \ No newline at end of file diff --git a/db/schema_migrations/20230621102941 b/db/schema_migrations/20230621102941 deleted file mode 100644 index 10d052d60552624f5672f2f7942847cc995bceed..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230621102941 +++ /dev/null @@ -1 +0,0 @@ -d7e664cb16c66f72c409a5738a48f06a5b56d52409cd41095dedab7f5e9ea065 \ No newline at end of file diff --git a/db/schema_migrations/20230621103000 b/db/schema_migrations/20230621103000 deleted file mode 100644 index 1d0aee1217ef9cd631816b247893464400d7768b..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230621103000 +++ /dev/null @@ -1 +0,0 @@ -9d96b459795c8850ada522769855e2ab6c554ea774a78272baf1db873589f556 \ No newline at end of file diff --git a/db/schema_migrations/20230621103043 b/db/schema_migrations/20230621103043 deleted file mode 100644 index 707105b67c42ec05d008b0c01ad681be4c4eb0d7..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230621103043 +++ /dev/null @@ -1 +0,0 @@ -b1c7f95cfa972fb23c536d5607b9b1d067e0e8af9e8036170cba6ca913a9c9e0 \ No newline at end of file diff --git a/db/schema_migrations/20230622044119 b/db/schema_migrations/20230622044119 deleted file mode 100644 index 31c5297f0303e6c45b51d57a5f90224cc045918c..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230622044119 +++ /dev/null @@ -1 +0,0 @@ -b95691099886021c131b3ef04ce21a5610a31a635e9a95eee1d31a558b7dae8b \ No newline at end of file diff --git a/db/schema_migrations/20230622051925 b/db/schema_migrations/20230622051925 deleted file mode 100644 index 54d986fde1db5d85bd6875335f7a852e1b86ff85..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230622051925 +++ /dev/null @@ -1 +0,0 @@ -c171fb3fd46cd8b015bc173e94e3e413aefb9a2afa58d556e357454717978313 \ No newline at end of file diff --git a/db/schema_migrations/20230622051943 b/db/schema_migrations/20230622051943 deleted file mode 100644 index 206327d89c2a39b02a7495394c3e53d1d735b89b..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230622051943 +++ /dev/null @@ -1 +0,0 @@ -be537d6f8024b067c302cd96429d1bccca410c13c9ea4392c0642af4ddd4eb19 \ No newline at end of file diff --git a/db/schema_migrations/20230622052015 b/db/schema_migrations/20230622052015 deleted file mode 100644 index d25ccb2099eebb43a3be6582f6b1973d58543043..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230622052015 +++ /dev/null @@ -1 +0,0 @@ -6d6e5a996e7a7abcf5f1b6e019a8e86a3d4e9aab0052c6f7620ff02091527229 \ No newline at end of file diff --git a/db/schema_migrations/20230622052046 b/db/schema_migrations/20230622052046 deleted file mode 100644 index 7faab404d2b0b760bfff0aac3dfcd6f5824ae5b5..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230622052046 +++ /dev/null @@ -1 +0,0 @@ -2649850f5ea46578753c4b6d30cbc64e40d1b0f85d24b1de58791d21d1837379 \ No newline at end of file diff --git a/db/schema_migrations/20230622073752 b/db/schema_migrations/20230622073752 deleted file mode 100644 index 5dcd11379dcfac08d11a8600abfa4ca1371c4b25..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230622073752 +++ /dev/null @@ -1 +0,0 @@ -0bf41a90a42bd448727459b22f94b24f78e933fc2f5d1f4b27cf37c40cc7bbe6 \ No newline at end of file diff --git a/db/schema_migrations/20230622093921 b/db/schema_migrations/20230622093921 deleted file mode 100644 index 696104cce80f12d5e273c15ae0a9ce117668505f..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230622093921 +++ /dev/null @@ -1 +0,0 @@ -1947fe30ac91f67fc863879e4adbc46dbe6ef84c9daa7de8133a81a15eb0e6ce \ No newline at end of file diff --git a/db/schema_migrations/20230623073906 b/db/schema_migrations/20230623073906 deleted file mode 100644 index 0783428a741b550c078eabeb77a3a29cf9a71ec2..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230623073906 +++ /dev/null @@ -1 +0,0 @@ -d76cadfee80a039889d8abe1a0d62f37db683d7c82f7b2bc9a5882af6c65cdf9 \ No newline at end of file diff --git a/db/schema_migrations/20230626065725 b/db/schema_migrations/20230626065725 deleted file mode 100644 index 5e0d178a73b58d5c49978351d879e613586be460..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230626065725 +++ /dev/null @@ -1 +0,0 @@ -1f9cc4c9d10fa666d5c30dcf7752cac335878565b8e49084960a9fc137be98fc \ No newline at end of file diff --git a/db/schema_migrations/20230626065755 b/db/schema_migrations/20230626065755 deleted file mode 100644 index 491f61fe3ec7e6443df8fc7cf2e0756f91feb0c1..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230626065755 +++ /dev/null @@ -1 +0,0 @@ -1284418dccf0e96d281f9ffea3048fc74d145be9ea1f20e443c91707559105d9 \ No newline at end of file diff --git a/db/schema_migrations/20230626070723 b/db/schema_migrations/20230626070723 deleted file mode 100644 index c0528c8a9b50d02d0430b6c0fa55b20f722f3e42..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230626070723 +++ /dev/null @@ -1 +0,0 @@ -3154c7f63689ab430342229b526380cdc02ab9e11f855cf914cb382ba2850ab1 \ No newline at end of file diff --git a/db/schema_migrations/20230626070959 b/db/schema_migrations/20230626070959 deleted file mode 100644 index 3445b9e6f2e54031f4b2123732950575fa7b30dc..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230626070959 +++ /dev/null @@ -1 +0,0 @@ -fe4406579d2f6be5e422ce359cf7995d4d601088c85d04b9c0d7b95d41111e23 \ No newline at end of file diff --git a/db/schema_migrations/20230626071100 b/db/schema_migrations/20230626071100 deleted file mode 100644 index 60c3b5c045db80aeeb7e1baef70ea530bacb69d5..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230626071100 +++ /dev/null @@ -1 +0,0 @@ -4cab810df6576b2daf0264b961180cffb581c6b421c53d88c69ebfa4ecd90bc5 \ No newline at end of file diff --git a/db/schema_migrations/20230626072436 b/db/schema_migrations/20230626072436 deleted file mode 100644 index 1800699ff544f706610d01aa904ac6f8bef331ad..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230626072436 +++ /dev/null @@ -1 +0,0 @@ -7169f6ef838ca3992d32b92a8cda4063d147c7ffe64cc382d69ae92eca525d0b \ No newline at end of file diff --git a/db/schema_migrations/20230626101519 b/db/schema_migrations/20230626101519 deleted file mode 100644 index 874d3eec0ee529e550a415d6e4c242194d5b8b0e..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230626101519 +++ /dev/null @@ -1 +0,0 @@ -7060d1ed7be6fce2e398d9ac042d6e67826742e639df8eee43245d66b8b87ea3 \ No newline at end of file diff --git a/db/schema_migrations/20230626113908 b/db/schema_migrations/20230626113908 deleted file mode 100644 index 2d3f32051893fcefbca072ef74262e55c56f05ef..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230626113908 +++ /dev/null @@ -1 +0,0 @@ -542e2345a171e46512d793cc764fdbb279d9bf40e65e021d249953b29ff66dcb \ No newline at end of file diff --git a/db/schema_migrations/20230626113909 b/db/schema_migrations/20230626113909 deleted file mode 100644 index 2edeec73a10f14a608ff80d455ec776a94981a77..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230626113909 +++ /dev/null @@ -1 +0,0 @@ -633753a79a9d4f251c89b7fdbbf5fa17d2c85ceba091c450d377ab4e50bd9bce \ No newline at end of file diff --git a/db/schema_migrations/20230626113910 b/db/schema_migrations/20230626113910 deleted file mode 100644 index ee86f5c77c428e585a0075fa50411250246192fa..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230626113910 +++ /dev/null @@ -1 +0,0 @@ -a702fd86f25c3044e7eb8195349aec6f0627e258946c996164880c0f72998176 \ No newline at end of file diff --git a/db/schema_migrations/20230626115046 b/db/schema_migrations/20230626115046 deleted file mode 100644 index f33fe2cb20d0c1af36d0be8ee93b9e367492e2e3..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230626115046 +++ /dev/null @@ -1 +0,0 @@ -ebc346341318ad1c6f3d10876d2a7ee1943f8795a407f0048d4cc92b4efba431 \ No newline at end of file diff --git a/db/schema_migrations/20230627115305 b/db/schema_migrations/20230627115305 deleted file mode 100644 index 148cbb9c6a9249d52d142f39f138b4da21c66f8b..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230627115305 +++ /dev/null @@ -1 +0,0 @@ -7c2149b427416d98e8fdacf703b4c100d135546bf700fbc06561c7dd74a60918 \ No newline at end of file diff --git a/db/schema_migrations/20230627140707 b/db/schema_migrations/20230627140707 deleted file mode 100644 index 39739131a93bcd785bca161b5e2548fb4095bcfb..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230627140707 +++ /dev/null @@ -1 +0,0 @@ -9568e3084ed45c6a818dbf4aa9d88b9489beac706f15e470e022cde38b97a327 \ No newline at end of file diff --git a/db/schema_migrations/20230627174139 b/db/schema_migrations/20230627174139 deleted file mode 100644 index af37ba0baaae98be0d20885d93b0f9a35ec64047..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230627174139 +++ /dev/null @@ -1 +0,0 @@ -22ab53f5c190f37f37a3e3e57742b1dde3c0c724492b63f938bfdcb7c2a09fa1 \ No newline at end of file diff --git a/db/schema_migrations/20230628023103 b/db/schema_migrations/20230628023103 deleted file mode 100644 index 57a9e34246712396b39ef5c698b0611a15ac86b0..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230628023103 +++ /dev/null @@ -1 +0,0 @@ -59e4b358359514dbb49b2b73c829a99f646100442f02aa36287935d6e8fa76ab \ No newline at end of file diff --git a/db/schema_migrations/20230629011859 b/db/schema_migrations/20230629011859 deleted file mode 100644 index 310d898c2ed4b24ed4295814b4b83bd63dd2851f..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230629011859 +++ /dev/null @@ -1 +0,0 @@ -ad9a274264ce640df6c8d3c035b34de960766b7ff71095c6ad63e882cc4a3d5a \ No newline at end of file diff --git a/db/schema_migrations/20230629024032 b/db/schema_migrations/20230629024032 deleted file mode 100644 index f1ca84565e144369036ae2934174bedf5f6add5c..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230629024032 +++ /dev/null @@ -1 +0,0 @@ -5d66f87307ec80cd7695646b69a2002b4f78d892d8ce30f9de7d2583a6233ae7 \ No newline at end of file diff --git a/db/schema_migrations/20230629024403 b/db/schema_migrations/20230629024403 deleted file mode 100644 index 24d68f7c38a911dd458ed1ce0ca3515e2ac426a7..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230629024403 +++ /dev/null @@ -1 +0,0 @@ -3de2d94ddd3f3df3ba8d0aefb4ad137c586abcc4fef065074c4087d866a0420d \ No newline at end of file diff --git a/db/schema_migrations/20230629071427 b/db/schema_migrations/20230629071427 deleted file mode 100644 index 6312e1306690724a6592e18c19e596eb94e0ae5f..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230629071427 +++ /dev/null @@ -1 +0,0 @@ -4f11acd2381e999cf81c7fe05a75f718a4ef735b7ada01140af67a5a1282e909 \ No newline at end of file diff --git a/db/schema_migrations/20230629095819 b/db/schema_migrations/20230629095819 deleted file mode 100644 index 13c1b53ca4b832b3fb67158b51b0532b0e8ec223..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230629095819 +++ /dev/null @@ -1 +0,0 @@ -4e169ac2e0dd9df9f3f8ebf6041189ccdde1d683d9e64ced6743abdcc22eea7b \ No newline at end of file diff --git a/db/schema_migrations/20230629112833 b/db/schema_migrations/20230629112833 deleted file mode 100644 index f147e88a01de52322ade77eff0159d4d8b02ef18..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230629112833 +++ /dev/null @@ -1 +0,0 @@ -90b19651bc3f69a2e104a94ec4b9c4a758b4e258b49dad19b9795d1574c51946 \ No newline at end of file diff --git a/db/schema_migrations/20230629113029 b/db/schema_migrations/20230629113029 deleted file mode 100644 index b0908feca284179bef5f5a5154fda992319e60ca..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230629113029 +++ /dev/null @@ -1 +0,0 @@ -1cca0c19cc117465e14bf52ad8aadbf61c4c6e4c3fbc17a77138dd1f40fad902 \ No newline at end of file diff --git a/db/schema_migrations/20230629113133 b/db/schema_migrations/20230629113133 deleted file mode 100644 index 56f6c7e167ee55b5ad0616cefcc39f3522fe4df2..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230629113133 +++ /dev/null @@ -1 +0,0 @@ -fc7195a78541583e95a007594b393d0cd67f942c275efb8a43c6953128e8b4ec \ No newline at end of file diff --git a/db/schema_migrations/20230630101337 b/db/schema_migrations/20230630101337 deleted file mode 100644 index 1473c1bf651808ee8ec44bf1964bdc52bb3c9a2c..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230630101337 +++ /dev/null @@ -1 +0,0 @@ -53020e29ac265baaca73fe0b5e861d3bafbadc7cc082ac49f766ba7f4e5ae912 \ No newline at end of file diff --git a/db/schema_migrations/20230630101342 b/db/schema_migrations/20230630101342 deleted file mode 100644 index a8fdc05fabcb98e81d453326f96192eae9f9645c..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230630101342 +++ /dev/null @@ -1 +0,0 @@ -6b3518efb850118b371ae2806557201ba3fa657a6d631d1225feaf77fe6dff85 \ No newline at end of file diff --git a/db/schema_migrations/20230630101347 b/db/schema_migrations/20230630101347 deleted file mode 100644 index aa87ba3ebf939e5cfa663385c1e42e5f70b45b98..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230630101347 +++ /dev/null @@ -1 +0,0 @@ -f1413f18b4efc28d0f23582a7a6bc0f27b1bb44eb44d471561cf6447410158cf \ No newline at end of file diff --git a/db/schema_migrations/20230630170515 b/db/schema_migrations/20230630170515 deleted file mode 100644 index 7c0f42235af6f7b757367708b509975947a92c67..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230630170515 +++ /dev/null @@ -1 +0,0 @@ -838865785ae99586e6c4017b5c51dee845208501a66fd4a3890641be0c076dfc \ No newline at end of file diff --git a/db/schema_migrations/20230701195315 b/db/schema_migrations/20230701195315 deleted file mode 100644 index fab65f8edb93e74db023f0af1a6ab54fbf23107b..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230701195315 +++ /dev/null @@ -1 +0,0 @@ -5aa32c9cc47402adbb622bb7e8a2cd4f7714973d25a5b787c1156f3dee517433 \ No newline at end of file diff --git a/db/schema_migrations/20230703024031 b/db/schema_migrations/20230703024031 deleted file mode 100644 index 4e68e593e67d43d04666f32a69888ffdfc0c08c2..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230703024031 +++ /dev/null @@ -1 +0,0 @@ -bfbb862d6d7c54ebfa110a6266c99b9c264f4ae2d4c3b9cf07d47beb642bbb2b \ No newline at end of file diff --git a/db/schema_migrations/20230703115902 b/db/schema_migrations/20230703115902 deleted file mode 100644 index 471eb5becbb31d03d7ffb32961da9fd2f1adb8d8..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230703115902 +++ /dev/null @@ -1 +0,0 @@ -8a16b05cd573528b6e8baa2d86e761a2b431584c026918e3eda9a630b30ec727 \ No newline at end of file diff --git a/db/schema_migrations/20230703121859 b/db/schema_migrations/20230703121859 deleted file mode 100644 index f72e3201352bb5320ce3b960b19fdaf2c627f114..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230703121859 +++ /dev/null @@ -1 +0,0 @@ -149cdb7863460246fb89d02d3c8e1709bdb1d38378304d44c9a916c4bd4ee4ed \ No newline at end of file diff --git a/db/schema_migrations/20230703122803 b/db/schema_migrations/20230703122803 deleted file mode 100644 index 18e7e7529561ff3d93b814cb5855cb63d1a50bd3..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230703122803 +++ /dev/null @@ -1 +0,0 @@ -af0a79450261909c0280ea5a7c747c5ec997062f33c0f2bc75891c2e99f61da8 \ No newline at end of file diff --git a/db/schema_migrations/20230704042302 b/db/schema_migrations/20230704042302 deleted file mode 100644 index 0a016cd7bb2ef1f89e5765b660e9439b1f56ee22..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230704042302 +++ /dev/null @@ -1 +0,0 @@ -d4c93417aef4587ba892f81b0339c5213cd6b5270478edcb1378138fd74e2787 \ No newline at end of file diff --git a/db/schema_migrations/20230704044541 b/db/schema_migrations/20230704044541 deleted file mode 100644 index 1d0765f22b45c4f2ccf922600bc01666f0dc5a63..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230704044541 +++ /dev/null @@ -1 +0,0 @@ -a10daabd1b354eaea1a6fb6c4b709d137e096c6aa667dea16f82661f20b716a3 \ No newline at end of file diff --git a/db/schema_migrations/20230704050739 b/db/schema_migrations/20230704050739 deleted file mode 100644 index b19ba35fc6e4b633d7d59c3973ee325ca76731ed..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230704050739 +++ /dev/null @@ -1 +0,0 @@ -93c012068f6f6f025cc2ed1c5670f0704010e13f1eec1bff6c5fb917ec6549a0 \ No newline at end of file diff --git a/db/schema_migrations/20230704062132 b/db/schema_migrations/20230704062132 deleted file mode 100644 index 807788250b01d2e31891165bb941838d5b32bd23..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230704062132 +++ /dev/null @@ -1 +0,0 @@ -b103d237ee15e12602d656dca33abde5e6849ac4e81df606ba5578db9023f890 \ No newline at end of file diff --git a/db/schema_migrations/20230704062136 b/db/schema_migrations/20230704062136 deleted file mode 100644 index 6296493462126a604de72a251853ba2da60ef5eb..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230704062136 +++ /dev/null @@ -1 +0,0 @@ -74a1d7edb1319534d2853fc94726dae0e28944395c2fb30e0fc4597eb5ba1330 \ No newline at end of file diff --git a/db/schema_migrations/20230704074120 b/db/schema_migrations/20230704074120 deleted file mode 100644 index c411bda0d73c1b017abf531a078f02e37e83a431..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230704074120 +++ /dev/null @@ -1 +0,0 @@ -ec9cd530b8fe033c16865adf6494cc3e568c4bfa513e616398da737a68291cb5 \ No newline at end of file diff --git a/db/schema_migrations/20230704074124 b/db/schema_migrations/20230704074124 deleted file mode 100644 index d672b7db2ef1ea39a18762b9a8d87c7b63bc7a9f..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230704074124 +++ /dev/null @@ -1 +0,0 @@ -d7f3642897ee44f18c2b809f3936a951c715f3021454349117e22e387d18945a \ No newline at end of file diff --git a/db/schema_migrations/20230705085223 b/db/schema_migrations/20230705085223 deleted file mode 100644 index cdbed593c44f2eb38f3ef9fee4ca26b6ef5060f9..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230705085223 +++ /dev/null @@ -1 +0,0 @@ -dd4cb988fa1451dfac5f6c4ae0990be05472d1a8beee05fdd18a9bc137f07ee2 \ No newline at end of file diff --git a/db/schema_migrations/20230705092150 b/db/schema_migrations/20230705092150 deleted file mode 100644 index 96e51e689e2de1f52b2042e379fb91992334736a..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230705092150 +++ /dev/null @@ -1 +0,0 @@ -5954829dd244b4536beeb9b92a157539feb5207bc1309e177310895f269f54d8 \ No newline at end of file diff --git a/db/schema_migrations/20230705115215 b/db/schema_migrations/20230705115215 deleted file mode 100644 index ec12c32117d241c0f228f566f22cc04fe708c9c2..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230705115215 +++ /dev/null @@ -1 +0,0 @@ -3035da4873093dd7c8cee94398c3b4a70a696e1e765d102cfe657b53e3b65be9 \ No newline at end of file diff --git a/db/schema_migrations/20230705141703 b/db/schema_migrations/20230705141703 deleted file mode 100644 index 51c3cd350c11ffaae7a01dc8f24cc1cf67e9132f..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230705141703 +++ /dev/null @@ -1 +0,0 @@ -dafb3395a28180da275eceddb87af4deb0008b2d0793dd0ea3f34d2ae8bd5c10 \ No newline at end of file diff --git a/db/schema_migrations/20230705141733 b/db/schema_migrations/20230705141733 deleted file mode 100644 index 2b5870f2ba50d1ee8ac03d09b92912d3088a2b21..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230705141733 +++ /dev/null @@ -1 +0,0 @@ -2cea22d62a5a08a643b3043bea1e14e4965f57201db559995cab8616d7586f55 \ No newline at end of file diff --git a/db/schema_migrations/20230705142241 b/db/schema_migrations/20230705142241 deleted file mode 100644 index 4d4ee24d798017965a957a28a9926a569ac1738a..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230705142241 +++ /dev/null @@ -1 +0,0 @@ -ae094cd61e252b30c1ebe0e5369ff2c061aa96079bbc1addde160003e2263886 \ No newline at end of file diff --git a/db/schema_migrations/20230705142334 b/db/schema_migrations/20230705142334 deleted file mode 100644 index ace38aed2f789bf8089892c288efa1edb9f5a963..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230705142334 +++ /dev/null @@ -1 +0,0 @@ -33de9f678eb493070ceaae0e50461cffbcdbb5a542740b9fc595cba2c8c32808 \ No newline at end of file diff --git a/db/schema_migrations/20230705145827 b/db/schema_migrations/20230705145827 deleted file mode 100644 index 48bf419a084629eadd6052b265305ba4c651f197..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230705145827 +++ /dev/null @@ -1 +0,0 @@ -c6bd06a0e306916809474790126ba90089c8f0dd8d25e3858f2e7b416996c9c8 \ No newline at end of file diff --git a/db/schema_migrations/20230705150100 b/db/schema_migrations/20230705150100 deleted file mode 100644 index 07da63247f9bf7cfefacda6006307f46ddc00a3a..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230705150100 +++ /dev/null @@ -1 +0,0 @@ -62ea862f8911a5114cfa8140862e1a3c5be7cf4f80064d72c453f8c81d8a7623 \ No newline at end of file diff --git a/db/schema_migrations/20230705155000 b/db/schema_migrations/20230705155000 deleted file mode 100644 index e2f6d13e31e102c706f073fbf0f34f3cfd96c8fc..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230705155000 +++ /dev/null @@ -1 +0,0 @@ -4f3d64c52ac1b46bab194be78cadeaa36abf3faf26de1c7d7ca3c03cc64b876f \ No newline at end of file diff --git a/db/schema_migrations/20230706011541 b/db/schema_migrations/20230706011541 deleted file mode 100644 index 4cebe9198b393091e42dfd7a4c9b25fb03ab417c..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230706011541 +++ /dev/null @@ -1 +0,0 @@ -fad04601d706468f7e77a232e07125c152373f9fe2c443a661e0d5ee68ea6e7b \ No newline at end of file diff --git a/db/schema_migrations/20230706073937 b/db/schema_migrations/20230706073937 deleted file mode 100644 index 56c214818d7cd05811cce9bfa5eeca95b9995f58..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230706073937 +++ /dev/null @@ -1 +0,0 @@ -e7cf459527a96936684778c46bfc3b3490d314f4dbf5e3a3daca8670f1fcaeaf \ No newline at end of file diff --git a/db/schema_migrations/20230706080234 b/db/schema_migrations/20230706080234 deleted file mode 100644 index a188efbf3ca176a70085324a1666c76b640cf96c..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230706080234 +++ /dev/null @@ -1 +0,0 @@ -a76b57ff9a9e62c1e8d73c46a9bdf6512f0fe48d3b95b4c9a291d602d54d7a33 \ No newline at end of file diff --git a/db/schema_migrations/20230706130217 b/db/schema_migrations/20230706130217 deleted file mode 100644 index 8d2a74a3fc2b42a1e25bddf6097c4dc4c6cc9b31..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230706130217 +++ /dev/null @@ -1 +0,0 @@ -3a355ebb2299786d9aa5ce9bf1f07b2bbd3b6aca719c12c78c4a945c4a96cfe3 \ No newline at end of file diff --git a/db/schema_migrations/20230706192435 b/db/schema_migrations/20230706192435 deleted file mode 100644 index 190b795da802ab1c7eef1d14b2c03d8a81320e2a..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230706192435 +++ /dev/null @@ -1 +0,0 @@ -92018d19330a9808bf1ee93c8a950d68794213fb600b040ebe5fbb7420c0d1f0 \ No newline at end of file diff --git a/db/schema_migrations/20230707090835 b/db/schema_migrations/20230707090835 deleted file mode 100644 index 8add6e8e125b3d34191e70b4dc470249f7813a5a..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230707090835 +++ /dev/null @@ -1 +0,0 @@ -500559ce2b6a3ef8dbf33c6e1ebd1e11b4645d19b52139eaa247fc06c00a1f7c \ No newline at end of file diff --git a/db/schema_migrations/20230707094002 b/db/schema_migrations/20230707094002 deleted file mode 100644 index 1d19e5bc29e10f006673f7e30be08545a7fbb8dc..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230707094002 +++ /dev/null @@ -1 +0,0 @@ -7e946c03c02800868016387682c3f4146edcd604c8007747ff64b6e4ef4badb2 \ No newline at end of file diff --git a/db/schema_migrations/20230707094003 b/db/schema_migrations/20230707094003 deleted file mode 100644 index 56442a983eeb2c88356e8bcafc4656c9fad4c2ee..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230707094003 +++ /dev/null @@ -1 +0,0 @@ -bf71e6fec331ea1b38a79fc376f63ce30c896f197ffa335b0ec8a914317a391f \ No newline at end of file diff --git a/db/schema_migrations/20230707114012 b/db/schema_migrations/20230707114012 deleted file mode 100644 index b9525ad8a6791992f45abb359f7e492b70b4f733..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230707114012 +++ /dev/null @@ -1 +0,0 @@ -dc0b3017e7dc807b18382cc0a19725be652eea6210c4b5b716093557deace62d \ No newline at end of file diff --git a/db/schema_migrations/20230707211358 b/db/schema_migrations/20230707211358 deleted file mode 100644 index 2f1f6a3d370ee5443c1b99ddfc21bb2ec8a7cbd9..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230707211358 +++ /dev/null @@ -1 +0,0 @@ -1f2ae1ac4c26b8fe257c158e9c1b9a99a590176e8566d7b9f22c4265177c861a \ No newline at end of file diff --git a/db/schema_migrations/20230707211359 b/db/schema_migrations/20230707211359 deleted file mode 100644 index 00cc079594cd54c4aedbb166c964eff31b2c9d9b..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230707211359 +++ /dev/null @@ -1 +0,0 @@ -7b319745b746418deedc6130cf6ed2860e0c4a01af9b15548dfacac314cdabe2 \ No newline at end of file diff --git a/db/schema_migrations/20230707220646 b/db/schema_migrations/20230707220646 deleted file mode 100644 index 7577fce91319ad6825c6f4c61ffae67d973661ec..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230707220646 +++ /dev/null @@ -1 +0,0 @@ -6f801df7ed92d70e6f603d36b8c23c4e133e09b05040f848ca8d71581b8a793f \ No newline at end of file diff --git a/db/schema_migrations/20230710160232 b/db/schema_migrations/20230710160232 deleted file mode 100644 index 08f2ba7fa32afcbf2202645865a6daaa0ee2095b..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230710160232 +++ /dev/null @@ -1 +0,0 @@ -1f894fea060c0abee05799f161665214d66c8e8f0509b464b2bf6a35964f457b \ No newline at end of file diff --git a/db/schema_migrations/20230710200434 b/db/schema_migrations/20230710200434 deleted file mode 100644 index f58e9cdc0605d5d81bb00c0ef6d73a26f8ff0e4a..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230710200434 +++ /dev/null @@ -1 +0,0 @@ -ee8f60421aed0a748b55efce7292c319159f21d9112cd61012a771654f70a769 \ No newline at end of file diff --git a/db/schema_migrations/20230711093010 b/db/schema_migrations/20230711093010 deleted file mode 100644 index 7fcdd69e7dfd875d8209e655c9e1569f95ae05b9..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230711093010 +++ /dev/null @@ -1 +0,0 @@ -1634c4bbe3fd813098a4865db2d84e83fd9eac967723c4500da4c78e9255af46 \ No newline at end of file diff --git a/db/schema_migrations/20230712020407 b/db/schema_migrations/20230712020407 deleted file mode 100644 index d31382ed737130c0b818618cce336353931e72ea..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230712020407 +++ /dev/null @@ -1 +0,0 @@ -3dc44ced12562d7846fcdc0ad956993705b13f0ecc2418d6ef1853337eea2fff \ No newline at end of file diff --git a/db/schema_migrations/20230712064637 b/db/schema_migrations/20230712064637 deleted file mode 100644 index 7b541ed714de70b4550703183c6b81ce80b42233..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230712064637 +++ /dev/null @@ -1 +0,0 @@ -b39d83cc2257d75ece3dfa1c5f6faa1ef6eb1c40d3de0a1899a2860d5a1c7ed1 \ No newline at end of file diff --git a/db/schema_migrations/20230712064655 b/db/schema_migrations/20230712064655 deleted file mode 100644 index 860b5183a045930c1898292725c988665f7ddc43..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230712064655 +++ /dev/null @@ -1 +0,0 @@ -25d0b4c560dcec564a268d96e969b07fbfe18f1d902fdafe415cf747bdb1302c \ No newline at end of file diff --git a/db/schema_migrations/20230712145323 b/db/schema_migrations/20230712145323 deleted file mode 100644 index 00d938eb59934cadd0e092bc86341e801f22e4fc..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230712145323 +++ /dev/null @@ -1 +0,0 @@ -3102bb4fb27322ca9a0b2f60757a0bb90d7fce74a8607226f2e2bcf336563ceb \ No newline at end of file diff --git a/db/schema_migrations/20230712145821 b/db/schema_migrations/20230712145821 deleted file mode 100644 index 8282462f0de8a7dcdd08b75ea753ac974e1730b7..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230712145821 +++ /dev/null @@ -1 +0,0 @@ -cf697183d364abeab6c9701f51db570f153d88949b51a8e157a502c0a38f007e \ No newline at end of file diff --git a/db/schema_migrations/20230712145926 b/db/schema_migrations/20230712145926 deleted file mode 100644 index b0666ce0cf6f41922acca94a0e20a341e1bef8d4..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230712145926 +++ /dev/null @@ -1 +0,0 @@ -992137f8611e57d44b4b3a861fce07353f0eccfafa894dd3cede02554bcde424 \ No newline at end of file diff --git a/db/schema_migrations/20230712214613 b/db/schema_migrations/20230712214613 deleted file mode 100644 index f9afbe825d699a2bcb6674677640b69a0fbfa67a..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230712214613 +++ /dev/null @@ -1 +0,0 @@ -56415a907d3bba749b9d42b5f37919981e779f0422c86793028d128350875f2d \ No newline at end of file diff --git a/db/schema_migrations/20230713020247 b/db/schema_migrations/20230713020247 deleted file mode 100644 index a11206d6e55fa884d3be3bf47da135134aff49eb..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230713020247 +++ /dev/null @@ -1 +0,0 @@ -8fcab29ea25760d876c2b985cf9e4f2a62e25450322a92fe769533b0882b5402 \ No newline at end of file diff --git a/db/schema_migrations/20230713100100 b/db/schema_migrations/20230713100100 deleted file mode 100644 index ee77da01273d8c45ce7fcd212fae0132b351295f..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230713100100 +++ /dev/null @@ -1 +0,0 @@ -9787c717ecf74dd05277bde331b554fb824d6d39df83b5d46bac45ba1962e96a \ No newline at end of file diff --git a/db/schema_migrations/20230714195649 b/db/schema_migrations/20230714195649 deleted file mode 100644 index 7d0954f5ed84c83c395320abcd6d465868bb40a8..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230714195649 +++ /dev/null @@ -1 +0,0 @@ -d47e6e46f9c70ae93c929e93bc361f3ca88ae86d1139110ddda341564a465b60 \ No newline at end of file diff --git a/db/schema_migrations/20230717200940 b/db/schema_migrations/20230717200940 deleted file mode 100644 index 6e25e66b8f8e55b38edc1b2547e67466f476da33..0000000000000000000000000000000000000000 --- a/db/schema_migrations/20230717200940 +++ /dev/null @@ -1 +0,0 @@ -970898c369a13483eab732969f1ef3a63f7bcaf041fdb8a2b8c10e93da0de7c1 \ No newline at end of file diff --git a/ee/spec/lib/ee/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size_spec.rb b/ee/spec/lib/ee/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size_spec.rb index 65bf3ace23c272b5102b574bccc3d7e77b382aaf..0dd958b3869399d3215170a1911331d81d47686d 100644 --- a/ee/spec/lib/ee/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size_spec.rb +++ b/ee/spec/lib/ee/gitlab/background_migration/backfill_project_statistics_storage_size_without_uploads_size_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillProjectStatisticsStorageSizeWithoutUploadsSize, :migration, schema: 20230616082958, feature_category: :consumables_cost_management do # rubocop:disable Layout/LineLength +RSpec.describe Gitlab::BackgroundMigration::BackfillProjectStatisticsStorageSizeWithoutUploadsSize, :migration, schema: 20230718020825, feature_category: :consumables_cost_management do # rubocop:disable Layout/LineLength include MigrationHelpers::ProjectStatisticsHelper let!(:namespace) { table(:namespaces) } diff --git a/spec/lib/gitlab/background_migration/backfill_code_suggestions_namespace_settings_spec.rb b/spec/lib/gitlab/background_migration/backfill_code_suggestions_namespace_settings_spec.rb index 5df398b0d4470e7ef144bf38b460c62a05ede6a3..ce44074b844ec01889be9163cd0b5d23e0049889 100644 --- a/spec/lib/gitlab/background_migration/backfill_code_suggestions_namespace_settings_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_code_suggestions_namespace_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillCodeSuggestionsNamespaceSettings, schema: 20230616082958, feature_category: :code_suggestions do # rubocop:disable Layout/LineLength +RSpec.describe Gitlab::BackgroundMigration::BackfillCodeSuggestionsNamespaceSettings, schema: 20230718020825, feature_category: :code_suggestions do # rubocop:disable Layout/LineLength let(:namespaces_table) { table(:namespaces) } let(:namespace_settings_table) { table(:namespace_settings) } diff --git a/spec/lib/gitlab/background_migration/backfill_design_management_repositories_spec.rb b/spec/lib/gitlab/background_migration/backfill_design_management_repositories_spec.rb index 1efe0bd8d049b0b1f34c17205c31a291827647ff..fdf7504e7f4ae3eb0f1599cfba210884377c8490 100644 --- a/spec/lib/gitlab/background_migration/backfill_design_management_repositories_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_design_management_repositories_spec.rb @@ -4,7 +4,7 @@ RSpec.describe( Gitlab::BackgroundMigration::BackfillDesignManagementRepositories, - schema: 20230616082958, + schema: 20230718020825, feature_category: :geo_replication ) do let!(:namespaces) { table(:namespaces) } diff --git a/spec/lib/gitlab/background_migration/backfill_environment_tiers_spec.rb b/spec/lib/gitlab/background_migration/backfill_environment_tiers_spec.rb index 4247b5c54b105d3f15ab7940fed1fae686044fdc..0006a692bd60300c4e11831358ad8af98375b230 100644 --- a/spec/lib/gitlab/background_migration/backfill_environment_tiers_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_environment_tiers_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe Gitlab::BackgroundMigration::BackfillEnvironmentTiers, - :migration, schema: 20230616082958, feature_category: :continuous_delivery do + :migration, schema: 20230718020825, feature_category: :continuous_delivery do let!(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') } let!(:project) { table(:projects).create!(namespace_id: namespace.id, project_namespace_id: namespace.id) } diff --git a/spec/lib/gitlab/background_migration/backfill_integrations_enable_ssl_verification_spec.rb b/spec/lib/gitlab/background_migration/backfill_integrations_enable_ssl_verification_spec.rb index 9c71d8f1c9a18a0ee66156e245102ad9fe1ded02..bf72946f03f40bee4786a41be1f70995d9f293d1 100644 --- a/spec/lib/gitlab/background_migration/backfill_integrations_enable_ssl_verification_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_integrations_enable_ssl_verification_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillIntegrationsEnableSslVerification, schema: 20230616082958 do +RSpec.describe Gitlab::BackgroundMigration::BackfillIntegrationsEnableSslVerification, schema: 20230718020825 do let(:migration) { described_class.new } let(:integrations) { described_class::Integration } diff --git a/spec/lib/gitlab/background_migration/backfill_missing_ci_cd_settings_spec.rb b/spec/lib/gitlab/background_migration/backfill_missing_ci_cd_settings_spec.rb index 8f7d5f25a8009702d37a652a8397a65ee337a778..a94228f89b42477c78deaae48cc4fb579f882803 100644 --- a/spec/lib/gitlab/background_migration/backfill_missing_ci_cd_settings_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_missing_ci_cd_settings_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillMissingCiCdSettings, schema: 20230628023103, feature_category: :source_code_management do # rubocop:disable Layout/LineLength +RSpec.describe Gitlab::BackgroundMigration::BackfillMissingCiCdSettings, schema: 20230718020825, feature_category: :source_code_management do # rubocop:disable Layout/LineLength let(:projects_table) { table(:projects) } let(:namespaces_table) { table(:namespaces) } let(:ci_cd_settings_table) { table(:project_ci_cd_settings) } diff --git a/spec/lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads_spec.rb b/spec/lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads_spec.rb index 4594d9c1ba5239e991acc7ba36b6f01b0dd0d696..f7c2d1b9e40aaea13c4225af6ccb27aad2c750b3 100644 --- a/spec/lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_namespace_id_of_vulnerability_reads_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceIdOfVulnerabilityReads, schema: 20230616082958 do +RSpec.describe Gitlab::BackgroundMigration::BackfillNamespaceIdOfVulnerabilityReads, schema: 20230718020825 do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:users) { table(:users) } diff --git a/spec/lib/gitlab/background_migration/backfill_prepared_at_merge_requests_spec.rb b/spec/lib/gitlab/background_migration/backfill_prepared_at_merge_requests_spec.rb index 8bc08c2196c3a27dad984f0fe19149511041bb12..307103d799254ff6deb9e09ba15c79845f8222b2 100644 --- a/spec/lib/gitlab/background_migration/backfill_prepared_at_merge_requests_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_prepared_at_merge_requests_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe Gitlab::BackgroundMigration::BackfillPreparedAtMergeRequests, :migration, - feature_category: :code_review_workflow, schema: 20230616082958 do + feature_category: :code_review_workflow, schema: 20230718020825 do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:mr_table) { table(:merge_requests) } diff --git a/spec/lib/gitlab/background_migration/backfill_project_wiki_repositories_spec.rb b/spec/lib/gitlab/background_migration/backfill_project_wiki_repositories_spec.rb index 5b946d91b66a1682e4e9d3f99ab608d52a348d35..83b8de8a6b09082cb0cc67d46725cdbc43584fdb 100644 --- a/spec/lib/gitlab/background_migration/backfill_project_wiki_repositories_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_project_wiki_repositories_spec.rb @@ -4,7 +4,7 @@ RSpec.describe( Gitlab::BackgroundMigration::BackfillProjectWikiRepositories, - schema: 20230616082958, + schema: 20230718020825, feature_category: :geo_replication) do let!(:namespaces) { table(:namespaces) } let!(:projects) { table(:projects) } diff --git a/spec/lib/gitlab/background_migration/backfill_releases_author_id_spec.rb b/spec/lib/gitlab/background_migration/backfill_releases_author_id_spec.rb index 43a35859807a32ce139e00b20ff65adba8a86349..ec35eff1afb51f5f8fb08d2f1d648a4cd1cf5c02 100644 --- a/spec/lib/gitlab/background_migration/backfill_releases_author_id_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_releases_author_id_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe Gitlab::BackgroundMigration::BackfillReleasesAuthorId, - :migration, schema: 20230616082958, feature_category: :release_orchestration do + :migration, schema: 20230718020825, feature_category: :release_orchestration do let(:releases_table) { table(:releases) } let(:user_table) { table(:users) } let(:date_time) { DateTime.now } diff --git a/spec/lib/gitlab/background_migration/backfill_resource_link_events_spec.rb b/spec/lib/gitlab/background_migration/backfill_resource_link_events_spec.rb index 5c8fcb125eb61979545935be6db2370a11cc96fc..1276e5b0b6640e9338ff7d60a9e26003379f1648 100644 --- a/spec/lib/gitlab/background_migration/backfill_resource_link_events_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_resource_link_events_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillResourceLinkEvents, schema: 20230616082958, feature_category: :team_planning do +RSpec.describe Gitlab::BackgroundMigration::BackfillResourceLinkEvents, schema: 20230718020825, feature_category: :team_planning do include MigrationHelpers::WorkItemTypesHelper let(:users) { table(:users) } diff --git a/spec/lib/gitlab/background_migration/backfill_root_storage_statistics_fork_storage_sizes_spec.rb b/spec/lib/gitlab/background_migration/backfill_root_storage_statistics_fork_storage_sizes_spec.rb index 2d1fc7d49edfe53ad0bec76473bcac44f5d537d8..78c0797ba46fb741cbce39d2059cbd3b456d52a0 100644 --- a/spec/lib/gitlab/background_migration/backfill_root_storage_statistics_fork_storage_sizes_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_root_storage_statistics_fork_storage_sizes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillRootStorageStatisticsForkStorageSizes, schema: 20230616082958, feature_category: :consumables_cost_management do # rubocop:disable Layout/LineLength +RSpec.describe Gitlab::BackgroundMigration::BackfillRootStorageStatisticsForkStorageSizes, schema: 20230718020825, feature_category: :consumables_cost_management do # rubocop:disable Layout/LineLength describe '#perform' do let(:namespaces_table) { table(:namespaces) } let(:root_storage_statistics_table) { table(:namespace_root_storage_statistics) } diff --git a/spec/lib/gitlab/background_migration/backfill_topics_title_spec.rb b/spec/lib/gitlab/background_migration/backfill_topics_title_spec.rb index 5a654183f2ee2932e6e75c9eb77fefe23d498d6f..eac5ad48f7ea91496888c7b7994356355a70617d 100644 --- a/spec/lib/gitlab/background_migration/backfill_topics_title_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_topics_title_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillTopicsTitle, schema: 20230616082958 do +RSpec.describe Gitlab::BackgroundMigration::BackfillTopicsTitle, schema: 20230718020825 do it 'correctly backfills the title of the topics' do topics = table(:topics) diff --git a/spec/lib/gitlab/background_migration/backfill_uuid_conversion_column_in_vulnerability_occurrences_spec.rb b/spec/lib/gitlab/background_migration/backfill_uuid_conversion_column_in_vulnerability_occurrences_spec.rb index 699fa39c3090f73005574489c8b1c6477eb06d6a..1457157153db37b366bdb05caa8ce6b116286459 100644 --- a/spec/lib/gitlab/background_migration/backfill_uuid_conversion_column_in_vulnerability_occurrences_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_uuid_conversion_column_in_vulnerability_occurrences_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillUuidConversionColumnInVulnerabilityOccurrences, schema: 20230629095819, feature_category: :vulnerability_management do # rubocop:disable Layout/LineLength +RSpec.describe Gitlab::BackgroundMigration::BackfillUuidConversionColumnInVulnerabilityOccurrences, schema: 20230718020825, feature_category: :vulnerability_management do # rubocop:disable Layout/LineLength let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:users) { table(:users) } diff --git a/spec/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent_spec.rb b/spec/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent_spec.rb index 1461378623ebff4cd13a945d83eca9fad5f1ac4e..e60dcd6d9445bf1793fb12aad88a87597959596e 100644 --- a/spec/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent_spec.rb +++ b/spec/lib/gitlab/background_migration/backfill_vulnerability_reads_cluster_agent_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::BackfillVulnerabilityReadsClusterAgent, :migration, schema: 20230616082958 do # rubocop:disable Layout/LineLength +RSpec.describe Gitlab::BackgroundMigration::BackfillVulnerabilityReadsClusterAgent, :migration, schema: 20230718020825 do # rubocop:disable Layout/LineLength let(:migration) do described_class.new( start_id: 1, end_id: 10, diff --git a/spec/lib/gitlab/background_migration/delete_orphaned_packages_dependencies_spec.rb b/spec/lib/gitlab/background_migration/delete_orphaned_packages_dependencies_spec.rb index af3de69d0ca816f72da02ea2fe5dade3137177b0..0989929e7c5fb2318ecd4092497764139f016b4a 100644 --- a/spec/lib/gitlab/background_migration/delete_orphaned_packages_dependencies_spec.rb +++ b/spec/lib/gitlab/background_migration/delete_orphaned_packages_dependencies_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::DeleteOrphanedPackagesDependencies, schema: 20230616082958, +RSpec.describe Gitlab::BackgroundMigration::DeleteOrphanedPackagesDependencies, schema: 20230718020825, feature_category: :package_registry do let!(:migration_attrs) do { diff --git a/spec/lib/gitlab/background_migration/destroy_invalid_members_spec.rb b/spec/lib/gitlab/background_migration/destroy_invalid_members_spec.rb index a26f43815c1a513edf50ae5b47ae9761dd2060b4..5ddfa50ad3f9f350129a90f6a528d38a1873c42e 100644 --- a/spec/lib/gitlab/background_migration/destroy_invalid_members_spec.rb +++ b/spec/lib/gitlab/background_migration/destroy_invalid_members_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' # rubocop: disable RSpec/MultipleMemoizedHelpers -RSpec.describe Gitlab::BackgroundMigration::DestroyInvalidMembers, :migration, schema: 20230616082958 do +RSpec.describe Gitlab::BackgroundMigration::DestroyInvalidMembers, :migration, schema: 20230718020825 do let!(:migration_attrs) do { start_id: 1, diff --git a/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb b/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb index 362a4c3d1bd90ea7914c5d7f48eeec94ee64e4e5..e0003821c40aaada5128adb09ac2b4d0da194abc 100644 --- a/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb +++ b/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_one_member_no_repo_projects_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Gitlab::BackgroundMigration::DisableLegacyOpenSourceLicenseForOneMemberNoRepoProjects, :migration, - schema: 20230616082958 do + schema: 20230718020825 do let(:namespaces_table) { table(:namespaces) } let(:projects_table) { table(:projects) } let(:project_settings_table) { table(:project_settings) } diff --git a/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_five_mb_spec.rb b/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_five_mb_spec.rb index 1cca6790b9da3ce32b47c36cb8bcbe7cd4028148..69563e0d19d23f9b9de7f3b930d092572e98ff78 100644 --- a/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_five_mb_spec.rb +++ b/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_five_mb_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Gitlab::BackgroundMigration::DisableLegacyOpenSourceLicenseForProjectsLessThanFiveMb, :migration, - schema: 20230616082958, + schema: 20230718020825, feature_category: :groups_and_projects do let(:namespaces_table) { table(:namespaces) } let(:projects_table) { table(:projects) } diff --git a/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb_spec.rb b/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb_spec.rb index 308671277b0ec71bfdb6d6f00e0f271b55014ae1..639bbeed87cca940b60c314d8313aa1d58854463 100644 --- a/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb_spec.rb +++ b/spec/lib/gitlab/background_migration/disable_legacy_open_source_license_for_projects_less_than_one_mb_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Gitlab::BackgroundMigration::DisableLegacyOpenSourceLicenseForProjectsLessThanOneMb, :migration, - schema: 20230616082958 do + schema: 20230718020825 do let(:namespaces_table) { table(:namespaces) } let(:projects_table) { table(:projects) } let(:project_settings_table) { table(:project_settings) } diff --git a/spec/lib/gitlab/background_migration/fix_vulnerability_reads_has_issues_spec.rb b/spec/lib/gitlab/background_migration/fix_vulnerability_reads_has_issues_spec.rb index 6682a88ce8a382ce2edd4f54917ce158bb28491a..943298e69c2c9e54866fc754f74f985db4f4f30a 100644 --- a/spec/lib/gitlab/background_migration/fix_vulnerability_reads_has_issues_spec.rb +++ b/spec/lib/gitlab/background_migration/fix_vulnerability_reads_has_issues_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::FixVulnerabilityReadsHasIssues, schema: 20230616082958, feature_category: :vulnerability_management do # rubocop:disable Layout/LineLength +RSpec.describe Gitlab::BackgroundMigration::FixVulnerabilityReadsHasIssues, schema: 20230718020825, feature_category: :vulnerability_management do # rubocop:disable Layout/LineLength let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:users) { table(:users) } diff --git a/spec/lib/gitlab/background_migration/populate_projects_star_count_spec.rb b/spec/lib/gitlab/background_migration/populate_projects_star_count_spec.rb index 2fb5d30a1f518c64863ed4fdf604b564f0d543ed..4ceeda3298297598f373d2528f9dc4d8ac4d2854 100644 --- a/spec/lib/gitlab/background_migration/populate_projects_star_count_spec.rb +++ b/spec/lib/gitlab/background_migration/populate_projects_star_count_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::PopulateProjectsStarCount, schema: 20230616082958 do +RSpec.describe Gitlab::BackgroundMigration::PopulateProjectsStarCount, schema: 20230718020825 do let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } let(:users) { table(:users) } diff --git a/spec/lib/gitlab/background_migration/populate_vulnerability_dismissal_fields_spec.rb b/spec/lib/gitlab/background_migration/populate_vulnerability_dismissal_fields_spec.rb index da0e6f2df0d5faf55b3ac7ecb59695c4df59601b..f184b1acd62e490438ec6607f3255a6b752f0cc0 100644 --- a/spec/lib/gitlab/background_migration/populate_vulnerability_dismissal_fields_spec.rb +++ b/spec/lib/gitlab/background_migration/populate_vulnerability_dismissal_fields_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::PopulateVulnerabilityDismissalFields, schema: 20230616082958, feature_category: :vulnerability_management do # rubocop:disable Layout/LineLength +RSpec.describe Gitlab::BackgroundMigration::PopulateVulnerabilityDismissalFields, schema: 20230718020825, feature_category: :vulnerability_management do # rubocop:disable Layout/LineLength let(:users) { table(:users) } let(:namespaces) { table(:namespaces) } let(:projects) { table(:projects) } diff --git a/spec/lib/gitlab/background_migration/remove_invalid_deploy_access_level_groups_spec.rb b/spec/lib/gitlab/background_migration/remove_invalid_deploy_access_level_groups_spec.rb index 528e614e312d25f1b07b64880827274a8b68c9e8..5eaf070cd1576b3cb806a3774b74fe22f0fbb21d 100644 --- a/spec/lib/gitlab/background_migration/remove_invalid_deploy_access_level_groups_spec.rb +++ b/spec/lib/gitlab/background_migration/remove_invalid_deploy_access_level_groups_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' RSpec.describe Gitlab::BackgroundMigration::RemoveInvalidDeployAccessLevelGroups, - :migration, schema: 20230616082958, feature_category: :continuous_delivery do + :migration, schema: 20230718020825, feature_category: :continuous_delivery do let!(:namespace) { table(:namespaces).create!(name: 'user', path: 'user') } let!(:project) { table(:projects).create!(namespace_id: namespace.id, project_namespace_id: namespace.id) } let!(:group) { table(:namespaces).create!(name: 'group', path: 'group', type: 'Group') } diff --git a/spec/lib/gitlab/background_migration/remove_self_managed_wiki_notes_spec.rb b/spec/lib/gitlab/background_migration/remove_self_managed_wiki_notes_spec.rb index 2e57ab765e780e8354cf5b9235b94cb532e84256..c5969f05b5dbd3401a8b47edb7e9effdcddc2ffe 100644 --- a/spec/lib/gitlab/background_migration/remove_self_managed_wiki_notes_spec.rb +++ b/spec/lib/gitlab/background_migration/remove_self_managed_wiki_notes_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Gitlab::BackgroundMigration::RemoveSelfManagedWikiNotes, :migration, schema: 20230616082958 do +RSpec.describe Gitlab::BackgroundMigration::RemoveSelfManagedWikiNotes, :migration, schema: 20230718020825 do let(:notes) { table(:notes) } subject(:perform_migration) do diff --git a/spec/lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects_spec.rb b/spec/lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects_spec.rb index 9796d8f043ea4a2828348aa7ec9f87c82b1835dd..03a6468d0573ffb63d789ec35dc8a85606a3ecea 100644 --- a/spec/lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects_spec.rb +++ b/spec/lib/gitlab/background_migration/set_legacy_open_source_license_available_for_non_public_projects_spec.rb @@ -4,7 +4,7 @@ RSpec.describe Gitlab::BackgroundMigration::SetLegacyOpenSourceLicenseAvailableForNonPublicProjects, :migration, - schema: 20230616082958 do + schema: 20230718020825 do let(:namespaces_table) { table(:namespaces) } let(:projects_table) { table(:projects) } let(:project_settings_table) { table(:project_settings) } diff --git a/spec/lib/gitlab/background_migration/truncate_overlong_vulnerability_html_titles_spec.rb b/spec/lib/gitlab/background_migration/truncate_overlong_vulnerability_html_titles_spec.rb index ea60fb8658af837bbb8ab2e1388958cff294a21a..8a514b119b6b7d6f533e72719b337e815de34454 100644 --- a/spec/lib/gitlab/background_migration/truncate_overlong_vulnerability_html_titles_spec.rb +++ b/spec/lib/gitlab/background_migration/truncate_overlong_vulnerability_html_titles_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' # rubocop:disable Layout/LineLength -RSpec.describe Gitlab::BackgroundMigration::TruncateOverlongVulnerabilityHtmlTitles, schema: 20230616082958, feature_category: :vulnerability_management do +RSpec.describe Gitlab::BackgroundMigration::TruncateOverlongVulnerabilityHtmlTitles, schema: 20230718020825, feature_category: :vulnerability_management do # rubocop:enable Layout/LineLength let(:namespaces) { table(:namespaces) } diff --git a/spec/migrations/20230530012406_finalize_backfill_resource_link_events_spec.rb b/spec/migrations/20230530012406_finalize_backfill_resource_link_events_spec.rb deleted file mode 100644 index 30aa69b0d5abb3978faf2492ddbd80ff86bbe0bf..0000000000000000000000000000000000000000 --- a/spec/migrations/20230530012406_finalize_backfill_resource_link_events_spec.rb +++ /dev/null @@ -1,68 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe FinalizeBackfillResourceLinkEvents, feature_category: :team_planning do - let(:batched_migrations) { table(:batched_background_migrations) } - - context 'when migration is missing' do - before do - batched_migrations.where(job_class_name: described_class::MIGRATION).delete_all - end - - it 'warns migration not found' do - expect(Gitlab::AppLogger) - .to receive(:warn).with(/Could not find batched background migration for the given configuration:/) - .once - - migrate! - end - end - - context 'with migration present' do - let!(:batched_migration) do - batched_migrations.create!( - job_class_name: described_class::MIGRATION, - table_name: :system_note_metadata, - column_name: :id, - interval: 2.minutes, - min_value: 1, - max_value: 5, - batch_size: 5, - sub_batch_size: 5, - gitlab_schema: :gitlab_main, - status: status - ) - end - - context 'when migrations have finished' do - let(:status) { 3 } # finished enum value - - it 'does not raise an error' do - expect { migrate! }.not_to raise_error - end - end - - context 'with different migration statuses' do - using RSpec::Parameterized::TableSyntax - - where(:status, :description) do - 0 | 'paused' - 1 | 'active' - 4 | 'failed' - 5 | 'finalizing' - end - - with_them do - it 'finalizes the migration' do - expect do - migrate! - - batched_migration.reload - end.to change { batched_migration.status }.from(status).to(6) - end - end - end - end -end diff --git a/spec/migrations/20230613192703_ensure_ci_build_needs_big_int_backfill_is_finished_for_self_hosts_spec.rb b/spec/migrations/20230613192703_ensure_ci_build_needs_big_int_backfill_is_finished_for_self_hosts_spec.rb deleted file mode 100644 index 0fe9cecb7294f800660c2a477457d30ff7296921..0000000000000000000000000000000000000000 --- a/spec/migrations/20230613192703_ensure_ci_build_needs_big_int_backfill_is_finished_for_self_hosts_spec.rb +++ /dev/null @@ -1,25 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe EnsureCiBuildNeedsBigIntBackfillIsFinishedForSelfHosts, migration: :gitlab_ci, feature_category: :continuous_integration do - describe '#up' do - let(:migration_arguments) do - { - job_class_name: 'CopyColumnUsingBackgroundMigrationJob', - table_name: 'ci_build_needs', - column_name: 'id', - job_arguments: [['id'], ['id_convert_to_bigint']] - } - end - - it 'ensures the migration is completed' do - expect_next_instance_of(described_class) do |instance| - expect(instance).to receive(:ensure_batched_background_migration_is_finished).with(migration_arguments) - end - - migrate! - end - end -end diff --git a/spec/migrations/20230613192703_swap_ci_build_needs_to_big_int_for_self_hosts_spec.rb b/spec/migrations/20230613192703_swap_ci_build_needs_to_big_int_for_self_hosts_spec.rb deleted file mode 100644 index 3db5d3b3c1612f1f1cf5b0bc311a792b976726d5..0000000000000000000000000000000000000000 --- a/spec/migrations/20230613192703_swap_ci_build_needs_to_big_int_for_self_hosts_spec.rb +++ /dev/null @@ -1,146 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe SwapCiBuildNeedsToBigIntForSelfHosts, feature_category: :continuous_integration do - after do - connection = described_class.new.connection - connection.execute('ALTER TABLE ci_build_needs DROP COLUMN IF EXISTS id_convert_to_bigint') - end - - describe '#up' do - context 'when on GitLab.com, dev, or test' do - before do - connection = described_class.new.connection - connection.execute('ALTER TABLE ci_build_needs ALTER COLUMN id TYPE bigint') - connection.execute('ALTER TABLE ci_build_needs DROP COLUMN IF EXISTS id_convert_to_bigint') - end - - it 'does not swap the columns' do - # rubocop: disable RSpec/AnyInstanceOf - allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(true) - # rubocop: enable RSpec/AnyInstanceOf - - ci_build_needs = table(:ci_build_needs) - - disable_migrations_output do - reversible_migration do |migration| - migration.before -> { - ci_build_needs.reset_column_information - - expect(ci_build_needs.columns.find { |c| c.name == 'id' }.sql_type).to eq('bigint') - expect(ci_build_needs.columns.find { |c| c.name == 'id_convert_to_bigint' }).to be nil - } - - migration.after -> { - ci_build_needs.reset_column_information - - expect(ci_build_needs.columns.find { |c| c.name == 'id' }.sql_type).to eq('bigint') - expect(ci_build_needs.columns.find { |c| c.name == 'id_convert_to_bigint' }).to be nil - } - end - end - end - end - - context 'when a self-hosted installation has already completed the swap' do - before do - connection = described_class.new.connection - connection.execute('ALTER TABLE ci_build_needs ALTER COLUMN id TYPE bigint') - connection.execute('ALTER TABLE ci_build_needs ADD COLUMN IF NOT EXISTS id_convert_to_bigint integer') - end - - it 'does not swap the columns' do - # rubocop: disable RSpec/AnyInstanceOf - allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false) - # rubocop: enable RSpec/AnyInstanceOf - - ci_build_needs = table(:ci_build_needs) - - migrate! - - expect(ci_build_needs.columns.find { |c| c.name == 'id' }.sql_type).to eq('bigint') - expect(ci_build_needs.columns.find do |c| - c.name == 'id_convert_to_bigint' - end.sql_type).to eq('integer') - end - end - - context 'when a self-hosted installation has the `id_convert_to_bigint` column already dropped' do - before do - connection = described_class.new.connection - connection.execute('ALTER TABLE ci_build_needs ALTER COLUMN id TYPE bigint') - connection.execute('ALTER TABLE ci_build_needs DROP COLUMN IF EXISTS id_convert_to_bigint') - end - - it 'does not swap the columns' do - # rubocop: disable RSpec/AnyInstanceOf - allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false) - # rubocop: enable RSpec/AnyInstanceOf - - ci_build_needs = table(:ci_build_needs) - - disable_migrations_output do - reversible_migration do |migration| - migration.before -> { - ci_build_needs.reset_column_information - - expect(ci_build_needs.columns.find { |c| c.name == 'id' }.sql_type).to eq('bigint') - expect(ci_build_needs.columns.find { |c| c.name == 'id_convert_to_bigint' }).to be nil - } - - migration.after -> { - ci_build_needs.reset_column_information - - expect(ci_build_needs.columns.find { |c| c.name == 'id' }.sql_type).to eq('bigint') - expect(ci_build_needs.columns.find { |c| c.name == 'id_convert_to_bigint' }).to be nil - } - end - end - end - end - - context 'when an installation is self-hosted' do - before do - connection = described_class.new.connection - connection.execute('ALTER TABLE ci_build_needs ALTER COLUMN id TYPE integer') - connection.execute('ALTER TABLE ci_build_needs ADD COLUMN IF NOT EXISTS id_convert_to_bigint bigint') - connection.execute('ALTER TABLE ci_build_needs ALTER COLUMN id_convert_to_bigint TYPE bigint') - connection.execute('DROP INDEX IF EXISTS index_ci_build_needs_on_id_convert_to_bigint') - connection.execute('CREATE OR REPLACE FUNCTION trigger_3207b8d0d6f3() RETURNS trigger LANGUAGE plpgsql AS $$ - BEGIN NEW."id_convert_to_bigint" := NEW."id"; RETURN NEW; END; $$;') - end - - it 'swaps the columns' do - # rubocop: disable RSpec/AnyInstanceOf - allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false) - # rubocop: enable RSpec/AnyInstanceOf - - ci_build_needs = table(:ci_build_needs) - - disable_migrations_output do - reversible_migration do |migration| - migration.before -> { - ci_build_needs.reset_column_information - - expect(ci_build_needs.columns.find { |c| c.name == 'id' }.sql_type).to eq('integer') - expect(ci_build_needs.columns.find do |c| - c.name == 'id_convert_to_bigint' - end.sql_type).to eq('bigint') - } - - migration.after -> { - ci_build_needs.reset_column_information - - expect(ci_build_needs.columns.find { |c| c.name == 'id' }.sql_type).to eq('bigint') - expect(ci_build_needs.columns.find do |c| - c.name == 'id_convert_to_bigint' - end.sql_type).to eq('integer') - } - end - end - end - end - end -end diff --git a/spec/migrations/20230616082958_add_unique_index_for_npm_packages_on_project_id_name_version_spec.rb b/spec/migrations/20230616082958_add_unique_index_for_npm_packages_on_project_id_name_version_spec.rb deleted file mode 100644 index c7c97b16f9703250542d0e3fa4882baa511278d6..0000000000000000000000000000000000000000 --- a/spec/migrations/20230616082958_add_unique_index_for_npm_packages_on_project_id_name_version_spec.rb +++ /dev/null @@ -1,20 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe AddUniqueIndexForNpmPackagesOnProjectIdNameVersion, feature_category: :package_registry do - it 'schedules an index creation' do - reversible_migration do |migration| - migration.before -> { - expect(ActiveRecord::Base.connection.indexes('packages_packages').map(&:name)) - .not_to include('idx_packages_on_project_id_name_version_unique_when_npm') - } - - migration.after -> { - expect(ActiveRecord::Base.connection.indexes('packages_packages').map(&:name)) - .to include('idx_packages_on_project_id_name_version_unique_when_npm') - } - end - end -end diff --git a/spec/migrations/20230621070810_update_requeue_workers_in_application_settings_for_gitlab_com_spec.rb b/spec/migrations/20230621070810_update_requeue_workers_in_application_settings_for_gitlab_com_spec.rb deleted file mode 100644 index 763d9ea610c8dbfbdce3a856b2d430d69450c8f8..0000000000000000000000000000000000000000 --- a/spec/migrations/20230621070810_update_requeue_workers_in_application_settings_for_gitlab_com_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe UpdateRequeueWorkersInApplicationSettingsForGitlabCom, feature_category: :global_search do - let(:settings) { table(:application_settings) } - - describe "#up" do - it 'does nothing' do - record = settings.create! - - expect { migrate! }.not_to change { record.reload.elasticsearch_requeue_workers } - end - - it 'updates elasticsearch_requeue_workers when gitlab.com' do - allow(Gitlab).to receive(:com?).and_return(true) - - record = settings.create! - - expect { migrate! }.to change { record.reload.elasticsearch_requeue_workers }.from(false).to(true) - end - end - - describe "#down" do - it 'does nothing' do - record = settings.create!(elasticsearch_requeue_workers: true) - - migrate! - - expect { schema_migrate_down! }.not_to change { record.reload.elasticsearch_requeue_workers } - end - - it 'updates elasticsearch_requeue_workers when gitlab.com' do - allow(Gitlab).to receive(:com?).and_return(true) - - record = settings.create!(elasticsearch_requeue_workers: true) - - migrate! - - expect { schema_migrate_down! }.to change { record.reload.elasticsearch_requeue_workers }.from(true).to(false) - end - end -end diff --git a/spec/migrations/20230621074611_update_elasticsearch_number_of_shards_in_application_settings_for_gitlab_com_spec.rb b/spec/migrations/20230621074611_update_elasticsearch_number_of_shards_in_application_settings_for_gitlab_com_spec.rb deleted file mode 100644 index 80a1f9f59e29250cd37197434df3bb50aec13e2b..0000000000000000000000000000000000000000 --- a/spec/migrations/20230621074611_update_elasticsearch_number_of_shards_in_application_settings_for_gitlab_com_spec.rb +++ /dev/null @@ -1,44 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe UpdateElasticsearchNumberOfShardsInApplicationSettingsForGitlabCom, feature_category: :global_search do - let(:settings) { table(:application_settings) } - - describe "#up" do - it 'does nothing when not in gitlab.com' do - record = settings.create! - - expect { migrate! }.not_to change { record.reload.elasticsearch_worker_number_of_shards } - end - - it 'updates elasticsearch_worker_number_of_shards when gitlab.com' do - allow(Gitlab).to receive(:com?).and_return(true) - - record = settings.create! - - expect { migrate! }.to change { record.reload.elasticsearch_worker_number_of_shards }.from(2).to(16) - end - end - - describe "#down" do - it 'does nothing when not in gitlab.com' do - record = settings.create!(elasticsearch_worker_number_of_shards: 16) - - migrate! - - expect { schema_migrate_down! }.not_to change { record.reload.elasticsearch_worker_number_of_shards } - end - - it 'updates elasticsearch_worker_number_of_shards when gitlab.com' do - allow(Gitlab).to receive(:com?).and_return(true) - - record = settings.create!(elasticsearch_worker_number_of_shards: 16) - - migrate! - - expect { schema_migrate_down! }.to change { record.reload.elasticsearch_worker_number_of_shards }.from(16).to(2) - end - end -end diff --git a/spec/migrations/20230628023103_queue_backfill_missing_ci_cd_settings_spec.rb b/spec/migrations/20230628023103_queue_backfill_missing_ci_cd_settings_spec.rb deleted file mode 100644 index f6c470260ffb313f95166f819af6bd756a862362..0000000000000000000000000000000000000000 --- a/spec/migrations/20230628023103_queue_backfill_missing_ci_cd_settings_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe QueueBackfillMissingCiCdSettings, feature_category: :source_code_management do - let!(:batched_migration) { described_class::MIGRATION } - - it 'schedules a new batched migration' do - reversible_migration do |migration| - migration.before -> { - expect(batched_migration).not_to have_scheduled_batched_migration - } - - migration.after -> { - expect(batched_migration).to have_scheduled_batched_migration( - table_name: :projects, - column_name: :id, - interval: described_class::DELAY_INTERVAL, - batch_size: described_class::BATCH_SIZE, - sub_batch_size: described_class::SUB_BATCH_SIZE - ) - } - end - end -end diff --git a/spec/migrations/20230629095819_queue_backfill_uuid_conversion_column_in_vulnerability_occurrences_spec.rb b/spec/migrations/20230629095819_queue_backfill_uuid_conversion_column_in_vulnerability_occurrences_spec.rb deleted file mode 100644 index eb9a131008ad97c81695fa2789bc0b0d5b6a15e5..0000000000000000000000000000000000000000 --- a/spec/migrations/20230629095819_queue_backfill_uuid_conversion_column_in_vulnerability_occurrences_spec.rb +++ /dev/null @@ -1,26 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe QueueBackfillUuidConversionColumnInVulnerabilityOccurrences, feature_category: :vulnerability_management do - let!(:batched_migration) { described_class::MIGRATION } - - it 'schedules a new batched migration' do - reversible_migration do |migration| - migration.before -> { - expect(batched_migration).not_to have_scheduled_batched_migration - } - - migration.after -> { - expect(batched_migration).to have_scheduled_batched_migration( - table_name: :vulnerability_occurrences, - column_name: :id, - interval: described_class::DELAY_INTERVAL, - batch_size: described_class::BATCH_SIZE, - sub_batch_size: described_class::SUB_BATCH_SIZE - ) - } - end - end -end diff --git a/spec/migrations/20230703024031_cleanup_project_pipeline_status_key_spec.rb b/spec/migrations/20230703024031_cleanup_project_pipeline_status_key_spec.rb deleted file mode 100644 index 4232162134a800aba61cf254635719691ca7ec5c..0000000000000000000000000000000000000000 --- a/spec/migrations/20230703024031_cleanup_project_pipeline_status_key_spec.rb +++ /dev/null @@ -1,12 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe CleanupProjectPipelineStatusKey, feature_category: :redis do - it 'enqueues a RedisMigrationWorker job from cursor 0' do - expect(RedisMigrationWorker).to receive(:perform_async).with('BackfillProjectPipelineStatusTtl', '0') - - migrate! - end -end diff --git a/spec/migrations/cleanup_bigint_conversion_for_merge_request_metrics_for_self_hosts_spec.rb b/spec/migrations/cleanup_bigint_conversion_for_merge_request_metrics_for_self_hosts_spec.rb deleted file mode 100644 index dc4adae913829863194416e363241f3443982622..0000000000000000000000000000000000000000 --- a/spec/migrations/cleanup_bigint_conversion_for_merge_request_metrics_for_self_hosts_spec.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe CleanupBigintConversionForMergeRequestMetricsForSelfHosts, feature_category: :database do - after do - connection = described_class.new.connection - connection.execute('ALTER TABLE merge_request_metrics DROP COLUMN IF EXISTS id_convert_to_bigint') - end - - describe '#up' do - context 'when is GitLab.com, dev, or test' do - before do - # As we call `schema_migrate_down!` before each example, and for this migration - # `#down` is same as `#up`, we need to ensure we start from the expected state. - connection = described_class.new.connection - connection.execute('ALTER TABLE merge_request_metrics DROP COLUMN IF EXISTS id_convert_to_bigint') - end - - it 'does nothing' do - # rubocop: disable RSpec/AnyInstanceOf - allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(true) - # rubocop: enable RSpec/AnyInstanceOf - - merge_request_metrics = table(:merge_request_metrics) - - disable_migrations_output do - reversible_migration do |migration| - migration.before -> { - merge_request_metrics.reset_column_information - - expect(merge_request_metrics.columns.find { |c| c.name == 'id_convert_to_bigint' }).to be nil - } - - migration.after -> { - merge_request_metrics.reset_column_information - - expect(merge_request_metrics.columns.find { |c| c.name == 'id_convert_to_bigint' }).to be nil - } - end - end - end - end - - context 'when is a self-host customer with the temporary column already dropped' do - before do - # As we call `schema_migrate_down!` before each example, and for this migration - # `#down` is same as `#up`, we need to ensure we start from the expected state. - connection = described_class.new.connection - connection.execute('ALTER TABLE merge_request_metrics ALTER COLUMN id TYPE bigint') - connection.execute('ALTER TABLE merge_request_metrics DROP COLUMN IF EXISTS id_convert_to_bigint') - end - - it 'does nothing' do - # rubocop: disable RSpec/AnyInstanceOf - allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false) - # rubocop: enable RSpec/AnyInstanceOf - - merge_request_metrics = table(:merge_request_metrics) - - migrate! - - expect(merge_request_metrics.columns.find { |c| c.name == 'id' }.sql_type).to eq('bigint') - expect(merge_request_metrics.columns.find { |c| c.name == 'id_convert_to_bigint' }).to be nil - end - end - - context 'when is a self-host with the temporary columns' do - before do - # As we call `schema_migrate_down!` before each example, and for this migration - # `#down` is same as `#up`, we need to ensure we start from the expected state. - connection = described_class.new.connection - connection.execute('ALTER TABLE merge_request_metrics ALTER COLUMN id TYPE bigint') - connection.execute('ALTER TABLE merge_request_metrics ADD COLUMN IF NOT EXISTS id_convert_to_bigint integer') - end - - it 'drop the temporary columns' do - # rubocop: disable RSpec/AnyInstanceOf - allow_any_instance_of(described_class).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false) - # rubocop: enable RSpec/AnyInstanceOf - - merge_request_metrics = table(:merge_request_metrics) - - disable_migrations_output do - reversible_migration do |migration| - migration.before -> { - merge_request_metrics.reset_column_information - - expect(merge_request_metrics.columns.find { |c| c.name == 'id' }.sql_type).to eq('bigint') - expect(merge_request_metrics.columns.find do |c| - c.name == 'id_convert_to_bigint' - end.sql_type).to eq('integer') - } - - migration.after -> { - merge_request_metrics.reset_column_information - - expect(merge_request_metrics.columns.find { |c| c.name == 'id' }.sql_type).to eq('bigint') - expect(merge_request_metrics.columns.find { |c| c.name == 'id_convert_to_bigint' }).to be nil - } - end - end - end - end - end -end diff --git a/spec/migrations/deduplicate_inactive_alert_integrations_spec.rb b/spec/migrations/deduplicate_inactive_alert_integrations_spec.rb deleted file mode 100644 index 7f963a9bd0a0d8c437d818416878921f3d0b501b..0000000000000000000000000000000000000000 --- a/spec/migrations/deduplicate_inactive_alert_integrations_spec.rb +++ /dev/null @@ -1,71 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe DeduplicateInactiveAlertIntegrations, feature_category: :incident_management do - let!(:namespace_class) { table(:namespaces) } - let!(:project_class) { table(:projects) } - let!(:integration_class) { table(:alert_management_http_integrations) } - - let!(:namespace_0) { namespace_class.create!(name: 'namespace1', path: 'namespace1') } - let!(:namespace_1) { namespace_class.create!(name: 'namespace2', path: 'namespace2') } - let!(:namespace_2) { namespace_class.create!(name: 'namespace3', path: 'namespace3') } - - let!(:project_with_inactive_duplicate) { create_project(namespace_0, namespace_0) } - let!(:project_with_multiple_duplicates) { create_project(namespace_0, namespace_1) } - let!(:project_without_duplicates) { create_project(namespace_0, namespace_2) } - - let!(:integrations) do - [ - create_integration(project_with_inactive_duplicate, 'default'), - create_integration(project_with_inactive_duplicate, 'other'), - create_integration(project_with_inactive_duplicate, 'other', active: false), - create_integration(project_with_multiple_duplicates, 'default', active: false), - create_integration(project_with_multiple_duplicates, 'default', active: false), - create_integration(project_with_multiple_duplicates, 'other', active: false), - create_integration(project_with_multiple_duplicates, 'other'), - create_integration(project_without_duplicates, 'default'), - create_integration(project_without_duplicates, 'other', active: false) - ] - end - - describe '#up' do - it 'updates the endpoint identifier of duplicate inactive integrations' do - expect { migrate! } - .to not_change { integrations[0].reload } - .and not_change { integrations[1].reload } - .and not_change { integrations[6].reload } - .and not_change { integrations[7].reload } - .and not_change { integrations[8].reload } - - expect { integrations[2].reload }.to raise_error(ActiveRecord::RecordNotFound) - expect { integrations[3].reload }.to raise_error(ActiveRecord::RecordNotFound) - expect { integrations[4].reload }.to raise_error(ActiveRecord::RecordNotFound) - expect { integrations[5].reload }.to raise_error(ActiveRecord::RecordNotFound) - - endpoints = integration_class.pluck(:endpoint_identifier, :project_id) - expect(endpoints.uniq).to match_array(endpoints) - end - end - - private - - def create_integration(project, endpoint_identifier, active: true) - integration_class.create!( - project_id: project.id, - endpoint_identifier: endpoint_identifier, - active: active, - encrypted_token_iv: 'iv', - encrypted_token: 'token', - name: "HTTP Integration - #{endpoint_identifier}" - ) - end - - def create_project(namespace, project_namespace) - project_class.create!( - namespace_id: namespace.id, - project_namespace_id: project_namespace.id - ) - end -end diff --git a/spec/migrations/ensure_events_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb b/spec/migrations/ensure_events_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb deleted file mode 100644 index 6694b690d30ba7df08e64b6968623aa6b03fdd24..0000000000000000000000000000000000000000 --- a/spec/migrations/ensure_events_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb +++ /dev/null @@ -1,35 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' -require_migration! - -RSpec.describe EnsureEventsBigintBackfillIsFinishedForGitlabDotCom, feature_category: :database do - describe '#up' do - let(:migration_arguments) do - { - job_class_name: 'CopyColumnUsingBackgroundMigrationJob', - table_name: 'events', - column_name: 'id', - job_arguments: [['target_id'], ['target_id_convert_to_bigint']] - } - end - - it 'ensures the migration is completed for GitLab.com, dev, or test' do - expect_next_instance_of(described_class) do |instance| - expect(instance).to receive(:com_or_dev_or_test_but_not_jh?).and_return(true) - expect(instance).to receive(:ensure_batched_background_migration_is_finished).with(migration_arguments) - end - - migrate! - end - - it 'skips the check for other instances' do - expect_next_instance_of(described_class) do |instance| - expect(instance).to receive(:com_or_dev_or_test_but_not_jh?).and_return(false) - expect(instance).not_to receive(:ensure_batched_background_migration_is_finished) - end - - migrate! - end - end -end diff --git a/spec/support/helpers/user_with_namespace_shim.yml b/spec/support/helpers/user_with_namespace_shim.yml index 9560e74cb8426d98df2737eaabc4593576494a8b..f861e628ea82bbf19840a4d41758597aaa057fbe 100644 --- a/spec/support/helpers/user_with_namespace_shim.yml +++ b/spec/support/helpers/user_with_namespace_shim.yml @@ -764,7 +764,6 @@ - spec/migrations/add_namespaces_emails_enabled_column_data_spec.rb - spec/migrations/add_okr_hierarchy_restrictions_spec.rb - spec/migrations/add_projects_emails_enabled_column_data_spec.rb -- spec/migrations/cleanup_bigint_conversion_for_merge_request_metrics_for_self_hosts_spec.rb - spec/migrations/cleanup_vulnerability_state_transitions_with_same_from_state_to_state_spec.rb - spec/migrations/delete_migrate_shared_vulnerability_scanners_spec.rb - spec/migrations/ensure_commit_user_mentions_note_id_bigint_backfill_is_finished_for_gitlab_dot_com_spec.rb