diff options
Diffstat (limited to 'db')
297 files changed, 3680 insertions, 385 deletions
diff --git a/db/click_house/main/20230705124511_create_events.sql b/db/click_house/main/20230705124511_create_events.sql index 45e0139165a..8af45443e4c 100644 --- a/db/click_house/main/20230705124511_create_events.sql +++ b/db/click_house/main/20230705124511_create_events.sql @@ -6,10 +6,11 @@ CREATE TABLE events target_id UInt64 DEFAULT 0, target_type LowCardinality(String) DEFAULT '', action UInt8 DEFAULT 0, + deleted UInt8 DEFAULT 0, created_at DateTime64(6, 'UTC') DEFAULT now(), updated_at DateTime64(6, 'UTC') DEFAULT now() ) -ENGINE = ReplacingMergeTree(updated_at) +ENGINE = ReplacingMergeTree(updated_at, deleted) PRIMARY KEY (id) ORDER BY (id) PARTITION BY toYear(created_at) diff --git a/db/click_house/main/20230707151359_create_ci_finished_builds.sql b/db/click_house/main/20230707151359_create_ci_finished_builds.sql index 6b1b846518d..5c2cc0e8eb3 100644 --- a/db/click_house/main/20230707151359_create_ci_finished_builds.sql +++ b/db/click_house/main/20230707151359_create_ci_finished_builds.sql @@ -24,8 +24,8 @@ CREATE TABLE ci_finished_builds runner_manager_architecture LowCardinality(String) DEFAULT '', --- Materialized columns - duration Int64 MATERIALIZED age('second', started_at, finished_at), - queueing_duration Int64 MATERIALIZED age('second', queued_at, started_at) + duration Int64 MATERIALIZED age('ms', started_at, finished_at), + queueing_duration Int64 MATERIALIZED age('ms', queued_at, started_at) --- This table is incomplete, we'll add more fields before starting the data migration ) ENGINE = ReplacingMergeTree -- Using ReplacingMergeTree just in case we accidentally insert the same data twice diff --git a/db/docs/abuse_report_user_mentions.yml b/db/docs/abuse_report_user_mentions.yml new file mode 100644 index 00000000000..00bf5c928c4 --- /dev/null +++ b/db/docs/abuse_report_user_mentions.yml @@ -0,0 +1,10 @@ +--- +table_name: abuse_report_user_mentions +classes: +- Abuse::Reports::UserMention +feature_categories: +- insider_threat +description: User mentions in abuse report notes +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132505 +milestone: '16.5' +gitlab_schema: gitlab_main diff --git a/db/docs/analytics_cycle_analytics_value_stream_settings.yml b/db/docs/analytics_cycle_analytics_value_stream_settings.yml new file mode 100644 index 00000000000..b3947f9bf63 --- /dev/null +++ b/db/docs/analytics_cycle_analytics_value_stream_settings.yml @@ -0,0 +1,10 @@ +--- +table_name: analytics_cycle_analytics_value_stream_settings +classes: +- Analytics::CycleAnalytics::ValueStreamSetting +feature_categories: +- value_stream_management +description: Stores settings for each value stream. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132650 +milestone: '16.5' +gitlab_schema: gitlab_main diff --git a/db/docs/batched_background_migrations/backfill_finding_id_in_vulnerabilities.yml b/db/docs/batched_background_migrations/backfill_finding_id_in_vulnerabilities.yml new file mode 100644 index 00000000000..5d3f4e92355 --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_finding_id_in_vulnerabilities.yml @@ -0,0 +1,6 @@ +--- +migration_job_name: BackfillFindingIdInVulnerabilities +description: Backfills finding_id column on vulnerabilities table for a proper 1:1 relation +feature_category: vulnerability_management +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/issues/418971 +milestone: 16.4 diff --git a/db/docs/batched_background_migrations/backfill_has_remediations_of_vulnerability_reads.yml b/db/docs/batched_background_migrations/backfill_has_remediations_of_vulnerability_reads.yml new file mode 100644 index 00000000000..05a5f909270 --- /dev/null +++ b/db/docs/batched_background_migrations/backfill_has_remediations_of_vulnerability_reads.yml @@ -0,0 +1,7 @@ +--- +migration_job_name: BackfillHasRemediationsOfVulnerabilityReads +description: Backfills has_remediations column for vulnerability_reads table. +feature_category: database +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133714 +milestone: 16.5 +queued_migration_version: 20231011142714 diff --git a/db/docs/batched_background_migrations/delete_orphans_approval_merge_request_rules2.yml b/db/docs/batched_background_migrations/delete_orphans_approval_merge_request_rules2.yml new file mode 100644 index 00000000000..0c90fac771d --- /dev/null +++ b/db/docs/batched_background_migrations/delete_orphans_approval_merge_request_rules2.yml @@ -0,0 +1,8 @@ +--- +migration_job_name: DeleteOrphansApprovalMergeRequestRules2 +Odescription: | + Deletes orphaned scan finding and license scanning approval rules + that could have been created with project import. +feature_category: security_policy_management +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/issues/415925 +milestone: 16.5 diff --git a/db/docs/batched_background_migrations/delete_orphans_approval_project_rules2.yml b/db/docs/batched_background_migrations/delete_orphans_approval_project_rules2.yml new file mode 100644 index 00000000000..33abb158cf1 --- /dev/null +++ b/db/docs/batched_background_migrations/delete_orphans_approval_project_rules2.yml @@ -0,0 +1,8 @@ +--- +migration_job_name: DeleteOrphansApprovalProjectRules2 +Odescription: | + Deletes orphaned scan finding and license scanning approval rules + that could have been created with project import. +feature_category: security_policy_management +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/issues/415925 +milestone: 16.5 diff --git a/db/docs/batched_background_migrations/update_workspaces_config_version.yml b/db/docs/batched_background_migrations/update_workspaces_config_version.yml new file mode 100644 index 00000000000..50cdfe1f2e9 --- /dev/null +++ b/db/docs/batched_background_migrations/update_workspaces_config_version.yml @@ -0,0 +1,5 @@ +migration_job_name: UpdateWorkspacesConfigVersion +description: Update config_version to 2 and force_include_all_resources to true for existing workspaces +feature_category: remote_development +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131402 +milestone: 16.5 diff --git a/db/docs/container_registry_protection_rules.yml b/db/docs/container_registry_protection_rules.yml new file mode 100644 index 00000000000..1764cbc8cda --- /dev/null +++ b/db/docs/container_registry_protection_rules.yml @@ -0,0 +1,10 @@ +--- +table_name: container_registry_protection_rules +classes: +- ContainerRegistry::Protection::Rule +feature_categories: +- container_registry +description: Represents container protection rules for the container registry. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133297 +milestone: '16.5' +gitlab_schema: gitlab_main diff --git a/db/docs/deleted_tables/experiment_subjects.yml b/db/docs/deleted_tables/experiment_subjects.yml index ff3e0dab8b4..cf595bf92f4 100644 --- a/db/docs/deleted_tables/experiment_subjects.yml +++ b/db/docs/deleted_tables/experiment_subjects.yml @@ -3,7 +3,7 @@ table_name: experiment_subjects classes: - ExperimentSubject feature_categories: - - experimentation_conversion + - acquisition description: introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/47042 milestone: '13.7' diff --git a/db/docs/deleted_tables/experiment_users.yml b/db/docs/deleted_tables/experiment_users.yml index f7c1278cd69..73726e12136 100644 --- a/db/docs/deleted_tables/experiment_users.yml +++ b/db/docs/deleted_tables/experiment_users.yml @@ -3,7 +3,7 @@ table_name: experiment_users classes: - ExperimentUser feature_categories: - - experimentation_conversion + - acquisition description: introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38397 milestone: '13.3' diff --git a/db/docs/deleted_tables/experiments.yml b/db/docs/deleted_tables/experiments.yml index 5e56dc076c1..c1bf04779c8 100644 --- a/db/docs/deleted_tables/experiments.yml +++ b/db/docs/deleted_tables/experiments.yml @@ -3,7 +3,7 @@ table_name: experiments classes: - Experiment feature_categories: - - experimentation_conversion + - acquisition description: introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/38397 milestone: '13.3' diff --git a/db/docs/member_tasks.yml b/db/docs/deleted_tables/member_tasks.yml index 0413011c005..07e3f556a8b 100644 --- a/db/docs/member_tasks.yml +++ b/db/docs/deleted_tables/member_tasks.yml @@ -1,10 +1,10 @@ --- table_name: member_tasks -classes: -- MemberTask feature_categories: -- experimentation_activation +- activation description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/69299 milestone: '14.5' gitlab_schema: gitlab_main +removed_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/134452 +removed_in_milestone: '16.6' diff --git a/db/docs/in_product_marketing_emails.yml b/db/docs/in_product_marketing_emails.yml index be33ee824b6..8021f4a2634 100644 --- a/db/docs/in_product_marketing_emails.yml +++ b/db/docs/in_product_marketing_emails.yml @@ -3,7 +3,7 @@ table_name: in_product_marketing_emails classes: - Users::InProductMarketingEmail feature_categories: -- experimentation_activation +- activation description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/55840 milestone: '13.10' diff --git a/db/docs/p_ci_finished_build_ch_sync_events.yml b/db/docs/p_ci_finished_build_ch_sync_events.yml new file mode 100644 index 00000000000..09938f99b16 --- /dev/null +++ b/db/docs/p_ci_finished_build_ch_sync_events.yml @@ -0,0 +1,10 @@ +--- +table_name: p_ci_finished_build_ch_sync_events +classes: +- Ci::FinishedBuildChSyncEvent +feature_categories: +- runner_fleet +description: Holds references to finished CI builds ready to be synced to ClickHouse +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/ +milestone: '16.5' +gitlab_schema: gitlab_ci diff --git a/db/docs/routes.yml b/db/docs/routes.yml index f070f917e31..51a390673aa 100644 --- a/db/docs/routes.yml +++ b/db/docs/routes.yml @@ -1,7 +1,6 @@ --- table_name: routes classes: -- Gitlab::Database::RenameReservedPathsMigration::V1::MigrationClasses::Route - Route feature_categories: - groups_and_projects diff --git a/db/docs/scan_result_policy_violations.yml b/db/docs/scan_result_policy_violations.yml new file mode 100644 index 00000000000..bb56c02fb33 --- /dev/null +++ b/db/docs/scan_result_policy_violations.yml @@ -0,0 +1,10 @@ +--- +table_name: scan_result_policy_violations +classes: +- Security::ScanResultPolicyViolation +feature_categories: +- security_policy_management +description: Stores scan result policy violations. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/132254 +milestone: '16.5' +gitlab_schema: gitlab_main diff --git a/db/docs/users.yml b/db/docs/users.yml index 1fd16ae9af7..119c89d48cc 100644 --- a/db/docs/users.yml +++ b/db/docs/users.yml @@ -1,7 +1,6 @@ --- table_name: users classes: -- Gitlab::Database::RenameReservedPathsMigration::V1::MigrationClasses::User - TmpUser - User feature_categories: diff --git a/db/docs/vs_code_settings.yml b/db/docs/vs_code_settings.yml new file mode 100644 index 00000000000..e1070238a87 --- /dev/null +++ b/db/docs/vs_code_settings.yml @@ -0,0 +1,10 @@ +--- +table_name: vs_code_settings +classes: +- VsCode::Settings::VsCodeSetting +feature_categories: +- web_ide +description: VSCode Settings +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/131900 +milestone: '16.5' +gitlab_schema: gitlab_main diff --git a/db/docs/work_item_related_link_restrictions.yml b/db/docs/work_item_related_link_restrictions.yml new file mode 100644 index 00000000000..1f76b0482be --- /dev/null +++ b/db/docs/work_item_related_link_restrictions.yml @@ -0,0 +1,10 @@ +--- +table_name: work_item_related_link_restrictions +classes: + - WorkItems::RelatedLinkRestriction +feature_categories: + - portfolio_management +description: Restrictions applied to related links. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/133044 +milestone: '16.5' +gitlab_schema: gitlab_main diff --git a/db/fixtures/development/17_cycle_analytics.rb b/db/fixtures/development/17_cycle_analytics.rb index 5442c6eb00b..211a61a74c2 100644 --- a/db/fixtures/development/17_cycle_analytics.rb +++ b/db/fixtures/development/17_cycle_analytics.rb @@ -236,6 +236,9 @@ class Gitlab::Seeder::CycleAnalytics # rubocop:disable Style/ClassAndModuleChild @developers << user end + project.group&.add_developer(admin) + project.add_developer(admin) + AuthorizedProjectUpdate::ProjectRecalculateService.new(project).execute end diff --git a/db/fixtures/development/51_create_work_item_related_link_restrictions.rb b/db/fixtures/development/51_create_work_item_related_link_restrictions.rb new file mode 100644 index 00000000000..04440451d37 --- /dev/null +++ b/db/fixtures/development/51_create_work_item_related_link_restrictions.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +Gitlab::Seeder.quiet do + Gitlab::DatabaseImporters::WorkItems::RelatedLinksRestrictionsImporter.upsert_restrictions +end diff --git a/db/fixtures/production/040_create_work_item_related_link_restrictions.rb b/db/fixtures/production/040_create_work_item_related_link_restrictions.rb new file mode 100644 index 00000000000..04440451d37 --- /dev/null +++ b/db/fixtures/production/040_create_work_item_related_link_restrictions.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +Gitlab::Seeder.quiet do + Gitlab::DatabaseImporters::WorkItems::RelatedLinksRestrictionsImporter.upsert_restrictions +end diff --git a/db/gitlab_schemas/gitlab_main_clusterwide.yaml b/db/gitlab_schemas/gitlab_main_clusterwide.yaml index 7d1de57b687..8f07f0caf4f 100644 --- a/db/gitlab_schemas/gitlab_main_clusterwide.yaml +++ b/db/gitlab_schemas/gitlab_main_clusterwide.yaml @@ -11,6 +11,10 @@ allow_cross_transactions: # temporarily allow cross-transaction between clusterwide till all tables # are moved to either _clusterwide or _cell - gitlab_main + # Temporarily allow cross-transaction with cell + # until offenses for each table is resolved. + - gitlab_main_cell: + specific_tables: [] allow_cross_foreign_keys: # temporarily allow FKs between clusterwide till all tables # are moved to either _clusterwide or _cell diff --git a/db/migrate/20220602130306_add_namespace_type_index.rb b/db/migrate/20220602130306_add_namespace_type_index.rb index b20f36b3278..14e017c1dc8 100644 --- a/db/migrate/20220602130306_add_namespace_type_index.rb +++ b/db/migrate/20220602130306_add_namespace_type_index.rb @@ -5,9 +5,11 @@ class AddNamespaceTypeIndex < Gitlab::Database::Migration[2.0] INDEX_NAME = 'index_groups_on_parent_id_id' + # rubocop:disable Migration/PreventIndexCreation def up add_concurrent_index :namespaces, [:parent_id, :id], where: "type = 'Group'", name: INDEX_NAME end + # rubocop:enable Migration/PreventIndexCreation def down remove_concurrent_index_by_name(:namespaces, INDEX_NAME) diff --git a/db/migrate/20221206211814_add_authorized_scopes_to_slack_integration.rb b/db/migrate/20221206211814_add_authorized_scopes_to_slack_integration.rb index 40abf087dfe..94d553fdab5 100644 --- a/db/migrate/20221206211814_add_authorized_scopes_to_slack_integration.rb +++ b/db/migrate/20221206211814_add_authorized_scopes_to_slack_integration.rb @@ -9,7 +9,7 @@ class AddAuthorizedScopesToSlackIntegration < Gitlab::Database::Migration[2.1] end create_table :slack_integrations_scopes do |t| - references :slack_api_scope, + t.references :slack_api_scope, null: false, index: false, # See composite index foreign_key: { @@ -17,7 +17,7 @@ class AddAuthorizedScopesToSlackIntegration < Gitlab::Database::Migration[2.1] on_delete: :cascade } - references :slack_integration, + t.references :slack_integration, null: false, index: false, # see composite index foreign_key: { diff --git a/db/migrate/20230814045150_add_jobs_index_rate_limit_to_application_settings.rb b/db/migrate/20230814045150_add_jobs_index_rate_limit_to_application_settings.rb new file mode 100644 index 00000000000..08e0a7252ce --- /dev/null +++ b/db/migrate/20230814045150_add_jobs_index_rate_limit_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddJobsIndexRateLimitToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :project_jobs_api_rate_limit, :integer, default: 600, null: false + end +end diff --git a/db/migrate/20230901200448_add_okr_reminder_last_sent_to_work_item_progresses.rb b/db/migrate/20230901200448_add_okr_reminder_last_sent_to_work_item_progresses.rb new file mode 100644 index 00000000000..7bc8401afac --- /dev/null +++ b/db/migrate/20230901200448_add_okr_reminder_last_sent_to_work_item_progresses.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddOkrReminderLastSentToWorkItemProgresses < Gitlab::Database::Migration[2.1] + def change + add_column :work_item_progresses, :last_reminder_sent_at, :datetime_with_timezone + end +end diff --git a/db/migrate/20230905174639_add_priority_to_user_achievements.rb b/db/migrate/20230905174639_add_priority_to_user_achievements.rb new file mode 100644 index 00000000000..4c3d1fb41fb --- /dev/null +++ b/db/migrate/20230905174639_add_priority_to_user_achievements.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddPriorityToUserAchievements < Gitlab::Database::Migration[2.1] + def change + add_column :user_achievements, :priority, :int, null: true, default: nil + end +end diff --git a/db/migrate/20230906122405_add_cvss_to_vulnerabilities.rb b/db/migrate/20230906122405_add_cvss_to_vulnerabilities.rb new file mode 100644 index 00000000000..6914bceef87 --- /dev/null +++ b/db/migrate/20230906122405_add_cvss_to_vulnerabilities.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddCvssToVulnerabilities < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + add_column :vulnerabilities, :cvss, :jsonb, default: [], if_not_exists: true + end + end + + def down + with_lock_retries do + remove_column :vulnerabilities, :cvss, if_exists: true + end + end +end diff --git a/db/migrate/20230906215669_add_index_to_violations_on_target_proj_id_sync.rb b/db/migrate/20230906215669_add_index_to_violations_on_target_proj_id_sync.rb new file mode 100644 index 00000000000..97f19932436 --- /dev/null +++ b/db/migrate/20230906215669_add_index_to_violations_on_target_proj_id_sync.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexToViolationsOnTargetProjIdSync < Gitlab::Database::Migration[2.1] + TABLE_NAME = 'merge_requests_compliance_violations' + INDEX_NAME = 'i_compliance_violations_for_export' + + disable_ddl_transaction! + + def up + add_concurrent_index TABLE_NAME, [:target_project_id, :id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end +end diff --git a/db/migrate/20230910143103_add_admin_members_to_member_role.rb b/db/migrate/20230910143103_add_admin_members_to_member_role.rb new file mode 100644 index 00000000000..a4d191ad7db --- /dev/null +++ b/db/migrate/20230910143103_add_admin_members_to_member_role.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddAdminMembersToMemberRole < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + add_column :member_roles, :admin_group_member, :boolean, default: false, null: false + end + + def down + remove_column :member_roles, :admin_group_member + end +end diff --git a/db/migrate/20230912141430_create_vscode_setting.rb b/db/migrate/20230912141430_create_vscode_setting.rb new file mode 100644 index 00000000000..ee9d999a07b --- /dev/null +++ b/db/migrate/20230912141430_create_vscode_setting.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class CreateVSCodeSetting < Gitlab::Database::Migration[2.1] + def change + create_table :vs_code_settings do |t| + t.references :user, index: true, foreign_key: { on_delete: :cascade }, null: false + t.timestamps_with_timezone null: false + t.text :setting_type, null: false, limit: 256 + t.text :content, null: false, limit: 512.kilobytes + end + end +end diff --git a/db/migrate/20230915100513_add_vulnerabilities_to_sbom_occurrences.rb b/db/migrate/20230915100513_add_vulnerabilities_to_sbom_occurrences.rb new file mode 100644 index 00000000000..ae3ec958ce5 --- /dev/null +++ b/db/migrate/20230915100513_add_vulnerabilities_to_sbom_occurrences.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddVulnerabilitiesToSbomOccurrences < Gitlab::Database::Migration[2.1] + def change + add_column :sbom_occurrences, :vulnerabilities, :jsonb, default: [] + end +end diff --git a/db/migrate/20230915103259_create_ci_finished_build_ch_sync_events.rb b/db/migrate/20230915103259_create_ci_finished_build_ch_sync_events.rb new file mode 100644 index 00000000000..718fd49f5c0 --- /dev/null +++ b/db/migrate/20230915103259_create_ci_finished_build_ch_sync_events.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class CreateCiFinishedBuildChSyncEvents < Gitlab::Database::Migration[2.1] + def change + options = { + primary_key: [:build_id, :partition], + options: 'PARTITION BY LIST (partition)' + } + + create_table(:p_ci_finished_build_ch_sync_events, **options) do |t| + # Do not bother with foreign key as it provides not benefit and has a performance cost. These get cleaned up over + # time anyway. + t.bigint :build_id, null: false + t.bigint :partition, null: false, default: 1 + # rubocop: disable Migration/Datetime + # The source for this field does not have a timezone + t.datetime :build_finished_at, null: false + # rubocop: enable Migration/Datetime + t.boolean :processed, null: false, default: false + + t.index '(build_id % 100), build_id', + where: 'processed = FALSE', + name: 'index_ci_finished_build_ch_sync_events_for_partitioned_query' + end + end +end diff --git a/db/migrate/20230915111914_create_scan_result_policy_violations.rb b/db/migrate/20230915111914_create_scan_result_policy_violations.rb new file mode 100644 index 00000000000..fc9fce4b2cd --- /dev/null +++ b/db/migrate/20230915111914_create_scan_result_policy_violations.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +class CreateScanResultPolicyViolations < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + create_table :scan_result_policy_violations do |t| + t.bigint :scan_result_policy_id, + index: false, + null: false + + t.bigint :merge_request_id, + index: { name: 'index_scan_result_policy_violations_on_merge_request_id' }, + null: false + + t.bigint :project_id, + index: { name: 'index_scan_result_policy_violations_on_project_id' }, + null: false + + t.timestamps_with_timezone null: false + end + + add_index(:scan_result_policy_violations, + %i[scan_result_policy_id merge_request_id], + unique: true, + name: 'index_scan_result_policy_violations_on_policy_and_merge_request') + end + + def down + drop_table :scan_result_policy_violations + end +end diff --git a/db/migrate/20230915111915_add_scan_result_policy_fk_to_scan_result_policy_violations.rb b/db/migrate/20230915111915_add_scan_result_policy_fk_to_scan_result_policy_violations.rb new file mode 100644 index 00000000000..4d7c925e528 --- /dev/null +++ b/db/migrate/20230915111915_add_scan_result_policy_fk_to_scan_result_policy_violations.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddScanResultPolicyFkToScanResultPolicyViolations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key( + :scan_result_policy_violations, + :scan_result_policies, + column: :scan_result_policy_id, + on_delete: :cascade) + end + + def down + with_lock_retries do + remove_foreign_key(:scan_result_policy_violations, column: :scan_result_policy_id) + end + end +end diff --git a/db/migrate/20230915111916_add_merge_request_fk_to_scan_result_policy_violations.rb b/db/migrate/20230915111916_add_merge_request_fk_to_scan_result_policy_violations.rb new file mode 100644 index 00000000000..d151db82d45 --- /dev/null +++ b/db/migrate/20230915111916_add_merge_request_fk_to_scan_result_policy_violations.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddMergeRequestFkToScanResultPolicyViolations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key( + :scan_result_policy_violations, + :merge_requests, + column: :merge_request_id, + on_delete: :cascade) + end + + def down + with_lock_retries do + remove_foreign_key(:scan_result_policy_violations, column: :merge_request_id) + end + end +end diff --git a/db/migrate/20230915111917_add_project_fk_to_scan_result_policy_violations.rb b/db/migrate/20230915111917_add_project_fk_to_scan_result_policy_violations.rb new file mode 100644 index 00000000000..005df7be92d --- /dev/null +++ b/db/migrate/20230915111917_add_project_fk_to_scan_result_policy_violations.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddProjectFkToScanResultPolicyViolations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key( + :scan_result_policy_violations, + :projects, + column: :project_id, + on_delete: :cascade) + end + + def down + with_lock_retries do + remove_foreign_key(:scan_result_policy_violations, column: :project_id) + end + end +end diff --git a/db/migrate/20230917144717_add_package_name_pattern_query_to_packages_protection_rule.rb b/db/migrate/20230917144717_add_package_name_pattern_query_to_packages_protection_rule.rb new file mode 100644 index 00000000000..337587a2617 --- /dev/null +++ b/db/migrate/20230917144717_add_package_name_pattern_query_to_packages_protection_rule.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class AddPackageNamePatternQueryToPackagesProtectionRule < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + with_lock_retries do + unless column_exists?( + :packages_protection_rules, :package_name_pattern_ilike_query) + # rubocop:disable Rails/NotNullColumn + add_column :packages_protection_rules, :package_name_pattern_ilike_query, :text, null: false + # rubocop:enable Rails/NotNullColumn + end + end + + add_text_limit :packages_protection_rules, :package_name_pattern_ilike_query, 255 + end + + def down + remove_column :packages_protection_rules, :package_name_pattern_ilike_query + end +end diff --git a/db/migrate/20230918091159_add_cross_hierarchy_enabled_to_hierarchy_restrictions.rb b/db/migrate/20230918091159_add_cross_hierarchy_enabled_to_hierarchy_restrictions.rb new file mode 100644 index 00000000000..60ad9de523a --- /dev/null +++ b/db/migrate/20230918091159_add_cross_hierarchy_enabled_to_hierarchy_restrictions.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddCrossHierarchyEnabledToHierarchyRestrictions < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :work_item_hierarchy_restrictions, :cross_hierarchy_enabled, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230918122420_add_max_login_attempts_to_application_settings.rb b/db/migrate/20230918122420_add_max_login_attempts_to_application_settings.rb new file mode 100644 index 00000000000..b880d340a20 --- /dev/null +++ b/db/migrate/20230918122420_add_max_login_attempts_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddMaxLoginAttemptsToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :max_login_attempts, :integer, null: true + end +end diff --git a/db/migrate/20230918122430_add_application_settings_max_login_attempts_constraint.rb b/db/migrate/20230918122430_add_application_settings_max_login_attempts_constraint.rb new file mode 100644 index 00000000000..46cf77f5c90 --- /dev/null +++ b/db/migrate/20230918122430_add_application_settings_max_login_attempts_constraint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddApplicationSettingsMaxLoginAttemptsConstraint < Gitlab::Database::Migration[2.1] + CONSTRAINT_NAME = 'app_settings_max_login_attempts_positive' + + disable_ddl_transaction! + + def up + add_check_constraint :application_settings, 'max_login_attempts > 0', CONSTRAINT_NAME + end + + def down + remove_check_constraint :application_settings, CONSTRAINT_NAME + end +end diff --git a/db/migrate/20230918122440_add_failed_login_attempts_unlock_period_in_minutes_to_application_settings.rb b/db/migrate/20230918122440_add_failed_login_attempts_unlock_period_in_minutes_to_application_settings.rb new file mode 100644 index 00000000000..80d5934cdba --- /dev/null +++ b/db/migrate/20230918122440_add_failed_login_attempts_unlock_period_in_minutes_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddFailedLoginAttemptsUnlockPeriodInMinutesToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :failed_login_attempts_unlock_period_in_minutes, :integer, null: true + end +end diff --git a/db/migrate/20230918122450_add_application_settings_failed_login_attempts_unlock_period_in_minutes_constraint.rb b/db/migrate/20230918122450_add_application_settings_failed_login_attempts_unlock_period_in_minutes_constraint.rb new file mode 100644 index 00000000000..3c0e68b4444 --- /dev/null +++ b/db/migrate/20230918122450_add_application_settings_failed_login_attempts_unlock_period_in_minutes_constraint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddApplicationSettingsFailedLoginAttemptsUnlockPeriodInMinutesConstraint < Gitlab::Database::Migration[2.1] + CONSTRAINT_NAME = 'app_settings_failed_login_attempts_unlock_period_positive' + + disable_ddl_transaction! + + def up + add_check_constraint :application_settings, 'failed_login_attempts_unlock_period_in_minutes > 0', CONSTRAINT_NAME + end + + def down + remove_check_constraint :application_settings, CONSTRAINT_NAME + end +end diff --git a/db/migrate/20230918123357_add_sprint_id_and_weight_to_vsa_issues.rb b/db/migrate/20230918123357_add_sprint_id_and_weight_to_vsa_issues.rb new file mode 100644 index 00000000000..0c3b7b3086a --- /dev/null +++ b/db/migrate/20230918123357_add_sprint_id_and_weight_to_vsa_issues.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddSprintIdAndWeightToVsaIssues < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + add_column :analytics_cycle_analytics_issue_stage_events, :weight, :integer + add_column :analytics_cycle_analytics_issue_stage_events, :sprint_id, :bigint + end + + def down + remove_column :analytics_cycle_analytics_issue_stage_events, :sprint_id + remove_column :analytics_cycle_analytics_issue_stage_events, :weight + end +end diff --git a/db/migrate/20230919123305_add_container_registry_db_enabled_to_application_settings.rb b/db/migrate/20230919123305_add_container_registry_db_enabled_to_application_settings.rb new file mode 100644 index 00000000000..861294054e8 --- /dev/null +++ b/db/migrate/20230919123305_add_container_registry_db_enabled_to_application_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddContainerRegistryDbEnabledToApplicationSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :application_settings, :container_registry_db_enabled, :boolean, null: false, default: false + end +end diff --git a/db/migrate/20230920153321_add_last_assigned_users_refreshed_at_to_subscription_add_on_purchases.rb b/db/migrate/20230920153321_add_last_assigned_users_refreshed_at_to_subscription_add_on_purchases.rb new file mode 100644 index 00000000000..7f347e55031 --- /dev/null +++ b/db/migrate/20230920153321_add_last_assigned_users_refreshed_at_to_subscription_add_on_purchases.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddLastAssignedUsersRefreshedAtToSubscriptionAddOnPurchases < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column(:subscription_add_on_purchases, :last_assigned_users_refreshed_at, :datetime_with_timezone) + end +end diff --git a/db/migrate/20230920162613_add_force_include_all_resources_to_workspaces.rb b/db/migrate/20230920162613_add_force_include_all_resources_to_workspaces.rb new file mode 100644 index 00000000000..502732bc308 --- /dev/null +++ b/db/migrate/20230920162613_add_force_include_all_resources_to_workspaces.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddForceIncludeAllResourcesToWorkspaces < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :workspaces, :force_include_all_resources, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20230921081527_add_queued_migration_version_to_batched_background_migrations.rb b/db/migrate/20230921081527_add_queued_migration_version_to_batched_background_migrations.rb new file mode 100644 index 00000000000..1ab96f8d873 --- /dev/null +++ b/db/migrate/20230921081527_add_queued_migration_version_to_batched_background_migrations.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class AddQueuedMigrationVersionToBatchedBackgroundMigrations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'unique_batched_background_migrations_queued_migration_version' + + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20230921082223_add_limit_to_queued_migration_version_in_batched_background_migrations.rb + def up + add_column(:batched_background_migrations, :queued_migration_version, :text, if_not_exists: true) + + add_concurrent_index( + :batched_background_migrations, + :queued_migration_version, + unique: true, + name: INDEX_NAME + ) + end + # rubocop:enable Migration/AddLimitToTextColumns + + def down + remove_column(:batched_background_migrations, :queued_migration_version, :text, if_exists: true) + end +end diff --git a/db/migrate/20230921082223_add_limit_to_queued_migration_version_in_batched_background_migrations.rb b/db/migrate/20230921082223_add_limit_to_queued_migration_version_in_batched_background_migrations.rb new file mode 100644 index 00000000000..cb71628a879 --- /dev/null +++ b/db/migrate/20230921082223_add_limit_to_queued_migration_version_in_batched_background_migrations.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class AddLimitToQueuedMigrationVersionInBatchedBackgroundMigrations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + # 14 is set as the limit because the migration version is 14 chars in length + add_text_limit :batched_background_migrations, :queued_migration_version, 14 + end + + def down + remove_text_limit :batched_background_migrations, :queued_migration_version + end +end diff --git a/db/migrate/20230922004506_add_latest_released_at_to_catalog_resources.rb b/db/migrate/20230922004506_add_latest_released_at_to_catalog_resources.rb new file mode 100644 index 00000000000..20cdef24e93 --- /dev/null +++ b/db/migrate/20230922004506_add_latest_released_at_to_catalog_resources.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddLatestReleasedAtToCatalogResources < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :catalog_resources, :latest_released_at, :datetime_with_timezone, null: true + end +end diff --git a/db/migrate/20230925024201_add_foreign_key_for_ci_pipelines_pipeline_id_bigint.rb b/db/migrate/20230925024201_add_foreign_key_for_ci_pipelines_pipeline_id_bigint.rb new file mode 100644 index 00000000000..f28dc9ec335 --- /dev/null +++ b/db/migrate/20230925024201_add_foreign_key_for_ci_pipelines_pipeline_id_bigint.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class AddForeignKeyForCiPipelinesPipelineIdBigint < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_pipelines + REFERENCING_TABLE_NAME = :ci_pipelines + COLUMN_NAME = :auto_canceled_by_id_convert_to_bigint + + disable_ddl_transaction! + + def up + add_concurrent_foreign_key( + TABLE_NAME, REFERENCING_TABLE_NAME, + column: COLUMN_NAME, on_delete: :nullify, validate: false, reverse_lock_order: true + ) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists TABLE_NAME, column: COLUMN_NAME + end + end +end diff --git a/db/migrate/20230925095300_remove_deprecated_delete_container_repository_worker_job_instances.rb b/db/migrate/20230925095300_remove_deprecated_delete_container_repository_worker_job_instances.rb new file mode 100644 index 00000000000..465106d907d --- /dev/null +++ b/db/migrate/20230925095300_remove_deprecated_delete_container_repository_worker_job_instances.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveDeprecatedDeleteContainerRepositoryWorkerJobInstances < Gitlab::Database::Migration[2.1] + DEPRECATED_JOB_CLASSES = %w[DeleteContainerRepositoryWorker].freeze + + 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/20230925170448_add_index_on_okr_reminder_frequency.rb b/db/migrate/20230925170448_add_index_on_okr_reminder_frequency.rb new file mode 100644 index 00000000000..89ccfe36dbb --- /dev/null +++ b/db/migrate/20230925170448_add_index_on_okr_reminder_frequency.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnOkrReminderFrequency < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'idx_reminder_frequency_on_work_item_progresses' + + disable_ddl_transaction! + + def up + add_concurrent_index :work_item_progresses, :reminder_frequency, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :work_item_progresses, INDEX_NAME + end +end diff --git a/db/migrate/20230926105908_add_index_to_add_on_purchases_on_last_assigned_users_refreshed_at_and_add_on_id.rb b/db/migrate/20230926105908_add_index_to_add_on_purchases_on_last_assigned_users_refreshed_at_and_add_on_id.rb new file mode 100644 index 00000000000..9cafdd3582a --- /dev/null +++ b/db/migrate/20230926105908_add_index_to_add_on_purchases_on_last_assigned_users_refreshed_at_and_add_on_id.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexToAddOnPurchasesOnLastAssignedUsersRefreshedAtAndAddOnId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'idx_addon_purchases_on_last_refreshed_at_desc_nulls_last' + + def up + add_concurrent_index :subscription_add_on_purchases, %i[last_assigned_users_refreshed_at], + order: { last_assigned_users_refreshed_at: 'DESC NULLS LAST' }, + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :subscription_add_on_purchases, INDEX_NAME + end +end diff --git a/db/migrate/20230926115744_add_vertex_ai_access_token_to_application_settings.rb b/db/migrate/20230926115744_add_vertex_ai_access_token_to_application_settings.rb new file mode 100644 index 00000000000..c8e92ba1d4f --- /dev/null +++ b/db/migrate/20230926115744_add_vertex_ai_access_token_to_application_settings.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class AddVertexAiAccessTokenToApplicationSettings < Gitlab::Database::Migration[2.1] + def change + add_column :application_settings, :encrypted_vertex_ai_access_token, :binary + add_column :application_settings, :encrypted_vertex_ai_access_token_iv, :binary + end +end diff --git a/db/migrate/20230926133801_create_value_stream_analytics_settings.rb b/db/migrate/20230926133801_create_value_stream_analytics_settings.rb new file mode 100644 index 00000000000..991b677ec96 --- /dev/null +++ b/db/migrate/20230926133801_create_value_stream_analytics_settings.rb @@ -0,0 +1,23 @@ +# frozen_string_literal: true + +class CreateValueStreamAnalyticsSettings < Gitlab::Database::Migration[2.1] + def change + create_table :analytics_cycle_analytics_value_stream_settings, id: false do |t| + t.references( + :value_stream, + primary_key: true, + default: nil, + type: :bigint, + index: false, + foreign_key: { + to_table: :analytics_cycle_analytics_group_value_streams, + column: :analytics_cycle_analytics_group_value_stream_id, + on_delete: :cascade + } + ) + + t.bigint :project_ids_filter, array: true, default: [] + t.check_constraint 'CARDINALITY(project_ids_filter) <= 100' + end + end +end diff --git a/db/migrate/20230927141237_add_index_on_pages_deployments_deleted_at.rb b/db/migrate/20230927141237_add_index_on_pages_deployments_deleted_at.rb new file mode 100644 index 00000000000..50857b03499 --- /dev/null +++ b/db/migrate/20230927141237_add_index_on_pages_deployments_deleted_at.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexOnPagesDeploymentsDeletedAt < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX = 'index_pages_deployments_on_deleted_at' + + def up + add_concurrent_index :pages_deployments, + :deleted_at, + where: 'deleted_at IS NOT NULL', + name: INDEX + end + + def down + remove_concurrent_index :pages_deployments, :deleted_at, name: INDEX + end +end diff --git a/db/migrate/20230928073320_add_applicable_post_merge_column_to_mr_approval_rules.rb b/db/migrate/20230928073320_add_applicable_post_merge_column_to_mr_approval_rules.rb new file mode 100644 index 00000000000..f0dc6815c65 --- /dev/null +++ b/db/migrate/20230928073320_add_applicable_post_merge_column_to_mr_approval_rules.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddApplicablePostMergeColumnToMrApprovalRules < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :approval_merge_request_rules, :applicable_post_merge, :boolean + end +end diff --git a/db/migrate/20230929151451_add_math_rendering_limits_enabled.rb b/db/migrate/20230929151451_add_math_rendering_limits_enabled.rb new file mode 100644 index 00000000000..d52019c41ed --- /dev/null +++ b/db/migrate/20230929151451_add_math_rendering_limits_enabled.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddMathRenderingLimitsEnabled < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :application_settings, :math_rendering_limits_enabled, :boolean, default: true, null: false + end +end diff --git a/db/migrate/20230930094139_add_related_link_restrictions.rb b/db/migrate/20230930094139_add_related_link_restrictions.rb new file mode 100644 index 00000000000..e67f32b860c --- /dev/null +++ b/db/migrate/20230930094139_add_related_link_restrictions.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddRelatedLinkRestrictions < Gitlab::Database::Migration[2.1] + UNIQUE_INDEX_NAME = 'index_work_item_link_restrictions_on_source_link_type_target' + + def up + create_table :work_item_related_link_restrictions do |t| + t.references :source_type, index: false, null: false, + foreign_key: { on_delete: :cascade, to_table: :work_item_types } + t.references :target_type, index: true, null: false, + foreign_key: { on_delete: :cascade, to_table: :work_item_types } + t.integer :link_type, null: false, limit: 2, default: 0 + + t.index [:source_type_id, :link_type, :target_type_id], unique: true, name: UNIQUE_INDEX_NAME + end + end + + def down + drop_table :work_item_related_link_restrictions + end +end diff --git a/db/migrate/20231003073437_create_abuse_report_user_mentions.rb b/db/migrate/20231003073437_create_abuse_report_user_mentions.rb new file mode 100644 index 00000000000..42eb29fc546 --- /dev/null +++ b/db/migrate/20231003073437_create_abuse_report_user_mentions.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class CreateAbuseReportUserMentions < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + create_table :abuse_report_user_mentions do |t| + t.bigint :abuse_report_id, null: false + t.bigint :note_id, null: false + t.bigint :mentioned_users_ids, array: true, default: nil + t.bigint :mentioned_projects_ids, array: true, default: nil + t.bigint :mentioned_groups_ids, array: true, default: nil + + t.index :note_id + t.index [:abuse_report_id, :note_id], + unique: true, + name: :index_abuse_report_user_mentions_on_abuse_report_id_and_note_id + end + end + + def down + drop_table :abuse_report_user_mentions, if_exists: true + end +end diff --git a/db/migrate/20231003073505_add_abuse_reports_foreign_key_to_abuse_report_user_mentions.rb b/db/migrate/20231003073505_add_abuse_reports_foreign_key_to_abuse_report_user_mentions.rb new file mode 100644 index 00000000000..f84878e2316 --- /dev/null +++ b/db/migrate/20231003073505_add_abuse_reports_foreign_key_to_abuse_report_user_mentions.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddAbuseReportsForeignKeyToAbuseReportUserMentions < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :abuse_report_user_mentions, :abuse_reports, column: :abuse_report_id, + on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :abuse_report_user_mentions, column: :abuse_report_id + end + end +end diff --git a/db/migrate/20231003073526_add_notes_foreign_key_to_abuse_report_user_mentions.rb b/db/migrate/20231003073526_add_notes_foreign_key_to_abuse_report_user_mentions.rb new file mode 100644 index 00000000000..0fc8b2cdcfb --- /dev/null +++ b/db/migrate/20231003073526_add_notes_foreign_key_to_abuse_report_user_mentions.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddNotesForeignKeyToAbuseReportUserMentions < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :abuse_report_user_mentions, :notes, column: :note_id, on_delete: :cascade + end + + def down + with_lock_retries do + remove_foreign_key :abuse_report_user_mentions, column: :note_id + end + end +end diff --git a/db/migrate/20231004100000_create_container_registry_protection_rules.rb b/db/migrate/20231004100000_create_container_registry_protection_rules.rb new file mode 100644 index 00000000000..30a90a8391d --- /dev/null +++ b/db/migrate/20231004100000_create_container_registry_protection_rules.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class CreateContainerRegistryProtectionRules < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + create_table :container_registry_protection_rules do |t| + t.references :project, null: false, index: false, foreign_key: { on_delete: :cascade } + t.timestamps_with_timezone null: false + t.integer :delete_protected_up_to_access_level, null: false, limit: 2 + t.integer :push_protected_up_to_access_level, null: false, limit: 2 + t.text :container_path_pattern, limit: 255, null: false + + t.index [:project_id, :container_path_pattern], unique: true, + name: :i_container_protection_unique_project_id_container_path_pattern + end + end +end diff --git a/db/migrate/20231005145648_add_uuid_and_version_to_vs_code_setting.rb b/db/migrate/20231005145648_add_uuid_and_version_to_vs_code_setting.rb new file mode 100644 index 00000000000..17f880221ae --- /dev/null +++ b/db/migrate/20231005145648_add_uuid_and_version_to_vs_code_setting.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddUuidAndVersionToVsCodeSetting < Gitlab::Database::Migration[2.1] + def up + add_column :vs_code_settings, :uuid, :uuid, null: true, default: false + add_column :vs_code_settings, :version, :integer, null: true, default: false + end + + def down + remove_column :vs_code_settings, :uuid + remove_column :vs_code_settings, :version + end +end diff --git a/db/migrate/20231006154748_replace_value_stream_project_ids_filter_constraint.rb b/db/migrate/20231006154748_replace_value_stream_project_ids_filter_constraint.rb new file mode 100644 index 00000000000..ea3e97eb85f --- /dev/null +++ b/db/migrate/20231006154748_replace_value_stream_project_ids_filter_constraint.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class ReplaceValueStreamProjectIdsFilterConstraint < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + OLD_CONSTRAINT_NAME = 'chk_rails_a91b547c97' + NEW_CONSTRAINT_NAME = 'project_ids_filter_array_check' + + def up + remove_check_constraint :analytics_cycle_analytics_value_stream_settings, OLD_CONSTRAINT_NAME + + check = '((CARDINALITY(project_ids_filter) <= 100) AND (ARRAY_POSITION(project_ids_filter, null) IS null))' + add_check_constraint :analytics_cycle_analytics_value_stream_settings, check, NEW_CONSTRAINT_NAME + end + + def down + remove_check_constraint :analytics_cycle_analytics_value_stream_settings, NEW_CONSTRAINT_NAME + + check = '(CARDINALITY(project_ids_filter) <= 100)' + add_check_constraint :analytics_cycle_analytics_value_stream_settings, check, OLD_CONSTRAINT_NAME + end +end diff --git a/db/migrate/20231010101246_change_push_protected_up_to_access_level_to_smallint_in_packages_protection_rules.rb b/db/migrate/20231010101246_change_push_protected_up_to_access_level_to_smallint_in_packages_protection_rules.rb new file mode 100644 index 00000000000..d7228b0a3f1 --- /dev/null +++ b/db/migrate/20231010101246_change_push_protected_up_to_access_level_to_smallint_in_packages_protection_rules.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class ChangePushProtectedUpToAccessLevelToSmallintInPackagesProtectionRules < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + change_column :packages_protection_rules, :push_protected_up_to_access_level, :integer, limit: 2 + end + + def down + change_column :packages_protection_rules, :push_protected_up_to_access_level, :integer + end +end diff --git a/db/migrate/20231011150241_add_external_participants_from_cc_to_service_desk_settings.rb b/db/migrate/20231011150241_add_external_participants_from_cc_to_service_desk_settings.rb new file mode 100644 index 00000000000..7e313657265 --- /dev/null +++ b/db/migrate/20231011150241_add_external_participants_from_cc_to_service_desk_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddExternalParticipantsFromCcToServiceDeskSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + add_column :service_desk_settings, :add_external_participants_from_cc, :boolean, null: false, default: false + end +end diff --git a/db/migrate/20231013135216_add_task_request_attributes_to_zoekt_shards.rb b/db/migrate/20231013135216_add_task_request_attributes_to_zoekt_shards.rb new file mode 100644 index 00000000000..7b37169379a --- /dev/null +++ b/db/migrate/20231013135216_add_task_request_attributes_to_zoekt_shards.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class AddTaskRequestAttributesToZoektShards < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + UNIQUE_UUID_INDEX = 'unique_zoekt_shards_uuid' + LAST_SEEN_AT_INDEX = 'index_zoekt_shards_on_last_seen_at' + + def up + add_column :zoekt_shards, :uuid, :uuid, null: false, default: '00000000-00000000-00000000-00000000' + add_column :zoekt_shards, :last_seen_at, :datetime_with_timezone, null: false, default: '1970-01-01' + add_column :zoekt_shards, :used_bytes, :bigint, null: false, default: 0 + add_column :zoekt_shards, :total_bytes, :bigint, null: false, default: 0 + add_column :zoekt_shards, :metadata, :jsonb, default: {}, null: false + + add_concurrent_index :zoekt_shards, :uuid, unique: true, name: UNIQUE_UUID_INDEX + add_concurrent_index :zoekt_shards, :last_seen_at, name: LAST_SEEN_AT_INDEX + end + + def down + remove_column :zoekt_shards, :uuid + remove_column :zoekt_shards, :last_seen_at + remove_column :zoekt_shards, :used_bytes + remove_column :zoekt_shards, :total_bytes + remove_column :zoekt_shards, :metadata + + remove_concurrent_index :zoekt_shards, :uuid, name: UNIQUE_UUID_INDEX + remove_concurrent_index :zoekt_shards, :last_seen_at, name: LAST_SEEN_AT_INDEX + end +end diff --git a/db/migrate/20231015111533_add_manage_project_access_tokens_to_member_roles.rb b/db/migrate/20231015111533_add_manage_project_access_tokens_to_member_roles.rb new file mode 100644 index 00000000000..a3c0a39b748 --- /dev/null +++ b/db/migrate/20231015111533_add_manage_project_access_tokens_to_member_roles.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddManageProjectAccessTokensToMemberRoles < Gitlab::Database::Migration[2.1] + def change + add_column :member_roles, :manage_project_access_tokens, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20231017114131_add_auto_canceled_by_partition_id_to_p_ci_builds.rb b/db/migrate/20231017114131_add_auto_canceled_by_partition_id_to_p_ci_builds.rb new file mode 100644 index 00000000000..ecc606ca1a8 --- /dev/null +++ b/db/migrate/20231017114131_add_auto_canceled_by_partition_id_to_p_ci_builds.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddAutoCanceledByPartitionIdToPCiBuilds < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::WraparoundAutovacuum + + enable_lock_retries! + + def change + return unless can_execute_on?(:ci_builds) + + add_column :p_ci_builds, :auto_canceled_by_partition_id, :bigint, default: 100, null: false, if_not_exists: true + end +end diff --git a/db/post_migrate/20220530082653_add_traversal_id_type_group_index.rb b/db/post_migrate/20220530082653_add_traversal_id_type_group_index.rb index 00d997e1f52..e8080bc89dc 100644 --- a/db/post_migrate/20220530082653_add_traversal_id_type_group_index.rb +++ b/db/post_migrate/20220530082653_add_traversal_id_type_group_index.rb @@ -5,9 +5,11 @@ class AddTraversalIdTypeGroupIndex < Gitlab::Database::Migration[2.0] disable_ddl_transaction! + # rubocop:disable Migration/PreventIndexCreation def up add_concurrent_index :namespaces, :traversal_ids, using: :btree, where: "type='Group'", name: INDEX_NAME end + # rubocop:enable Migration/PreventIndexCreation def down remove_concurrent_index_by_name :namespaces, INDEX_NAME diff --git a/db/post_migrate/20230110172751_add_partial_index_on_group_path_id.rb b/db/post_migrate/20230110172751_add_partial_index_on_group_path_id.rb index c04b71835a2..2135f241fd1 100644 --- a/db/post_migrate/20230110172751_add_partial_index_on_group_path_id.rb +++ b/db/post_migrate/20230110172751_add_partial_index_on_group_path_id.rb @@ -5,9 +5,11 @@ class AddPartialIndexOnGroupPathId < Gitlab::Database::Migration[2.1] INDEX_NAME = :index_groups_on_path_and_id + # rubocop:disable Migration/PreventIndexCreation def up add_concurrent_index :namespaces, [:path, :id], where: "type = 'Group'", name: INDEX_NAME end + # rubocop:enable Migration/PreventIndexCreation def down remove_concurrent_index_by_name :namespaces, INDEX_NAME diff --git a/db/post_migrate/20230420120431_create_namespaces_by_top_level_namespace_index.rb b/db/post_migrate/20230420120431_create_namespaces_by_top_level_namespace_index.rb index f9fe6d4a16c..37af68ac68e 100644 --- a/db/post_migrate/20230420120431_create_namespaces_by_top_level_namespace_index.rb +++ b/db/post_migrate/20230420120431_create_namespaces_by_top_level_namespace_index.rb @@ -5,9 +5,11 @@ class CreateNamespacesByTopLevelNamespaceIndex < Gitlab::Database::Migration[2.1 INDEX_NAME = 'index_on_namespaces_namespaces_by_top_level_namespace' + # rubocop:disable Migration/PreventIndexCreation def up add_concurrent_index :namespaces, '(traversal_ids[1]), type, id', name: INDEX_NAME end + # rubocop:enable Migration/PreventIndexCreation def down remove_concurrent_index_by_name :namespaces, INDEX_NAME 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 index edbb0a8b953..c7eeb7a8915 100644 --- a/db/post_migrate/20230614182049_add_index_to_namespaces_organization_id.rb +++ b/db/post_migrate/20230614182049_add_index_to_namespaces_organization_id.rb @@ -9,9 +9,11 @@ class AddIndexToNamespacesOrganizationId < Gitlab::Database::Migration[2.1] # 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 diff --git a/db/post_migrate/20230703024031_cleanup_project_pipeline_status_key.rb b/db/post_migrate/20230703024031_cleanup_project_pipeline_status_key.rb index a5a78dcbbd1..5b457c277b6 100644 --- a/db/post_migrate/20230703024031_cleanup_project_pipeline_status_key.rb +++ b/db/post_migrate/20230703024031_cleanup_project_pipeline_status_key.rb @@ -3,7 +3,6 @@ class CleanupProjectPipelineStatusKey < Gitlab::Database::Migration[2.1] disable_ddl_transaction! - # TODO: to remove after feature-flag in duplicate-jobs client middleware is removed restrict_gitlab_migration gitlab_schema: :gitlab_main MIGRATION_WORKER_CLASS = 'BackfillProjectPipelineStatusTtl' diff --git a/db/post_migrate/20230721095222_delete_orphans_scan_finding_license_scanning_approval_rules2.rb b/db/post_migrate/20230721095222_delete_orphans_scan_finding_license_scanning_approval_rules2.rb new file mode 100644 index 00000000000..cc8c0affdea --- /dev/null +++ b/db/post_migrate/20230721095222_delete_orphans_scan_finding_license_scanning_approval_rules2.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +class DeleteOrphansScanFindingLicenseScanningApprovalRules2 < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MERGE_REQUEST_MIGRATION = 'DeleteOrphansApprovalMergeRequestRules2' + PROJECT_MIGRATION = 'DeleteOrphansApprovalProjectRules2' + INTERVAL = 2.minutes + + def up + queue_batched_background_migration( + PROJECT_MIGRATION, + :approval_project_rules, + :id, + job_interval: INTERVAL, + batch_size: 500, + sub_batch_size: 100 + ) + + queue_batched_background_migration( + MERGE_REQUEST_MIGRATION, + :approval_merge_request_rules, + :id, + job_interval: INTERVAL, + batch_size: 2500, + sub_batch_size: 500 + ) + end + + def down + delete_batched_background_migration(PROJECT_MIGRATION, :approval_project_rules, :id, []) + delete_batched_background_migration(MERGE_REQUEST_MIGRATION, :approval_merge_request_rules, :id, []) + end +end diff --git a/db/post_migrate/20230726172100_remove_index_events_author_id_and_created_at.rb b/db/post_migrate/20230726172100_remove_index_events_author_id_and_created_at.rb new file mode 100644 index 00000000000..ee426a11342 --- /dev/null +++ b/db/post_migrate/20230726172100_remove_index_events_author_id_and_created_at.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class RemoveIndexEventsAuthorIdAndCreatedAt < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_events_on_author_id_and_created_at_merge_requests' + + # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/merge_requests/127657 + def up + prepare_async_index_removal :events, + [:author_id, :created_at], + name: INDEX_NAME + end + + def down + unprepare_async_index :events, + [:author_id, :created_at], + name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230906102738_sync_index_for_ci_sources_pipelines_pipeline_id_bigint.rb b/db/post_migrate/20230906102738_sync_index_for_ci_sources_pipelines_pipeline_id_bigint.rb new file mode 100644 index 00000000000..a4c76528a22 --- /dev/null +++ b/db/post_migrate/20230906102738_sync_index_for_ci_sources_pipelines_pipeline_id_bigint.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class SyncIndexForCiSourcesPipelinesPipelineIdBigint < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_sources_pipelines + INDEXES = { + 'index_ci_sources_pipelines_on_pipeline_id_bigint' => [ + [:pipeline_id_convert_to_bigint], {} + ], + 'index_ci_sources_pipelines_on_source_pipeline_id_bigint' => [ + [:source_pipeline_id_convert_to_bigint], {} + ] + } + + def up + INDEXES.each do |index_name, (columns, options)| + add_concurrent_index TABLE_NAME, columns, name: index_name, **options + end + end + + def down + INDEXES.each do |index_name, (_columns, _options)| + remove_concurrent_index_by_name TABLE_NAME, index_name + end + end +end diff --git a/db/post_migrate/20230907020936_sync_index_for_ci_pipelines_pipeline_id_bigint.rb b/db/post_migrate/20230907020936_sync_index_for_ci_pipelines_pipeline_id_bigint.rb new file mode 100644 index 00000000000..8263318a775 --- /dev/null +++ b/db/post_migrate/20230907020936_sync_index_for_ci_pipelines_pipeline_id_bigint.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class SyncIndexForCiPipelinesPipelineIdBigint < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_pipelines + INDEX_NAME = 'index_ci_pipelines_on_auto_canceled_by_id_bigint' + COLUMN_NAME = :auto_canceled_by_id_convert_to_bigint + + def up + add_concurrent_index TABLE_NAME, COLUMN_NAME, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end +end diff --git a/db/post_migrate/20230908033511_swap_columns_for_ci_pipeline_chat_data_pipeline_id_bigint.rb b/db/post_migrate/20230908033511_swap_columns_for_ci_pipeline_chat_data_pipeline_id_bigint.rb new file mode 100644 index 00000000000..4ec9ecc5af7 --- /dev/null +++ b/db/post_migrate/20230908033511_swap_columns_for_ci_pipeline_chat_data_pipeline_id_bigint.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +class SwapColumnsForCiPipelineChatDataPipelineIdBigint < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_pipeline_chat_data + TARGET_TABLE_NAME = :ci_pipelines + TRIGGER_FUNCTION_NAME = :trigger_239c8032a8d6 + COLUMN_NAME = :pipeline_id + BIGINT_COLUMN_NAME = :pipeline_id_convert_to_bigint + LEGACY_FK_NAME = :fk_rails_64ebfab6b3 + FK_NAME = :fk_64ebfab6b3 + BIGINT_FK_NAME = :fk_5b21bde562 + + def up + swap + end + + def down + swap + end + + private + + def swap + with_lock_retries(raise_on_exhaustion: true) do + # Lock the tables involved. + execute "LOCK TABLE #{TARGET_TABLE_NAME}, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + # Rename the columns to swap names + temp_name = "temp_#{COLUMN_NAME}" + rename_column TABLE_NAME, COLUMN_NAME, temp_name # rubocop:disable Migration/WithLockRetriesDisallowedMethod + rename_column TABLE_NAME, BIGINT_COLUMN_NAME, COLUMN_NAME # rubocop:disable Migration/WithLockRetriesDisallowedMethod + rename_column TABLE_NAME, temp_name, BIGINT_COLUMN_NAME # rubocop:disable Migration/WithLockRetriesDisallowedMethod + + # Reset the trigger function + execute "ALTER FUNCTION #{quote_column_name(TRIGGER_FUNCTION_NAME)} RESET ALL" + + # Swap the defaults + change_column_default TABLE_NAME, COLUMN_NAME, nil + change_column_default TABLE_NAME, BIGINT_COLUMN_NAME, 0 + + # Swap fkey constraint + if foreign_key_exists?(TABLE_NAME, name: LEGACY_FK_NAME) + execute "ALTER TABLE #{TABLE_NAME} RENAME CONSTRAINT #{LEGACY_FK_NAME} TO #{FK_NAME}" + end + + temp_fk_name = "temp_#{FK_NAME}" + execute "ALTER TABLE #{TABLE_NAME} RENAME CONSTRAINT #{FK_NAME} TO #{temp_fk_name}" + execute "ALTER TABLE #{TABLE_NAME} RENAME CONSTRAINT #{BIGINT_FK_NAME} TO #{FK_NAME}" + execute "ALTER TABLE #{TABLE_NAME} RENAME CONSTRAINT #{temp_fk_name} TO #{BIGINT_FK_NAME}" + end + end +end diff --git a/db/post_migrate/20230908065605_validate_foreign_key_for_ci_pipeline_messages_pipeline_id_bigint.rb b/db/post_migrate/20230908065605_validate_foreign_key_for_ci_pipeline_messages_pipeline_id_bigint.rb new file mode 100644 index 00000000000..b1951942fed --- /dev/null +++ b/db/post_migrate/20230908065605_validate_foreign_key_for_ci_pipeline_messages_pipeline_id_bigint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class ValidateForeignKeyForCiPipelineMessagesPipelineIdBigint < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_pipeline_messages + COLUMN_NAME = :pipeline_id_convert_to_bigint + FK_NAME = :fk_0946fea681 + + def up + validate_foreign_key TABLE_NAME, COLUMN_NAME, name: FK_NAME + end + + def down + # Can be safely a no-op if we don't roll back the inconsistent data. + end +end diff --git a/db/post_migrate/20230908082627_finalize_backfill_default_branch_protection_namespace_setting.rb b/db/post_migrate/20230908082627_finalize_backfill_default_branch_protection_namespace_setting.rb new file mode 100644 index 00000000000..fd65c38b044 --- /dev/null +++ b/db/post_migrate/20230908082627_finalize_backfill_default_branch_protection_namespace_setting.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class FinalizeBackfillDefaultBranchProtectionNamespaceSetting < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + MIGRATION = 'BackfillDefaultBranchProtectionNamespaceSetting' + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :namespace_settings, + column_name: :namespace_id, + job_arguments: [] + ) + end + + def down + # noop + end +end diff --git a/db/post_migrate/20230910120000_queue_update_workspaces_config_version.rb b/db/post_migrate/20230910120000_queue_update_workspaces_config_version.rb new file mode 100644 index 00000000000..499e5cec11c --- /dev/null +++ b/db/post_migrate/20230910120000_queue_update_workspaces_config_version.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class QueueUpdateWorkspacesConfigVersion < Gitlab::Database::Migration[2.1] + MIGRATION = "UpdateWorkspacesConfigVersion" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 100 + SUB_BATCH_SIZE = 20 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + queue_batched_background_migration( + MIGRATION, + :workspaces, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :workspaces, :id, []) + end +end diff --git a/db/post_migrate/20230912105945_queue_backfill_finding_id_in_vulnerabilities.rb b/db/post_migrate/20230912105945_queue_backfill_finding_id_in_vulnerabilities.rb new file mode 100644 index 00000000000..3275f6e729d --- /dev/null +++ b/db/post_migrate/20230912105945_queue_backfill_finding_id_in_vulnerabilities.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class QueueBackfillFindingIdInVulnerabilities < Gitlab::Database::Migration[2.1] + MIGRATION = "BackfillFindingIdInVulnerabilities" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :vulnerabilities, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vulnerabilities, :id, []) + end +end diff --git a/db/post_migrate/20230913071219_delete_pages_domain_with_reserved_domains.rb b/db/post_migrate/20230913071219_delete_pages_domain_with_reserved_domains.rb new file mode 100644 index 00000000000..c4d9d8c8a69 --- /dev/null +++ b/db/post_migrate/20230913071219_delete_pages_domain_with_reserved_domains.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class DeletePagesDomainWithReservedDomains < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + execute <<~SQL.squish + DELETE FROM "pages_domains" + WHERE LOWER("pages_domains"."domain") IN + ('aol.com', 'gmail.com', 'hotmail.co.uk', 'hotmail.com', 'hotmail.fr', 'icloud.com', + 'live.com', 'mail.com', 'me.com', 'msn.com', 'outlook.com', 'proton.me', 'protonmail.com', + 'tutanota.com', 'yahoo.com', 'yandex.com', 'zohomail.com'); + SQL + end + + def down + # no-op + # This migration can't be rolled back as we are deleting entires + end +end diff --git a/db/post_migrate/20230914092224_synchronously_create_index_for_uuid_type_casting.rb b/db/post_migrate/20230914092224_synchronously_create_index_for_uuid_type_casting.rb new file mode 100644 index 00000000000..c0d1554e426 --- /dev/null +++ b/db/post_migrate/20230914092224_synchronously_create_index_for_uuid_type_casting.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class SynchronouslyCreateIndexForUuidTypeCasting < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :vulnerability_occurrences + INDEX_NAME = "tmp_index_vulnerability_occurrences_uuid_cast" + + def up + disable_statement_timeout do + execute <<~SQL + CREATE INDEX CONCURRENTLY IF NOT EXISTS #{INDEX_NAME} + ON #{TABLE_NAME}((uuid::uuid)) + SQL + end + end + + def down + remove_concurrent_index_by_name( + TABLE_NAME, + INDEX_NAME + ) + end +end diff --git a/db/post_migrate/20230918084159_drop_columns_from_geo_node_status_table.rb b/db/post_migrate/20230918084159_drop_columns_from_geo_node_status_table.rb new file mode 100644 index 00000000000..54941552ef9 --- /dev/null +++ b/db/post_migrate/20230918084159_drop_columns_from_geo_node_status_table.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +class DropColumnsFromGeoNodeStatusTable < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + remove_columns :geo_node_statuses, + :wikis_checksum_failed_count, + :wikis_checksum_mismatch_count, + :wikis_checksummed_count, + :wikis_failed_count, + :wikis_retrying_verification_count, + :wikis_synced_count, + :wikis_verification_failed_count, + :wikis_verified_count, + :design_repositories_count, + :design_repositories_synced_count, + :design_repositories_failed_count, + :design_repositories_registry_count + end + + def down + change_table(:geo_node_statuses) do |t| + t.integer :wikis_checksum_failed_count + t.integer :wikis_checksum_mismatch_count + t.integer :wikis_checksummed_count + t.integer :wikis_failed_count + t.integer :wikis_retrying_verification_count + t.integer :wikis_synced_count + t.integer :wikis_verification_failed_count + t.integer :wikis_verified_count + t.integer :design_repositories_count + t.integer :design_repositories_synced_count + t.integer :design_repositories_failed_count + t.integer :design_repositories_registry_count + end + end +end diff --git a/db/post_migrate/20230918143333_finalize_backfill_workspace_personal_access_token.rb b/db/post_migrate/20230918143333_finalize_backfill_workspace_personal_access_token.rb new file mode 100644 index 00000000000..c31c7b1c405 --- /dev/null +++ b/db/post_migrate/20230918143333_finalize_backfill_workspace_personal_access_token.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class FinalizeBackfillWorkspacePersonalAccessToken < Gitlab::Database::Migration[2.1] + MIGRATION = 'BackfillWorkspacePersonalAccessToken' + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + ensure_batched_background_migration_is_finished( + job_class_name: MIGRATION, + table_name: :workspaces, + column_name: :id, + job_arguments: [], + finalize: true + ) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230918145641_add_not_null_constraint_personal_access_token_in_workspaces.rb b/db/post_migrate/20230918145641_add_not_null_constraint_personal_access_token_in_workspaces.rb new file mode 100644 index 00000000000..84f0ad11e32 --- /dev/null +++ b/db/post_migrate/20230918145641_add_not_null_constraint_personal_access_token_in_workspaces.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddNotNullConstraintPersonalAccessTokenInWorkspaces < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + add_not_null_constraint :workspaces, :personal_access_token_id, validate: false + end + + def down + remove_not_null_constraint :workspaces, :personal_access_token_id + end +end diff --git a/db/post_migrate/20230920122059_add_ci_job_artifacts_file_final_path_index_synchronously.rb b/db/post_migrate/20230920122059_add_ci_job_artifacts_file_final_path_index_synchronously.rb new file mode 100644 index 00000000000..e2b91bf8711 --- /dev/null +++ b/db/post_migrate/20230920122059_add_ci_job_artifacts_file_final_path_index_synchronously.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddCiJobArtifactsFileFinalPathIndexSynchronously < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_ci_job_artifacts_on_file_final_path' + WHERE_CLAUSE = 'file_final_path IS NOT NULL' + + def up + add_concurrent_index :ci_job_artifacts, :file_final_path, name: INDEX_NAME, where: WHERE_CLAUSE + end + + def down + remove_concurrent_index_by_name :ci_job_artifacts, INDEX_NAME + end +end diff --git a/db/post_migrate/20230920154302_change_epics_hierarchy_restrictions.rb b/db/post_migrate/20230920154302_change_epics_hierarchy_restrictions.rb new file mode 100644 index 00000000000..eb1580712f5 --- /dev/null +++ b/db/post_migrate/20230920154302_change_epics_hierarchy_restrictions.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +class ChangeEpicsHierarchyRestrictions < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class MigrationWorkItemType < MigrationRecord + self.table_name = 'work_item_types' + end + + class MigrationHierarchyRestriction < MigrationRecord + self.table_name = 'work_item_hierarchy_restrictions' + end + + def up + upsert_epic_restrictions + end + + def down + upsert_epic_restrictions(stepping_down: true) + end + + private + + def upsert_epic_restrictions(stepping_down: false) + issue_type = MigrationWorkItemType.find_by_name_and_namespace_id('Issue', nil) + epic_type = MigrationWorkItemType.find_by_name_and_namespace_id('Epic', nil) + + unless issue_type && epic_type + Gitlab::AppLogger.warn('Issue or Epic work item types not found, skipping hierarchy restrictions update') + + return + end + + restrictions = [ + { + parent_type_id: epic_type.id, + child_type_id: epic_type.id, + maximum_depth: 9, + cross_hierarchy_enabled: !stepping_down + }, + { + parent_type_id: epic_type.id, + child_type_id: issue_type.id, + maximum_depth: 1, + cross_hierarchy_enabled: !stepping_down + } + ] + + MigrationHierarchyRestriction.reset_column_information + MigrationHierarchyRestriction.upsert_all( + restrictions, + unique_by: :index_work_item_hierarchy_restrictions_on_parent_and_child + ) + end +end diff --git a/db/post_migrate/20230923094438_ensure_backfill_for_shared_runners_duration_is_finished.rb b/db/post_migrate/20230923094438_ensure_backfill_for_shared_runners_duration_is_finished.rb new file mode 100644 index 00000000000..2f82d5dbb21 --- /dev/null +++ b/db/post_migrate/20230923094438_ensure_backfill_for_shared_runners_duration_is_finished.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class EnsureBackfillForSharedRunnersDurationIsFinished < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_ci + disable_ddl_transaction! + + TABLE_NAMES = %i[ci_project_monthly_usages ci_namespace_monthly_usages] + + def up + TABLE_NAMES.each do |table_name| + ensure_batched_background_migration_is_finished( + job_class_name: 'CopyColumnUsingBackgroundMigrationJob', + table_name: table_name, + column_name: 'id', + job_arguments: [ + %w[shared_runners_duration], + %w[shared_runners_duration_convert_to_bigint] + ] + ) + end + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20230924095357_swap_columns_for_ci_project_monthly_usages_shared_runners_duration.rb b/db/post_migrate/20230924095357_swap_columns_for_ci_project_monthly_usages_shared_runners_duration.rb new file mode 100644 index 00000000000..0e9ab8aecb8 --- /dev/null +++ b/db/post_migrate/20230924095357_swap_columns_for_ci_project_monthly_usages_shared_runners_duration.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class SwapColumnsForCiProjectMonthlyUsagesSharedRunnersDuration < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_project_monthly_usages + OLD_COLUMN_NAME = :shared_runners_duration + NEW_COLUMN_NAME = :shared_runners_duration_convert_to_bigint + TEMP_COLUMN_NAME = :temp_shared_runners_duration + + def up + swap + end + + def down + swap + end + + private + + def swap + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{OLD_COLUMN_NAME} TO #{TEMP_COLUMN_NAME}" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{NEW_COLUMN_NAME} TO #{OLD_COLUMN_NAME}" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{TEMP_COLUMN_NAME} TO #{NEW_COLUMN_NAME}" + end + end +end diff --git a/db/post_migrate/20230924134453_cleanup_uuid_type_migration_on_vulnerability_occurrences.rb b/db/post_migrate/20230924134453_cleanup_uuid_type_migration_on_vulnerability_occurrences.rb new file mode 100644 index 00000000000..192fa854502 --- /dev/null +++ b/db/post_migrate/20230924134453_cleanup_uuid_type_migration_on_vulnerability_occurrences.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +class CleanupUuidTypeMigrationOnVulnerabilityOccurrences < Gitlab::Database::Migration[2.1] + TABLE = :vulnerability_occurrences + TRIGGER_NAME = "trigger_1a857e8db6cd" + COLUMN_NAME = "uuid" + TEMP_COLUMN_NAME = "uuid_convert_string_to_uuid" + + disable_ddl_transaction! + + def up + # Unfortunately I can't use cleanup_concurrent_column_type_change + # because it's not working with disable_ddl_transaction! + # In addition, it doesn't perform cleanup correctly because the original + # trigger was created using UnidirectionalCopyTrigger so it fails to remove + # the actual trigger + # rubocop:disable Migration/WithLockRetriesDisallowedMethod + with_lock_retries do + check_trigger_permissions!(TABLE) + remove_rename_triggers(TABLE, TRIGGER_NAME) + remove_column(TABLE, COLUMN_NAME) + + rename_column(TABLE, TEMP_COLUMN_NAME, COLUMN_NAME) + end + # rubocop:enable Migration/WithLockRetriesDisallowedMethod + end + + def down + undo_cleanup_concurrent_column_type_change( + TABLE, + COLUMN_NAME, + :string, + limit: 36, + temp_column: TEMP_COLUMN_NAME + ) + change_column_null(TABLE, COLUMN_NAME, true) + end +end diff --git a/db/post_migrate/20230924154419_drop_temporary_index_on_uuid_for_type_migration.rb b/db/post_migrate/20230924154419_drop_temporary_index_on_uuid_for_type_migration.rb new file mode 100644 index 00000000000..57bb176f39e --- /dev/null +++ b/db/post_migrate/20230924154419_drop_temporary_index_on_uuid_for_type_migration.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropTemporaryIndexOnUuidForTypeMigration < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = "tmp_idx_vulns_on_converted_uuid" + + def up + remove_concurrent_index_by_name( + :vulnerability_occurrences, + INDEX_NAME + ) + end + + def down + # no-op, the table is too big so we need to create the index asynchronously + end +end diff --git a/db/post_migrate/20230925062516_add_foreign_key_for_ci_stages_pipeline_id_bigint.rb b/db/post_migrate/20230925062516_add_foreign_key_for_ci_stages_pipeline_id_bigint.rb new file mode 100644 index 00000000000..ba75cf4037f --- /dev/null +++ b/db/post_migrate/20230925062516_add_foreign_key_for_ci_stages_pipeline_id_bigint.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class AddForeignKeyForCiStagesPipelineIdBigint < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_stages + REFERENCING_TABLE_NAME = :ci_pipelines + COLUMN_NAME = :pipeline_id_convert_to_bigint + + disable_ddl_transaction! + + def up + add_concurrent_foreign_key( + TABLE_NAME, REFERENCING_TABLE_NAME, + column: COLUMN_NAME, on_delete: :cascade, validate: false, reverse_lock_order: true + ) + end + + def down + with_lock_retries do + remove_foreign_key_if_exists TABLE_NAME, column: COLUMN_NAME + end + end +end diff --git a/db/post_migrate/20230925062800_async_validate_foreign_key_for_ci_stages_pipeline_id_bigint.rb b/db/post_migrate/20230925062800_async_validate_foreign_key_for_ci_stages_pipeline_id_bigint.rb new file mode 100644 index 00000000000..f81e6985d8f --- /dev/null +++ b/db/post_migrate/20230925062800_async_validate_foreign_key_for_ci_stages_pipeline_id_bigint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AsyncValidateForeignKeyForCiStagesPipelineIdBigint < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_stages + COLUMN_NAME = :pipeline_id_convert_to_bigint + FK_NAME = :fk_c5ddde695f + + def up + prepare_async_foreign_key_validation TABLE_NAME, COLUMN_NAME, name: FK_NAME + end + + def down + unprepare_async_foreign_key_validation TABLE_NAME, COLUMN_NAME, name: FK_NAME + end +end diff --git a/db/post_migrate/20230925095357_swap_columns_for_ci_namespace_monthly_usages_shared_runners_duration.rb b/db/post_migrate/20230925095357_swap_columns_for_ci_namespace_monthly_usages_shared_runners_duration.rb new file mode 100644 index 00000000000..8255bff71a5 --- /dev/null +++ b/db/post_migrate/20230925095357_swap_columns_for_ci_namespace_monthly_usages_shared_runners_duration.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +class SwapColumnsForCiNamespaceMonthlyUsagesSharedRunnersDuration < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_namespace_monthly_usages + OLD_COLUMN_NAME = :shared_runners_duration + NEW_COLUMN_NAME = :shared_runners_duration_convert_to_bigint + TEMP_COLUMN_NAME = :temp_shared_runners_duration + + def up + swap + end + + def down + swap + end + + private + + def swap + with_lock_retries(raise_on_exhaustion: true) do + execute "LOCK TABLE #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{OLD_COLUMN_NAME} TO #{TEMP_COLUMN_NAME}" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{NEW_COLUMN_NAME} TO #{OLD_COLUMN_NAME}" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{TEMP_COLUMN_NAME} TO #{NEW_COLUMN_NAME}" + end + end +end diff --git a/db/post_migrate/20230926024201_async_validate_foreign_key_for_ci_pipelines_pipeline_id_bigint.rb b/db/post_migrate/20230926024201_async_validate_foreign_key_for_ci_pipelines_pipeline_id_bigint.rb new file mode 100644 index 00000000000..32c193b5b3f --- /dev/null +++ b/db/post_migrate/20230926024201_async_validate_foreign_key_for_ci_pipelines_pipeline_id_bigint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AsyncValidateForeignKeyForCiPipelinesPipelineIdBigint < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_pipelines + COLUMN_NAME = :auto_canceled_by_id_convert_to_bigint + FK_NAME = :fk_67e4288f3a + + def up + prepare_async_foreign_key_validation TABLE_NAME, COLUMN_NAME, name: FK_NAME + end + + def down + unprepare_async_foreign_key_validation TABLE_NAME, COLUMN_NAME, name: FK_NAME + end +end diff --git a/db/post_migrate/20230926040722_add_foreign_key_for_ci_sources_pipelines_pipeline_id_bigint.rb b/db/post_migrate/20230926040722_add_foreign_key_for_ci_sources_pipelines_pipeline_id_bigint.rb new file mode 100644 index 00000000000..3ecb17722fd --- /dev/null +++ b/db/post_migrate/20230926040722_add_foreign_key_for_ci_sources_pipelines_pipeline_id_bigint.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class AddForeignKeyForCiSourcesPipelinesPipelineIdBigint < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_sources_pipelines + REFERENCING_TABLE_NAME = :ci_pipelines + COLUMN_NAMES = [:pipeline_id_convert_to_bigint, :source_pipeline_id_convert_to_bigint] + + disable_ddl_transaction! + + def up + COLUMN_NAMES.each do |column_name| + add_concurrent_foreign_key( + TABLE_NAME, REFERENCING_TABLE_NAME, + column: column_name, on_delete: :cascade, validate: false, reverse_lock_order: true + ) + end + end + + def down + COLUMN_NAMES.each do |column_name| + with_lock_retries do + remove_foreign_key_if_exists TABLE_NAME, column: column_name + end + end + end +end diff --git a/db/post_migrate/20230926040755_async_validate_foreign_key_for_ci_sources_pipelines_pipeline_id_bigint.rb b/db/post_migrate/20230926040755_async_validate_foreign_key_for_ci_sources_pipelines_pipeline_id_bigint.rb new file mode 100644 index 00000000000..5f9a3315e52 --- /dev/null +++ b/db/post_migrate/20230926040755_async_validate_foreign_key_for_ci_sources_pipelines_pipeline_id_bigint.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AsyncValidateForeignKeyForCiSourcesPipelinesPipelineIdBigint < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_sources_pipelines + COLUMN_NAME_MAPPINGS = { + pipeline_id_convert_to_bigint: :fk_c1b5dc6b6f, + source_pipeline_id_convert_to_bigint: :fk_1df371767f + } + + def up + COLUMN_NAME_MAPPINGS.each do |column_name, foreign_key_name| + prepare_async_foreign_key_validation TABLE_NAME, column_name, name: foreign_key_name + end + end + + def down + COLUMN_NAME_MAPPINGS.each do |column_name, foreign_key_name| + unprepare_async_foreign_key_validation TABLE_NAME, column_name, name: foreign_key_name + end + end +end diff --git a/db/post_migrate/20230926113518_remove_application_settings_ai_access_token_column.rb b/db/post_migrate/20230926113518_remove_application_settings_ai_access_token_column.rb new file mode 100644 index 00000000000..6a17cd1427e --- /dev/null +++ b/db/post_migrate/20230926113518_remove_application_settings_ai_access_token_column.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemoveApplicationSettingsAiAccessTokenColumn < Gitlab::Database::Migration[2.1] + def up + # no-op because the column was not ignored correctly, + # see https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/24523 + end + + def down + # no-op because the column was not ignored correctly, + # see https://gitlab.com/gitlab-com/gl-infra/reliability/-/issues/24523 + end +end diff --git a/db/post_migrate/20230926201357_drop_index_namespaces_on_type_and_visibility_and_parent_id.rb b/db/post_migrate/20230926201357_drop_index_namespaces_on_type_and_visibility_and_parent_id.rb new file mode 100644 index 00000000000..2bcde6e468f --- /dev/null +++ b/db/post_migrate/20230926201357_drop_index_namespaces_on_type_and_visibility_and_parent_id.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DropIndexNamespacesOnTypeAndVisibilityAndParentId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = 'namespaces' + INDEX_NAME = 'index_namespaces_on_type_and_visibility_and_parent_id' + CONDITIONS = "(type = 'Group' AND parent_id IS NULL AND visibility_level != 20)" + + def up + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end + + def down + add_concurrent_index TABLE_NAME, :id, name: INDEX_NAME, where: CONDITIONS + end +end diff --git a/db/post_migrate/20230927045103_async_idx_vulnerability_occurences_on_prim_iden_id.rb b/db/post_migrate/20230927045103_async_idx_vulnerability_occurences_on_prim_iden_id.rb new file mode 100644 index 00000000000..8c4bac1d969 --- /dev/null +++ b/db/post_migrate/20230927045103_async_idx_vulnerability_occurences_on_prim_iden_id.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AsyncIdxVulnerabilityOccurencesOnPrimIdenId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + NEW_INDEX_NAME = 'index_vulnerability_occurrences_prim_iden_id_and_vuln_id' + TABLE_NAME = :vulnerability_occurrences + + def up + prepare_async_index TABLE_NAME, [:primary_identifier_id, :vulnerability_id], name: NEW_INDEX_NAME + end + + def down + unprepare_async_index_by_name TABLE_NAME, NEW_INDEX_NAME + end +end diff --git a/db/post_migrate/20230928024357_drop_index_namespaces_on_runners_token.rb b/db/post_migrate/20230928024357_drop_index_namespaces_on_runners_token.rb new file mode 100644 index 00000000000..b590598f6e9 --- /dev/null +++ b/db/post_migrate/20230928024357_drop_index_namespaces_on_runners_token.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DropIndexNamespacesOnRunnersToken < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :namespaces + INDEX_NAME = :index_namespaces_on_runners_token + + def up + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end + + def down + add_concurrent_index TABLE_NAME, :runners_token, unique: true, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20230928104015_sync_foreign_key_for_ci_stages_pipeline_id_bigint.rb b/db/post_migrate/20230928104015_sync_foreign_key_for_ci_stages_pipeline_id_bigint.rb new file mode 100644 index 00000000000..139f8a9ea4c --- /dev/null +++ b/db/post_migrate/20230928104015_sync_foreign_key_for_ci_stages_pipeline_id_bigint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class SyncForeignKeyForCiStagesPipelineIdBigint < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_stages + COLUMN_NAME = :pipeline_id_convert_to_bigint + FK_NAME = :fk_c5ddde695f + + def up + validate_foreign_key TABLE_NAME, COLUMN_NAME, name: FK_NAME + end + + def down + # Can be safely a no-op if we don't roll back the inconsistent data. + end +end diff --git a/db/post_migrate/20230929063124_sync_foreign_key_for_ci_sources_pipelines_pipeline_id_bigint.rb b/db/post_migrate/20230929063124_sync_foreign_key_for_ci_sources_pipelines_pipeline_id_bigint.rb new file mode 100644 index 00000000000..3673cf59c3d --- /dev/null +++ b/db/post_migrate/20230929063124_sync_foreign_key_for_ci_sources_pipelines_pipeline_id_bigint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class SyncForeignKeyForCiSourcesPipelinesPipelineIdBigint < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_sources_pipelines + COLUMN_NAME = :pipeline_id_convert_to_bigint + FK_NAME = :fk_c1b5dc6b6f + + def up + validate_foreign_key TABLE_NAME, COLUMN_NAME, name: FK_NAME + end + + def down + # Can be safely a no-op if we don't roll back the inconsistent data. + end +end diff --git a/db/post_migrate/20230929063406_sync_foreign_key_for_ci_sources_pipelines_source_pipeline_id_bigint.rb b/db/post_migrate/20230929063406_sync_foreign_key_for_ci_sources_pipelines_source_pipeline_id_bigint.rb new file mode 100644 index 00000000000..8cbc98813b5 --- /dev/null +++ b/db/post_migrate/20230929063406_sync_foreign_key_for_ci_sources_pipelines_source_pipeline_id_bigint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class SyncForeignKeyForCiSourcesPipelinesSourcePipelineIdBigint < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_sources_pipelines + COLUMN_NAME = :source_pipeline_id_convert_to_bigint + FK_NAME = :fk_1df371767f + + def up + validate_foreign_key TABLE_NAME, COLUMN_NAME, name: FK_NAME + end + + def down + # Can be safely a no-op if we don't roll back the inconsistent data. + end +end diff --git a/db/post_migrate/20230929095008_drop_application_settings_product_analytics_cluster_settings.rb b/db/post_migrate/20230929095008_drop_application_settings_product_analytics_cluster_settings.rb new file mode 100644 index 00000000000..b759ee21912 --- /dev/null +++ b/db/post_migrate/20230929095008_drop_application_settings_product_analytics_cluster_settings.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class DropApplicationSettingsProductAnalyticsClusterSettings < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + remove_column :application_settings, :encrypted_product_analytics_clickhouse_connection_string, if_exists: true + remove_column :application_settings, :encrypted_product_analytics_clickhouse_connection_string_iv, if_exists: true + remove_column :application_settings, :encrypted_jitsu_administrator_password, if_exists: true + remove_column :application_settings, :encrypted_jitsu_administrator_password_iv, if_exists: true + remove_column :application_settings, :jitsu_host, if_exists: true + remove_column :application_settings, :jitsu_project_xid, if_exists: true + remove_column :application_settings, :jitsu_administrator_email, if_exists: true + end + + def down + add_column :application_settings, :encrypted_product_analytics_clickhouse_connection_string, + :binary, if_not_exists: true + add_column :application_settings, :encrypted_product_analytics_clickhouse_connection_string_iv, + :binary, if_not_exists: true + add_column :application_settings, :encrypted_jitsu_administrator_password, + :binary, if_not_exists: true + add_column :application_settings, :encrypted_jitsu_administrator_password_iv, + :binary, if_not_exists: true + + add_column :application_settings, :jitsu_host, :text, if_not_exists: true + add_column :application_settings, :jitsu_project_xid, :text, if_not_exists: true + add_column :application_settings, :jitsu_administrator_email, :text, if_not_exists: true + + add_text_limit :application_settings, :jitsu_host, 255 + add_text_limit :application_settings, :jitsu_project_xid, 255 + add_text_limit :application_settings, :jitsu_administrator_email, 255 + end +end diff --git a/db/post_migrate/20230929095728_drop_project_settings_product_analytics_cluster_settings.rb b/db/post_migrate/20230929095728_drop_project_settings_product_analytics_cluster_settings.rb new file mode 100644 index 00000000000..e6f0c29fb7a --- /dev/null +++ b/db/post_migrate/20230929095728_drop_project_settings_product_analytics_cluster_settings.rb @@ -0,0 +1,37 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class DropProjectSettingsProductAnalyticsClusterSettings < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + remove_column :project_settings, :encrypted_product_analytics_clickhouse_connection_string, if_exists: true + remove_column :project_settings, :encrypted_product_analytics_clickhouse_connection_string_iv, if_exists: true + remove_column :project_settings, :encrypted_jitsu_administrator_password, if_exists: true + remove_column :project_settings, :encrypted_jitsu_administrator_password_iv, if_exists: true + remove_column :project_settings, :jitsu_host, if_exists: true + remove_column :project_settings, :jitsu_project_xid, if_exists: true + remove_column :project_settings, :jitsu_administrator_email, if_exists: true + end + + def down + add_column :project_settings, :encrypted_product_analytics_clickhouse_connection_string, + :binary, if_not_exists: true + add_column :project_settings, :encrypted_product_analytics_clickhouse_connection_string_iv, + :binary, if_not_exists: true + add_column :project_settings, :encrypted_jitsu_administrator_password, + :binary, if_not_exists: true + add_column :project_settings, :encrypted_jitsu_administrator_password_iv, + :binary, if_not_exists: true + + add_column :project_settings, :jitsu_host, :text, if_not_exists: true + add_column :project_settings, :jitsu_project_xid, :text, if_not_exists: true + add_column :project_settings, :jitsu_administrator_email, :text, if_not_exists: true + + add_text_limit :project_settings, :jitsu_host, 255 + add_text_limit :project_settings, :jitsu_project_xid, 255 + add_text_limit :project_settings, :jitsu_administrator_email, 255 + end +end diff --git a/db/post_migrate/20231001105945_requeue_backfill_finding_id_in_vulnerabilities.rb b/db/post_migrate/20231001105945_requeue_backfill_finding_id_in_vulnerabilities.rb new file mode 100644 index 00000000000..8115ad199ce --- /dev/null +++ b/db/post_migrate/20231001105945_requeue_backfill_finding_id_in_vulnerabilities.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class RequeueBackfillFindingIdInVulnerabilities < Gitlab::Database::Migration[2.1] + MIGRATION = "BackfillFindingIdInVulnerabilities" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 100 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :vulnerabilities, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vulnerabilities, :id, []) + end +end diff --git a/db/post_migrate/20231002023318_prepare_removal_index_deployments_on_project_id_and_ref.rb b/db/post_migrate/20231002023318_prepare_removal_index_deployments_on_project_id_and_ref.rb new file mode 100644 index 00000000000..8b707e68f16 --- /dev/null +++ b/db/post_migrate/20231002023318_prepare_removal_index_deployments_on_project_id_and_ref.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class PrepareRemovalIndexDeploymentsOnProjectIdAndRef < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_deployments_on_project_id_and_ref' + + # TODO: Index to be destroyed synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/402511 + def up + prepare_async_index_removal :deployments, %i[project_id ref], name: INDEX_NAME + end + + def down + unprepare_async_index :deployments, %i[project_id ref], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231003003241_drop_index_btree_namespaces_traversal_ids.rb b/db/post_migrate/20231003003241_drop_index_btree_namespaces_traversal_ids.rb new file mode 100644 index 00000000000..455ae748fb5 --- /dev/null +++ b/db/post_migrate/20231003003241_drop_index_btree_namespaces_traversal_ids.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class DropIndexBtreeNamespacesTraversalIds < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :namespaces + INDEX_NAME = :index_btree_namespaces_traversal_ids + + def up + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end + + def down + add_concurrent_index TABLE_NAME, :traversal_ids, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231003034711_sync_foreign_key_for_ci_pipelines_auto_canceled_by_id_bigint.rb b/db/post_migrate/20231003034711_sync_foreign_key_for_ci_pipelines_auto_canceled_by_id_bigint.rb new file mode 100644 index 00000000000..bf68e632828 --- /dev/null +++ b/db/post_migrate/20231003034711_sync_foreign_key_for_ci_pipelines_auto_canceled_by_id_bigint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class SyncForeignKeyForCiPipelinesAutoCanceledByIdBigint < Gitlab::Database::Migration[2.1] + TABLE_NAME = :ci_pipelines + COLUMN_NAME = :auto_canceled_by_id_convert_to_bigint + FK_NAME = :fk_67e4288f3a + + def up + validate_foreign_key TABLE_NAME, COLUMN_NAME, name: FK_NAME + end + + def down + # Can be safely a no-op if we don't roll back the inconsistent data. + end +end diff --git a/db/post_migrate/20231003083900_swap_columns_for_ci_pipeline_messages_pipeline_id_bigint.rb b/db/post_migrate/20231003083900_swap_columns_for_ci_pipeline_messages_pipeline_id_bigint.rb new file mode 100644 index 00000000000..678ff479687 --- /dev/null +++ b/db/post_migrate/20231003083900_swap_columns_for_ci_pipeline_messages_pipeline_id_bigint.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +class SwapColumnsForCiPipelineMessagesPipelineIdBigint < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_pipeline_messages + TARGET_TABLE_NAME = :ci_pipelines + TRIGGER_FUNCTION_NAME = :trigger_bfad0e2b9c86 + COLUMN_NAME = :pipeline_id + BIGINT_COLUMN_NAME = :pipeline_id_convert_to_bigint + FK_NAME = :fk_rails_8d3b04e3e1 + BIGINT_FK_NAME = :fk_0946fea681 + INDEX_NAME = :index_ci_pipeline_messages_on_pipeline_id + BIGINT_INDEX_NAME = :index_ci_pipeline_messages_on_pipeline_id_convert_to_bigint + + def up + swap + end + + def down + swap + end + + private + + def swap + with_lock_retries(raise_on_exhaustion: true) do + # Lock the tables involved. + execute "LOCK TABLE #{TARGET_TABLE_NAME}, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + # Rename the columns to swap names + temp_name = "temp_#{COLUMN_NAME}" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{COLUMN_NAME} TO #{temp_name}" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{BIGINT_COLUMN_NAME} TO #{COLUMN_NAME}" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{temp_name} TO #{BIGINT_COLUMN_NAME}" + + # Reset the trigger function + execute "ALTER FUNCTION #{quote_column_name(TRIGGER_FUNCTION_NAME)} RESET ALL" + + # Swap the defaults + change_column_default TABLE_NAME, COLUMN_NAME, nil + change_column_default TABLE_NAME, BIGINT_COLUMN_NAME, 0 + + # Swap fkey constraint + temp_fk_name = "temp_#{FK_NAME}" + execute "ALTER TABLE #{TABLE_NAME} RENAME CONSTRAINT #{FK_NAME} TO #{temp_fk_name}" + execute "ALTER TABLE #{TABLE_NAME} RENAME CONSTRAINT #{BIGINT_FK_NAME} TO #{FK_NAME}" + execute "ALTER TABLE #{TABLE_NAME} RENAME CONSTRAINT #{temp_fk_name} TO #{BIGINT_FK_NAME}" + + # Swap index + temp_index_name = "temp_#{INDEX_NAME}" + execute "ALTER INDEX #{INDEX_NAME} RENAME TO #{temp_index_name}" + execute "ALTER INDEX #{BIGINT_INDEX_NAME} RENAME TO #{INDEX_NAME}" + execute "ALTER INDEX #{temp_index_name} RENAME TO #{BIGINT_INDEX_NAME}" + end + end +end diff --git a/db/post_migrate/20231003142534_add_build_timeout_index.rb b/db/post_migrate/20231003142534_add_build_timeout_index.rb new file mode 100644 index 00000000000..3a95c7cf748 --- /dev/null +++ b/db/post_migrate/20231003142534_add_build_timeout_index.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddBuildTimeoutIndex < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_projects_on_id_where_build_timeout_geq_than_2629746' + + def up + add_concurrent_index :projects, :id, where: 'build_timeout >= 2629746', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :projects, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231003142706_lower_project_build_timeout_to_respect_max_validation.rb b/db/post_migrate/20231003142706_lower_project_build_timeout_to_respect_max_validation.rb new file mode 100644 index 00000000000..b3a9bf00418 --- /dev/null +++ b/db/post_migrate/20231003142706_lower_project_build_timeout_to_respect_max_validation.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class LowerProjectBuildTimeoutToRespectMaxValidation < Gitlab::Database::Migration[2.1] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + class Project < MigrationRecord + self.table_name = 'projects' + + include EachBatch + end + + def up + Project.where("build_timeout >= #{1.month.to_i}").each_batch(of: 10) do |records| + records.update_all(build_timeout: (1.month - 1.second).to_i) + end + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231003145757_remove_build_timeout_index.rb b/db/post_migrate/20231003145757_remove_build_timeout_index.rb new file mode 100644 index 00000000000..c5d3b368ad2 --- /dev/null +++ b/db/post_migrate/20231003145757_remove_build_timeout_index.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveBuildTimeoutIndex < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_projects_on_id_where_build_timeout_geq_than_2629746' + + def up + remove_concurrent_index_by_name :projects, name: INDEX_NAME + end + + def down + add_concurrent_index :projects, :id, where: 'build_timeout >= 2629746', name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231004053341_add_index_for_group_vulnerabilities_aysnc.rb b/db/post_migrate/20231004053341_add_index_for_group_vulnerabilities_aysnc.rb new file mode 100644 index 00000000000..275207ca870 --- /dev/null +++ b/db/post_migrate/20231004053341_add_index_for_group_vulnerabilities_aysnc.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class AddIndexForGroupVulnerabilitiesAysnc < Gitlab::Database::Migration[2.1] + # The column used with the IN query and the columns in the ORDER BY + # clause are covered with a database index. The columns in the index + # must be in the following order: column_for_the_in_query, order by + # column 1, and order by column 2. + # + # https://docs.gitlab.com/ee/development/database/efficient_in_operator_queries.html#requirements + INDEX_NAME = 'index_vulnerabilities_on_project_id_and_id' + TABLE_NAME = :vulnerabilities + COLUMN_NAMES = [:project_id, :id] + + disable_ddl_transaction! + + def up + # TODO: Issue for synchronous migration https://gitlab.com/gitlab-org/gitlab/-/issues/426371 + prepare_async_index :vulnerabilities, COLUMN_NAMES, name: INDEX_NAME + end + + def down + unprepare_async_index :vulnerabilities, COLUMN_NAMES, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231004080224_swap_columns_for_ci_stages_pipeline_id_bigint.rb b/db/post_migrate/20231004080224_swap_columns_for_ci_stages_pipeline_id_bigint.rb new file mode 100644 index 00000000000..38cbc52c24b --- /dev/null +++ b/db/post_migrate/20231004080224_swap_columns_for_ci_stages_pipeline_id_bigint.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class SwapColumnsForCiStagesPipelineIdBigint < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/16998 + end + + def down + # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/16998 + end +end diff --git a/db/post_migrate/20231004091113_swap_columns_for_ci_sources_pipelines_pipeline_id_bigint.rb b/db/post_migrate/20231004091113_swap_columns_for_ci_sources_pipelines_pipeline_id_bigint.rb new file mode 100644 index 00000000000..6ce4e1a4da5 --- /dev/null +++ b/db/post_migrate/20231004091113_swap_columns_for_ci_sources_pipelines_pipeline_id_bigint.rb @@ -0,0 +1,77 @@ +# frozen_string_literal: true + +class SwapColumnsForCiSourcesPipelinesPipelineIdBigint < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :ci_sources_pipelines + TARGET_TABLE_NAME = :ci_pipelines + TRIGGER_FUNCTION_NAME = :trigger_68d7b6653c7d + COLUMN_NAMES = %i[pipeline_id source_pipeline_id] + BIGINT_COLUMN_NAMES = %i[pipeline_id_convert_to_bigint source_pipeline_id_convert_to_bigint] + FK_NAMES = [ + :fk_e1bad85861, # for pipeline_id + :fk_d4e29af7d7 # for source_pipeline_id + ] + BIGINT_FK_NAMES = [ + :fk_c1b5dc6b6f, # for pipeline_id_convert_to_bigint + :fk_1df371767f # for source_pipeline_id_convert_to_bigint + ] + INDEX_NAMES = %i[ + index_ci_sources_pipelines_on_pipeline_id + index_ci_sources_pipelines_on_source_pipeline_id + ] + BIGINT_INDEX_NAMES = %i[ + index_ci_sources_pipelines_on_pipeline_id_bigint + index_ci_sources_pipelines_on_source_pipeline_id_bigint + ] + + def up + swap + end + + def down + swap + end + + private + + def swap + with_lock_retries(raise_on_exhaustion: true) do + # Lock the tables involved. + execute "LOCK TABLE #{TARGET_TABLE_NAME}, #{TABLE_NAME} IN ACCESS EXCLUSIVE MODE" + + # Rename the columns to swap names + COLUMN_NAMES.each_with_index do |column_name, i| + bigint_column_name = BIGINT_COLUMN_NAMES[i] + temp_name = "temp_#{column_name}" + + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{column_name} TO #{temp_name}" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{bigint_column_name} TO #{column_name}" + execute "ALTER TABLE #{TABLE_NAME} RENAME COLUMN #{temp_name} TO #{bigint_column_name}" + end + + # Reset the trigger function + execute "ALTER FUNCTION #{quote_column_name(TRIGGER_FUNCTION_NAME)} RESET ALL" + + # Swap fkey constraint + FK_NAMES.each_with_index do |fk_name, i| + bigint_fk_name = BIGINT_FK_NAMES[i] + temp_fk_name = "temp_#{fk_name}" + + execute "ALTER TABLE #{TABLE_NAME} RENAME CONSTRAINT #{fk_name} TO #{temp_fk_name}" + execute "ALTER TABLE #{TABLE_NAME} RENAME CONSTRAINT #{bigint_fk_name} TO #{fk_name}" + execute "ALTER TABLE #{TABLE_NAME} RENAME CONSTRAINT #{temp_fk_name} TO #{bigint_fk_name}" + end + + # Swap index + INDEX_NAMES.each_with_index do |index_name, i| + bigint_index_name = BIGINT_INDEX_NAMES[i] + temp_index_name = "temp_#{index_name}" + + execute "ALTER INDEX #{index_name} RENAME TO #{temp_index_name}" + execute "ALTER INDEX #{bigint_index_name} RENAME TO #{index_name}" + execute "ALTER INDEX #{temp_index_name} RENAME TO #{bigint_index_name}" + end + end + end +end diff --git a/db/post_migrate/20231004120426_change_workspaces_force_include_all_resources_default.rb b/db/post_migrate/20231004120426_change_workspaces_force_include_all_resources_default.rb new file mode 100644 index 00000000000..e2ff6f22cfa --- /dev/null +++ b/db/post_migrate/20231004120426_change_workspaces_force_include_all_resources_default.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class ChangeWorkspacesForceIncludeAllResourcesDefault < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def change + change_column_default(:workspaces, :force_include_all_resources, from: false, to: true) + end +end diff --git a/db/post_migrate/20231005131445_add_work_items_related_link_restrictions.rb b/db/post_migrate/20231005131445_add_work_items_related_link_restrictions.rb new file mode 100644 index 00000000000..e26f6a36761 --- /dev/null +++ b/db/post_migrate/20231005131445_add_work_items_related_link_restrictions.rb @@ -0,0 +1,80 @@ +# frozen_string_literal: true + +class AddWorkItemsRelatedLinkRestrictions < Gitlab::Database::Migration[2.1] + RELATED = 0 + BLOCKS = 1 + + class WorkItemType < MigrationRecord + self.table_name = 'work_item_types' + end + + class RelatedLinkRestriction < MigrationRecord + self.table_name = 'work_item_related_link_restrictions' + end + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + # rubocop:disable Metrics/AbcSize + def up + epic = WorkItemType.find_by_name_and_namespace_id('Epic', nil) + issue = WorkItemType.find_by_name_and_namespace_id('Issue', nil) + task = WorkItemType.find_by_name_and_namespace_id('Task', nil) + objective = WorkItemType.find_by_name_and_namespace_id('Objective', nil) + key_result = WorkItemType.find_by_name_and_namespace_id('Key Result', nil) + + unless epic && issue && task && objective && key_result + Gitlab::AppLogger.warn('Default WorkItemType records are missing, not adding RelatedLinkRestrictions.') + + return + end + + restrictions = [ + { source_type_id: epic.id, target_type_id: epic.id, link_type: RELATED }, + { source_type_id: epic.id, target_type_id: issue.id, link_type: RELATED }, + { source_type_id: epic.id, target_type_id: task.id, link_type: RELATED }, + { source_type_id: epic.id, target_type_id: objective.id, link_type: RELATED }, + { source_type_id: epic.id, target_type_id: key_result.id, link_type: RELATED }, + { source_type_id: issue.id, target_type_id: issue.id, link_type: RELATED }, + { source_type_id: issue.id, target_type_id: task.id, link_type: RELATED }, + { source_type_id: issue.id, target_type_id: objective.id, link_type: RELATED }, + { source_type_id: issue.id, target_type_id: key_result.id, link_type: RELATED }, + { source_type_id: task.id, target_type_id: task.id, link_type: RELATED }, + { source_type_id: task.id, target_type_id: objective.id, link_type: RELATED }, + { source_type_id: task.id, target_type_id: key_result.id, link_type: RELATED }, + { source_type_id: objective.id, target_type_id: objective.id, link_type: RELATED }, + { source_type_id: objective.id, target_type_id: key_result.id, link_type: RELATED }, + { source_type_id: key_result.id, target_type_id: key_result.id, link_type: RELATED }, + { source_type_id: epic.id, target_type_id: epic.id, link_type: BLOCKS }, + { source_type_id: epic.id, target_type_id: issue.id, link_type: BLOCKS }, + { source_type_id: epic.id, target_type_id: task.id, link_type: BLOCKS }, + { source_type_id: epic.id, target_type_id: objective.id, link_type: BLOCKS }, + { source_type_id: epic.id, target_type_id: key_result.id, link_type: BLOCKS }, + { source_type_id: issue.id, target_type_id: issue.id, link_type: BLOCKS }, + { source_type_id: issue.id, target_type_id: epic.id, link_type: BLOCKS }, + { source_type_id: issue.id, target_type_id: task.id, link_type: BLOCKS }, + { source_type_id: issue.id, target_type_id: objective.id, link_type: BLOCKS }, + { source_type_id: issue.id, target_type_id: key_result.id, link_type: BLOCKS }, + { source_type_id: task.id, target_type_id: task.id, link_type: BLOCKS }, + { source_type_id: task.id, target_type_id: epic.id, link_type: BLOCKS }, + { source_type_id: task.id, target_type_id: issue.id, link_type: BLOCKS }, + { source_type_id: task.id, target_type_id: objective.id, link_type: BLOCKS }, + { source_type_id: task.id, target_type_id: key_result.id, link_type: BLOCKS }, + { source_type_id: objective.id, target_type_id: objective.id, link_type: BLOCKS }, + { source_type_id: objective.id, target_type_id: key_result.id, link_type: BLOCKS }, + { source_type_id: key_result.id, target_type_id: key_result.id, link_type: BLOCKS }, + { source_type_id: key_result.id, target_type_id: objective.id, link_type: BLOCKS } + ] + + RelatedLinkRestriction.upsert_all( + restrictions, + unique_by: :index_work_item_link_restrictions_on_source_link_type_target + ) + end + # rubocop:enable Metrics/AbcSize + + def down + # Until this point the restrictions table was empty so we can delete all records when migrating down + RelatedLinkRestriction.delete_all + end +end diff --git a/db/post_migrate/20231009104202_add_holder_name_hash_index_on_credit_card_validations.rb b/db/post_migrate/20231009104202_add_holder_name_hash_index_on_credit_card_validations.rb new file mode 100644 index 00000000000..3010e943315 --- /dev/null +++ b/db/post_migrate/20231009104202_add_holder_name_hash_index_on_credit_card_validations.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddHolderNameHashIndexOnCreditCardValidations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'idx_user_credit_card_validations_on_holder_name_hash' + + def up + add_concurrent_index :user_credit_card_validations, :holder_name_hash, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :user_credit_card_validations, INDEX_NAME + end +end diff --git a/db/post_migrate/20231009104325_add_partial_match_index_of_hashes_on_credit_card_validations.rb b/db/post_migrate/20231009104325_add_partial_match_index_of_hashes_on_credit_card_validations.rb new file mode 100644 index 00000000000..6baf2a8413b --- /dev/null +++ b/db/post_migrate/20231009104325_add_partial_match_index_of_hashes_on_credit_card_validations.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddPartialMatchIndexOfHashesOnCreditCardValidations < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'idx_user_credit_card_validations_on_similar_to_meta_data' + INDEX_FIELDS = [:expiration_date_hash, :last_digits_hash, :network_hash, :credit_card_validated_at] + + def up + add_concurrent_index :user_credit_card_validations, INDEX_FIELDS, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :user_credit_card_validations, INDEX_NAME + end +end diff --git a/db/post_migrate/20231009105056_index_users_on_email_domain_and_id.rb b/db/post_migrate/20231009105056_index_users_on_email_domain_and_id.rb new file mode 100644 index 00000000000..e6b750ca38b --- /dev/null +++ b/db/post_migrate/20231009105056_index_users_on_email_domain_and_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class IndexUsersOnEmailDomainAndId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_users_on_email_domain_and_id' + + def up + add_concurrent_index(:users, "lower(split_part(email, '@', 2)), id", name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name :users, INDEX_NAME + end +end diff --git a/db/post_migrate/20231009115743_add_duplicate_index_rule_type_four_and_applicable_column.rb b/db/post_migrate/20231009115743_add_duplicate_index_rule_type_four_and_applicable_column.rb new file mode 100644 index 00000000000..b278903ef3f --- /dev/null +++ b/db/post_migrate/20231009115743_add_duplicate_index_rule_type_four_and_applicable_column.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddDuplicateIndexRuleTypeFourAndApplicableColumn < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'unique_any_approver_merge_request_rule_type_post_merge' + + disable_ddl_transaction! + + def up + add_concurrent_index :approval_merge_request_rules, [:merge_request_id, :rule_type, :applicable_post_merge], + where: 'rule_type = 4', name: INDEX_NAME, unique: true + end + + def down + remove_concurrent_index_by_name :approval_merge_request_rules, INDEX_NAME + end +end diff --git a/db/post_migrate/20231010011850_drop_index_deployments_on_project_id_and_ref.rb b/db/post_migrate/20231010011850_drop_index_deployments_on_project_id_and_ref.rb new file mode 100644 index 00000000000..760b4d347ed --- /dev/null +++ b/db/post_migrate/20231010011850_drop_index_deployments_on_project_id_and_ref.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DropIndexDeploymentsOnProjectIdAndRef < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_deployments_on_project_id_and_ref' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :deployments, name: INDEX_NAME + end + + def down + # This is based on the following `CREATE INDEX` command in db/init_structure.sql: + # CREATE INDEX index_deployments_on_project_id_and_ref ON deployments USING btree (project_id, ref) + add_concurrent_index :deployments, %i[project_id ref], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231011142714_queue_backfill_has_remediations_of_vulnerability_reads.rb b/db/post_migrate/20231011142714_queue_backfill_has_remediations_of_vulnerability_reads.rb new file mode 100644 index 00000000000..2c1eebbfaa5 --- /dev/null +++ b/db/post_migrate/20231011142714_queue_backfill_has_remediations_of_vulnerability_reads.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class QueueBackfillHasRemediationsOfVulnerabilityReads < Gitlab::Database::Migration[2.1] + MIGRATION = "BackfillHasRemediationsOfVulnerabilityReads" + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 50 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + queue_batched_background_migration( + MIGRATION, + :vulnerability_reads, + :vulnerability_id, + job_interval: DELAY_INTERVAL, + queued_migration_version: '20231011142714', + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vulnerability_reads, :vulnerability_id, []) + end +end diff --git a/db/post_migrate/20231011200058_drop_index_namespaces_on_updated_at.rb b/db/post_migrate/20231011200058_drop_index_namespaces_on_updated_at.rb new file mode 100644 index 00000000000..68787442931 --- /dev/null +++ b/db/post_migrate/20231011200058_drop_index_namespaces_on_updated_at.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropIndexNamespacesOnUpdatedAt < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :namespaces + INDEX_NAME = :index_namespaces_on_updated_at + + def up + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end + + def down + # no-op + # Since adding the same index will be time consuming, + # we have to create it asynchronously using 'prepare_async_index' helper. + end +end diff --git a/db/post_migrate/20231011232010_sync_remove_index_events_on_author_id.rb b/db/post_migrate/20231011232010_sync_remove_index_events_on_author_id.rb new file mode 100644 index 00000000000..dd6bd0d3c25 --- /dev/null +++ b/db/post_migrate/20231011232010_sync_remove_index_events_on_author_id.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class SyncRemoveIndexEventsOnAuthorId < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = "index_events_on_author_id_and_created_at_merge_requests" + + def up + remove_concurrent_index_by_name :events, name: INDEX_NAME + end + + def down + add_concurrent_index :events, + [:author_id, :created_at], + name: INDEX_NAME, + where: "(target_type = 'MergeRequest')" + end +end diff --git a/db/post_migrate/20231012161226_change_index_on_gpg_key_id_of_gpg_signatures.rb b/db/post_migrate/20231012161226_change_index_on_gpg_key_id_of_gpg_signatures.rb new file mode 100644 index 00000000000..94dd57a3259 --- /dev/null +++ b/db/post_migrate/20231012161226_change_index_on_gpg_key_id_of_gpg_signatures.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class ChangeIndexOnGpgKeyIdOfGpgSignatures < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_gpg_signatures_on_gpg_key_id_and_id' + OLD_INDEX_NAME = 'index_gpg_signatures_on_gpg_key_id' + + def up + add_concurrent_index :gpg_signatures, [:gpg_key_id, :id], name: INDEX_NAME + remove_concurrent_index_by_name :gpg_signatures, OLD_INDEX_NAME + end + + def down + add_concurrent_index :gpg_signatures, :gpg_key_id, name: OLD_INDEX_NAME + remove_concurrent_index_by_name :gpg_signatures, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231012180342_index_stopping_environments_on_updated_at.rb b/db/post_migrate/20231012180342_index_stopping_environments_on_updated_at.rb new file mode 100644 index 00000000000..3b9332ab0f8 --- /dev/null +++ b/db/post_migrate/20231012180342_index_stopping_environments_on_updated_at.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +# See https://docs.gitlab.com/ee/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class IndexStoppingEnvironmentsOnUpdatedAt < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_environments_on_updated_at_for_stopping_state' + + # TODO: Index to be created synchronously in https://gitlab.com/gitlab-org/gitlab/-/issues/428069 + def up + prepare_async_index :environments, %i[updated_at], where: "state = 'stopping'", name: INDEX_NAME + end + + def down + unprepare_async_index :environments, %i[updated_at], where: "state = 'stopping'", name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231013031159_swap_columns_for_ci_pipelines_pipeline_id_bigint.rb b/db/post_migrate/20231013031159_swap_columns_for_ci_pipelines_pipeline_id_bigint.rb new file mode 100644 index 00000000000..40c38c0ea49 --- /dev/null +++ b/db/post_migrate/20231013031159_swap_columns_for_ci_pipelines_pipeline_id_bigint.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class SwapColumnsForCiPipelinesPipelineIdBigint < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/16998 + end + + def down + # no-op to mitigate https://gitlab.com/gitlab-com/gl-infra/production/-/issues/16998 + end +end diff --git a/db/post_migrate/20231013174138_drop_member_tasks_table.rb b/db/post_migrate/20231013174138_drop_member_tasks_table.rb new file mode 100644 index 00000000000..dc2998ffcd5 --- /dev/null +++ b/db/post_migrate/20231013174138_drop_member_tasks_table.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class DropMemberTasksTable < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + def up + # no-op to resolve https://gitlab.com/gitlab-com/gl-infra/production/-/issues/16991 + end + + def down + # no-op to resolve https://gitlab.com/gitlab-com/gl-infra/production/-/issues/16991 + end +end diff --git a/db/post_migrate/20231013181758_remove_temp_index_for_project_statistics_pipeline_artifacts_size_migration.rb b/db/post_migrate/20231013181758_remove_temp_index_for_project_statistics_pipeline_artifacts_size_migration.rb new file mode 100644 index 00000000000..399fdca93f4 --- /dev/null +++ b/db/post_migrate/20231013181758_remove_temp_index_for_project_statistics_pipeline_artifacts_size_migration.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveTempIndexForProjectStatisticsPipelineArtifactsSizeMigration < Gitlab::Database::Migration[2.1] + INDEX_PROJECT_STATSISTICS_PIPELINE_ARTIFACTS_SIZE = 'tmp_index_project_statistics_pipeline_artifacts_size' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :project_statistics, INDEX_PROJECT_STATSISTICS_PIPELINE_ARTIFACTS_SIZE + end + + def down + add_concurrent_index :project_statistics, [:project_id], + name: INDEX_PROJECT_STATSISTICS_PIPELINE_ARTIFACTS_SIZE, + where: "pipeline_artifacts_size != 0" + end +end diff --git a/db/post_migrate/20231014081832_create_index_vulnerability_project_id_and_on_id_sync.rb b/db/post_migrate/20231014081832_create_index_vulnerability_project_id_and_on_id_sync.rb new file mode 100644 index 00000000000..ad4ca847f29 --- /dev/null +++ b/db/post_migrate/20231014081832_create_index_vulnerability_project_id_and_on_id_sync.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class CreateIndexVulnerabilityProjectIdAndOnIdSync < Gitlab::Database::Migration[2.1] + INDEX_NAME = 'index_vulnerabilities_on_project_id_and_id' + COLUMN_NAMES = [:project_id, :id] + + disable_ddl_transaction! + + def up + add_concurrent_index :vulnerabilities, COLUMN_NAMES, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME + end +end diff --git a/db/post_migrate/20231015225919_cleanup_bigint_conversion_for_notes_for_self_managed.rb b/db/post_migrate/20231015225919_cleanup_bigint_conversion_for_notes_for_self_managed.rb new file mode 100644 index 00000000000..3d2db6112d4 --- /dev/null +++ b/db/post_migrate/20231015225919_cleanup_bigint_conversion_for_notes_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForNotesForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:notes, [:id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015230919_cleanup_bigint_conversion_for_todos_for_self_managed.rb b/db/post_migrate/20231015230919_cleanup_bigint_conversion_for_todos_for_self_managed.rb new file mode 100644 index 00000000000..7ca7ed4cf3f --- /dev/null +++ b/db/post_migrate/20231015230919_cleanup_bigint_conversion_for_todos_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForTodosForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:todos, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015231919_cleanup_bigint_conversion_for_system_note_metadata_for_self_managed.rb b/db/post_migrate/20231015231919_cleanup_bigint_conversion_for_system_note_metadata_for_self_managed.rb new file mode 100644 index 00000000000..56ed481dcbd --- /dev/null +++ b/db/post_migrate/20231015231919_cleanup_bigint_conversion_for_system_note_metadata_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForSystemNoteMetadataForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:system_note_metadata, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015232919_cleanup_bigint_conversion_for_epic_user_mentions_for_self_managed.rb b/db/post_migrate/20231015232919_cleanup_bigint_conversion_for_epic_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..8349fc45947 --- /dev/null +++ b/db/post_migrate/20231015232919_cleanup_bigint_conversion_for_epic_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForEpicUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:epic_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015233919_cleanup_bigint_conversion_for_suggestions_for_self_managed.rb b/db/post_migrate/20231015233919_cleanup_bigint_conversion_for_suggestions_for_self_managed.rb new file mode 100644 index 00000000000..cca28e2ad8f --- /dev/null +++ b/db/post_migrate/20231015233919_cleanup_bigint_conversion_for_suggestions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForSuggestionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:suggestions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015234919_cleanup_bigint_conversion_for_issue_user_mentions_for_self_managed.rb b/db/post_migrate/20231015234919_cleanup_bigint_conversion_for_issue_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..bc88aeb5f49 --- /dev/null +++ b/db/post_migrate/20231015234919_cleanup_bigint_conversion_for_issue_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForIssueUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:issue_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231015235919_cleanup_bigint_conversion_for_note_diff_files_for_self_managed.rb b/db/post_migrate/20231015235919_cleanup_bigint_conversion_for_note_diff_files_for_self_managed.rb new file mode 100644 index 00000000000..cde8d0ac745 --- /dev/null +++ b/db/post_migrate/20231015235919_cleanup_bigint_conversion_for_note_diff_files_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForNoteDiffFilesForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:note_diff_files, [:diff_note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016000919_cleanup_bigint_conversion_for_snippet_user_mentions_for_self_managed.rb b/db/post_migrate/20231016000919_cleanup_bigint_conversion_for_snippet_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..ad92e9416a0 --- /dev/null +++ b/db/post_migrate/20231016000919_cleanup_bigint_conversion_for_snippet_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForSnippetUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:snippet_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016001919_cleanup_bigint_conversion_for_design_user_mentions_for_self_managed.rb b/db/post_migrate/20231016001919_cleanup_bigint_conversion_for_design_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..2d24be9988e --- /dev/null +++ b/db/post_migrate/20231016001919_cleanup_bigint_conversion_for_design_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForDesignUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:design_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016002919_cleanup_bigint_conversion_for_vulnerability_user_mentions_for_self_managed.rb b/db/post_migrate/20231016002919_cleanup_bigint_conversion_for_vulnerability_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..253767ddc83 --- /dev/null +++ b/db/post_migrate/20231016002919_cleanup_bigint_conversion_for_vulnerability_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForVulnerabilityUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:vulnerability_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016003919_cleanup_bigint_conversion_for_commit_user_mentions_for_self_managed.rb b/db/post_migrate/20231016003919_cleanup_bigint_conversion_for_commit_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..984e6df9a29 --- /dev/null +++ b/db/post_migrate/20231016003919_cleanup_bigint_conversion_for_commit_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForCommitUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:commit_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016004919_cleanup_bigint_conversion_for_merge_request_user_mentions_for_self_managed.rb b/db/post_migrate/20231016004919_cleanup_bigint_conversion_for_merge_request_user_mentions_for_self_managed.rb new file mode 100644 index 00000000000..b0b5dde3a97 --- /dev/null +++ b/db/post_migrate/20231016004919_cleanup_bigint_conversion_for_merge_request_user_mentions_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForMergeRequestUserMentionsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:merge_request_user_mentions, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016005919_cleanup_bigint_conversion_for_timelogs_for_self_managed.rb b/db/post_migrate/20231016005919_cleanup_bigint_conversion_for_timelogs_for_self_managed.rb new file mode 100644 index 00000000000..91227c04428 --- /dev/null +++ b/db/post_migrate/20231016005919_cleanup_bigint_conversion_for_timelogs_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForTimelogsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:timelogs, [:note_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016010919_cleanup_bigint_conversion_for_award_emoji_for_self_managed.rb b/db/post_migrate/20231016010919_cleanup_bigint_conversion_for_award_emoji_for_self_managed.rb new file mode 100644 index 00000000000..25490c9403d --- /dev/null +++ b/db/post_migrate/20231016010919_cleanup_bigint_conversion_for_award_emoji_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForAwardEmojiForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:award_emoji, [:awardable_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016011919_cleanup_bigint_conversion_for_events_for_self_managed.rb b/db/post_migrate/20231016011919_cleanup_bigint_conversion_for_events_for_self_managed.rb new file mode 100644 index 00000000000..e6df386cc14 --- /dev/null +++ b/db/post_migrate/20231016011919_cleanup_bigint_conversion_for_events_for_self_managed.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class CleanupBigintConversionForEventsForSelfManaged < Gitlab::Database::Migration[2.1] + include Gitlab::Database::MigrationHelpers::ConvertToBigint + + enable_lock_retries! + + def up + return if com_or_dev_or_test_but_not_jh? + + cleanup_conversion_of_integer_to_bigint(:events, [:target_id]) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20231016100238_remove_users_projects_creator_id_fk.rb b/db/post_migrate/20231016100238_remove_users_projects_creator_id_fk.rb new file mode 100644 index 00000000000..70eec5a6ff4 --- /dev/null +++ b/db/post_migrate/20231016100238_remove_users_projects_creator_id_fk.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveUsersProjectsCreatorIdFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + FOREIGN_KEY_NAME = "fk_03ec10b0d3" + + def up + with_lock_retries do + remove_foreign_key_if_exists(:projects, :users, + name: FOREIGN_KEY_NAME, reverse_lock_order: true) + end + end + + def down + add_concurrent_foreign_key(:projects, :users, + name: FOREIGN_KEY_NAME, column: :creator_id, + target_column: :id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20231016101611_remove_users_projects_marked_for_deletion_by_user_id_fk.rb b/db/post_migrate/20231016101611_remove_users_projects_marked_for_deletion_by_user_id_fk.rb new file mode 100644 index 00000000000..a636f6c7410 --- /dev/null +++ b/db/post_migrate/20231016101611_remove_users_projects_marked_for_deletion_by_user_id_fk.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class RemoveUsersProjectsMarkedForDeletionByUserIdFk < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + FOREIGN_KEY_NAME = "fk_25d8780d11" + + def up + with_lock_retries do + remove_foreign_key_if_exists(:projects, :users, + name: FOREIGN_KEY_NAME, reverse_lock_order: true) + end + end + + def down + add_concurrent_foreign_key(:projects, :users, + name: FOREIGN_KEY_NAME, column: :marked_for_deletion_by_user_id, + target_column: :id, on_delete: :nullify) + end +end diff --git a/db/post_migrate/20231017055853_remove_relay_state_domain_allowlist_application_settings.rb b/db/post_migrate/20231017055853_remove_relay_state_domain_allowlist_application_settings.rb new file mode 100644 index 00000000000..4719ccf9c63 --- /dev/null +++ b/db/post_migrate/20231017055853_remove_relay_state_domain_allowlist_application_settings.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveRelayStateDomainAllowlistApplicationSettings < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + remove_column :application_settings, :relay_state_domain_allowlist + end + + def down + add_column :application_settings, :relay_state_domain_allowlist, + :text, + array: true, + default: [], + null: false + end +end diff --git a/db/post_migrate/20231017060037_remove_relay_state_domain_allowlist_saml_provider.rb b/db/post_migrate/20231017060037_remove_relay_state_domain_allowlist_saml_provider.rb new file mode 100644 index 00000000000..8186fc881db --- /dev/null +++ b/db/post_migrate/20231017060037_remove_relay_state_domain_allowlist_saml_provider.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveRelayStateDomainAllowlistSamlProvider < Gitlab::Database::Migration[2.1] + enable_lock_retries! + + def up + remove_column :saml_providers, :relay_state_domain_allowlist + end + + def down + add_column :saml_providers, :relay_state_domain_allowlist, + :text, + array: true, + default: [], + null: false + end +end diff --git a/db/post_migrate/20231017064317_swap_columns_for_ci_pipeline_variables_pipeline_id_bigint.rb b/db/post_migrate/20231017064317_swap_columns_for_ci_pipeline_variables_pipeline_id_bigint.rb new file mode 100644 index 00000000000..155608a6879 --- /dev/null +++ b/db/post_migrate/20231017064317_swap_columns_for_ci_pipeline_variables_pipeline_id_bigint.rb @@ -0,0 +1,46 @@ +# frozen_string_literal: true + +class SwapColumnsForCiPipelineVariablesPipelineIdBigint < Gitlab::Database::Migration[2.1] + include ::Gitlab::Database::MigrationHelpers::Swapping + disable_ddl_transaction! + + def up + swap + end + + def down + swap + end + + private + + def swap + # rubocop:disable Migration/WithLockRetriesDisallowedMethod + with_lock_retries(raise_on_exhaustion: true) do + lock_tables(:ci_pipelines, :ci_pipeline_variables) + + swap_columns( + :ci_pipeline_variables, + :pipeline_id, + :pipeline_id_convert_to_bigint + ) + reset_trigger_function(:trigger_7f3d66a7d7f5) + swap_columns_default( + :ci_pipeline_variables, + :pipeline_id, + :pipeline_id_convert_to_bigint + ) + swap_foreign_keys( + :ci_pipeline_variables, + :fk_f29c5f4380, + :temp_fk_rails_8d3b04e3e1 + ) + swap_indexes( + :ci_pipeline_variables, + :index_ci_pipeline_variables_on_pipeline_id_and_key, + :index_ci_pipeline_variables_on_pipeline_id_bigint_and_key + ) + end + # rubocop:enable Migration/WithLockRetriesDisallowedMethod + end +end diff --git a/db/post_migrate/20231017172156_add_index_on_projects_for_adjourned_deletion.rb b/db/post_migrate/20231017172156_add_index_on_projects_for_adjourned_deletion.rb new file mode 100644 index 00000000000..6a689a5e11a --- /dev/null +++ b/db/post_migrate/20231017172156_add_index_on_projects_for_adjourned_deletion.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexOnProjectsForAdjournedDeletion < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_projects_id_for_aimed_for_deletion' + + def up + add_concurrent_index :projects, + [:id, :marked_for_deletion_at], + where: 'marked_for_deletion_at IS NOT NULL AND pending_delete = false', + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :projects, INDEX_NAME + end +end diff --git a/db/post_migrate/20231017184446_redrop_member_tasks_table.rb b/db/post_migrate/20231017184446_redrop_member_tasks_table.rb new file mode 100644 index 00000000000..56c17a32f1b --- /dev/null +++ b/db/post_migrate/20231017184446_redrop_member_tasks_table.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +class RedropMemberTasksTable < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + INDEX_NAME = 'index_member_tasks_on_member_id_and_project_id' + + def up + with_lock_retries do + remove_foreign_key_if_exists :member_tasks, :member, name: 'fk_12816d4bbb' + end + + with_lock_retries do + remove_foreign_key_if_exists :member_tasks, :project, name: 'fk_ab636303dd' + end + + drop_table :member_tasks if table_exists?(:member_tasks) + end + + def down + create_table :member_tasks, id: :bigserial, force: :cascade do |t| + t.bigint :member_id, null: false + t.references :project, type: :bigint, null: false, foreign_key: { on_delete: :cascade } + t.timestamps_with_timezone null: false + t.integer :tasks, array: true, default: '{}', limit: 2, null: false + t.index :member_id, name: 'index_member_tasks_on_member_id' + end + + add_concurrent_foreign_key :member_tasks, :members, column: :member_id, on_delete: :cascade + add_concurrent_index :member_tasks, [:member_id, :project_id], unique: true, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20231018100907_drop_index_namespaces_on_ldap_sync_last_update_at.rb b/db/post_migrate/20231018100907_drop_index_namespaces_on_ldap_sync_last_update_at.rb new file mode 100644 index 00000000000..862a68f84b9 --- /dev/null +++ b/db/post_migrate/20231018100907_drop_index_namespaces_on_ldap_sync_last_update_at.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropIndexNamespacesOnLdapSyncLastUpdateAt < Gitlab::Database::Migration[2.1] + disable_ddl_transaction! + + TABLE_NAME = :namespaces + INDEX_NAME = :index_namespaces_on_ldap_sync_last_update_at + + def up + remove_concurrent_index_by_name TABLE_NAME, INDEX_NAME + end + + def down + # no-op + # Since adding the same index will be time consuming, + # we have to create it asynchronously using 'prepare_async_index' helper (if needed). + end +end diff --git a/db/schema_migrations/20230721095222 b/db/schema_migrations/20230721095222 new file mode 100644 index 00000000000..e50bb1720da --- /dev/null +++ b/db/schema_migrations/20230721095222 @@ -0,0 +1 @@ +4496882c449a6cf25b8a388cd62dc402bd4e6974cdb8086d9c23d39db458865f
\ No newline at end of file diff --git a/db/schema_migrations/20230726172100 b/db/schema_migrations/20230726172100 new file mode 100644 index 00000000000..e01e4357185 --- /dev/null +++ b/db/schema_migrations/20230726172100 @@ -0,0 +1 @@ +f821d06c66663b10f113cafd97731f8938e85b84581065a9726b74f3dc2ec5ef
\ No newline at end of file diff --git a/db/schema_migrations/20230814045150 b/db/schema_migrations/20230814045150 new file mode 100644 index 00000000000..abac6edc144 --- /dev/null +++ b/db/schema_migrations/20230814045150 @@ -0,0 +1 @@ +218b30bf9e844ec19b9388980aa5d505fc860a5fb1ad6340e620c1ac90fd799a
\ No newline at end of file diff --git a/db/schema_migrations/20230901200448 b/db/schema_migrations/20230901200448 new file mode 100644 index 00000000000..c17ffcbbec7 --- /dev/null +++ b/db/schema_migrations/20230901200448 @@ -0,0 +1 @@ +8ff68d23e22306e024017ba7e2d45837e86da60434bd968df5696bc137155e29
\ No newline at end of file diff --git a/db/schema_migrations/20230905174639 b/db/schema_migrations/20230905174639 new file mode 100644 index 00000000000..3fa43cc7f1f --- /dev/null +++ b/db/schema_migrations/20230905174639 @@ -0,0 +1 @@ +ea50af1cff784e4968600d62f42aebea18a23dfff70cc8fdefdcfcceb95b702f
\ No newline at end of file diff --git a/db/schema_migrations/20230906102738 b/db/schema_migrations/20230906102738 new file mode 100644 index 00000000000..0faea537b22 --- /dev/null +++ b/db/schema_migrations/20230906102738 @@ -0,0 +1 @@ +80a334bdf72924dbd3e2cb5d6dc7de5d44fc3dbf4aff7796d5020adad7f6e2fc
\ No newline at end of file diff --git a/db/schema_migrations/20230906122405 b/db/schema_migrations/20230906122405 new file mode 100644 index 00000000000..f4743a41b74 --- /dev/null +++ b/db/schema_migrations/20230906122405 @@ -0,0 +1 @@ +8ef820d3702eb460400a7109655bfb4abd2c3ffb8c5bac2f4c58a72051109bd0
\ No newline at end of file diff --git a/db/schema_migrations/20230906215669 b/db/schema_migrations/20230906215669 new file mode 100644 index 00000000000..aaee18c91fc --- /dev/null +++ b/db/schema_migrations/20230906215669 @@ -0,0 +1 @@ +ba22699c5942b9974479664f404bb7eb39df919035e4dc487b7ed744b44c06a7
\ No newline at end of file diff --git a/db/schema_migrations/20230907020936 b/db/schema_migrations/20230907020936 new file mode 100644 index 00000000000..cdfb809472c --- /dev/null +++ b/db/schema_migrations/20230907020936 @@ -0,0 +1 @@ +4b0b98c85f2845a2c989141ae21ac0dd48b5a5f4a8c1044e8c8e9a942bf35535
\ No newline at end of file diff --git a/db/schema_migrations/20230908033511 b/db/schema_migrations/20230908033511 new file mode 100644 index 00000000000..04d6d33cea7 --- /dev/null +++ b/db/schema_migrations/20230908033511 @@ -0,0 +1 @@ +4a5d7c93728ba15c0dd835ce9768b90740af1c818bb2e10b370b02c585d50486
\ No newline at end of file diff --git a/db/schema_migrations/20230908065605 b/db/schema_migrations/20230908065605 new file mode 100644 index 00000000000..4b4cffc58d1 --- /dev/null +++ b/db/schema_migrations/20230908065605 @@ -0,0 +1 @@ +72fec3e0a682cfeda05e54019dd7d720e18d1bb00a4d390bd64ff582c1313d32
\ No newline at end of file diff --git a/db/schema_migrations/20230908082627 b/db/schema_migrations/20230908082627 new file mode 100644 index 00000000000..a6e860a3198 --- /dev/null +++ b/db/schema_migrations/20230908082627 @@ -0,0 +1 @@ +25bfecb56e1d08fba04e7ff47a8b080f045da637dbffb61021be5fc1f29cdd98
\ No newline at end of file diff --git a/db/schema_migrations/20230910120000 b/db/schema_migrations/20230910120000 new file mode 100644 index 00000000000..ffef50b3e9e --- /dev/null +++ b/db/schema_migrations/20230910120000 @@ -0,0 +1 @@ +a57042e0086761ca054dd8272024f1f086ae3932930e57126c64033e7a688cbd
\ No newline at end of file diff --git a/db/schema_migrations/20230910143103 b/db/schema_migrations/20230910143103 new file mode 100644 index 00000000000..0cdb16e4b85 --- /dev/null +++ b/db/schema_migrations/20230910143103 @@ -0,0 +1 @@ +42b5ec67a607af2774d224f6b90b05a419bedcb33ef17b66f893a446e03c0839
\ No newline at end of file diff --git a/db/schema_migrations/20230912105945 b/db/schema_migrations/20230912105945 new file mode 100644 index 00000000000..2ce3fedd036 --- /dev/null +++ b/db/schema_migrations/20230912105945 @@ -0,0 +1 @@ +d8e5e8780310b9877cb3f9696b5596447f3fca1c01770495cf9942041203b430
\ No newline at end of file diff --git a/db/schema_migrations/20230912141430 b/db/schema_migrations/20230912141430 new file mode 100644 index 00000000000..9117bd052cc --- /dev/null +++ b/db/schema_migrations/20230912141430 @@ -0,0 +1 @@ +ef06430887c3e156359cbf9fbf3405bab494b46406ea644bacad20753fdac232
\ No newline at end of file diff --git a/db/schema_migrations/20230913071219 b/db/schema_migrations/20230913071219 new file mode 100644 index 00000000000..c5c0f2e173f --- /dev/null +++ b/db/schema_migrations/20230913071219 @@ -0,0 +1 @@ +fdc307e3bd5e7762d276219fe877c8b2dd94c90117d914b483c624fc28f4b7dd
\ No newline at end of file diff --git a/db/schema_migrations/20230914092224 b/db/schema_migrations/20230914092224 new file mode 100644 index 00000000000..873ac7990a1 --- /dev/null +++ b/db/schema_migrations/20230914092224 @@ -0,0 +1 @@ +68e5f72af0a54a06cb7e0f3f784c3ad7e472e966bd9f93181cc7a87fbd69b8e6
\ No newline at end of file diff --git a/db/schema_migrations/20230915100513 b/db/schema_migrations/20230915100513 new file mode 100644 index 00000000000..1895f1f0790 --- /dev/null +++ b/db/schema_migrations/20230915100513 @@ -0,0 +1 @@ +0ab7e98b604ab06a94f0fdeb4f9eceff3d148922919fe920d9d5c3e22a6c061d
\ No newline at end of file diff --git a/db/schema_migrations/20230915103259 b/db/schema_migrations/20230915103259 new file mode 100644 index 00000000000..2cbfa061f31 --- /dev/null +++ b/db/schema_migrations/20230915103259 @@ -0,0 +1 @@ +d3dbc12fcadb285af3e4953addc76352c95bc6db8b20a43524627d8e6ed69b11
\ No newline at end of file diff --git a/db/schema_migrations/20230915111914 b/db/schema_migrations/20230915111914 new file mode 100644 index 00000000000..3084763fcae --- /dev/null +++ b/db/schema_migrations/20230915111914 @@ -0,0 +1 @@ +5890e80dd082fbef80ec5772597f90486defd9055b9506e588ac5c63f55d69e7
\ No newline at end of file diff --git a/db/schema_migrations/20230915111915 b/db/schema_migrations/20230915111915 new file mode 100644 index 00000000000..ca33cdb4533 --- /dev/null +++ b/db/schema_migrations/20230915111915 @@ -0,0 +1 @@ +6279203061e730ad1e6b969d55cc7aa78c0cca943beaad66852552f72511aba6
\ No newline at end of file diff --git a/db/schema_migrations/20230915111916 b/db/schema_migrations/20230915111916 new file mode 100644 index 00000000000..02c189f04be --- /dev/null +++ b/db/schema_migrations/20230915111916 @@ -0,0 +1 @@ +4c391db76b7cf1d380beb4317db727d01372da47e7a97be1bf52f9a791ed0b89
\ No newline at end of file diff --git a/db/schema_migrations/20230915111917 b/db/schema_migrations/20230915111917 new file mode 100644 index 00000000000..9dec1e72a75 --- /dev/null +++ b/db/schema_migrations/20230915111917 @@ -0,0 +1 @@ +7f51d5f2f6382dc2b48a766e32b5248846a912a47158872c1c26524127b08c61
\ No newline at end of file diff --git a/db/schema_migrations/20230917144717 b/db/schema_migrations/20230917144717 new file mode 100644 index 00000000000..26fd78432fb --- /dev/null +++ b/db/schema_migrations/20230917144717 @@ -0,0 +1 @@ +9273a3cf36500228db63a9fbe0a0c51a77c0d88c5a401fa68261a4488c0b7c33
\ No newline at end of file diff --git a/db/schema_migrations/20230918084159 b/db/schema_migrations/20230918084159 new file mode 100644 index 00000000000..c436c247702 --- /dev/null +++ b/db/schema_migrations/20230918084159 @@ -0,0 +1 @@ +0e31f2b685b3d229816f7e330b54cf5cafb7abb71aa4489d88af768dfb3629fc
\ No newline at end of file diff --git a/db/schema_migrations/20230918091159 b/db/schema_migrations/20230918091159 new file mode 100644 index 00000000000..781f6c667bd --- /dev/null +++ b/db/schema_migrations/20230918091159 @@ -0,0 +1 @@ +5fe10907524cdba6705d0f27d6e32ba99e520f9a60aa877eedfb15066b50ec2f
\ No newline at end of file diff --git a/db/schema_migrations/20230918122420 b/db/schema_migrations/20230918122420 new file mode 100644 index 00000000000..b4a2571ce38 --- /dev/null +++ b/db/schema_migrations/20230918122420 @@ -0,0 +1 @@ +ca7bee52564b9babd609d36fc42dbd78a78f8a7c46a94209b533150057985eed
\ No newline at end of file diff --git a/db/schema_migrations/20230918122430 b/db/schema_migrations/20230918122430 new file mode 100644 index 00000000000..3ca0a24e5bb --- /dev/null +++ b/db/schema_migrations/20230918122430 @@ -0,0 +1 @@ +8f1ad1125107ba9ccffb3ae9c16deab01e8efbd858a79a120e519bad409ba53c
\ No newline at end of file diff --git a/db/schema_migrations/20230918122440 b/db/schema_migrations/20230918122440 new file mode 100644 index 00000000000..b14853b530d --- /dev/null +++ b/db/schema_migrations/20230918122440 @@ -0,0 +1 @@ +9db2207a1a2a6240447d06d739da54e4ca13127860cc53a76ea19d9c2945667c
\ No newline at end of file diff --git a/db/schema_migrations/20230918122450 b/db/schema_migrations/20230918122450 new file mode 100644 index 00000000000..d922d6d0645 --- /dev/null +++ b/db/schema_migrations/20230918122450 @@ -0,0 +1 @@ +fbfdb13d18c011b1a1936cece6b9f7bab96add19b60e556bf922cb276076b0f4
\ No newline at end of file diff --git a/db/schema_migrations/20230918123357 b/db/schema_migrations/20230918123357 new file mode 100644 index 00000000000..5fc1d62a963 --- /dev/null +++ b/db/schema_migrations/20230918123357 @@ -0,0 +1 @@ +99e55170557dcda361f441d1333f4dc9d99133a469f1d17805478f3407d2a093
\ No newline at end of file diff --git a/db/schema_migrations/20230918143333 b/db/schema_migrations/20230918143333 new file mode 100644 index 00000000000..63dae73cc5d --- /dev/null +++ b/db/schema_migrations/20230918143333 @@ -0,0 +1 @@ +28ad98bd0151a3dac1b1495fd773ee8641ffd3c50df5f3e41ca5a0df58daa826
\ No newline at end of file diff --git a/db/schema_migrations/20230918145641 b/db/schema_migrations/20230918145641 new file mode 100644 index 00000000000..61753f36469 --- /dev/null +++ b/db/schema_migrations/20230918145641 @@ -0,0 +1 @@ +f20056555ebccab049b57176ada21e61dc63b30061321786c6ec946e8ac951ec
\ No newline at end of file diff --git a/db/schema_migrations/20230919123305 b/db/schema_migrations/20230919123305 new file mode 100644 index 00000000000..d497f91a90b --- /dev/null +++ b/db/schema_migrations/20230919123305 @@ -0,0 +1 @@ +6f95154ad6b0a9417935a203cb666aea99e06eef22f32c110e1f0e3914c87778
\ No newline at end of file diff --git a/db/schema_migrations/20230920122059 b/db/schema_migrations/20230920122059 new file mode 100644 index 00000000000..18b212c9e85 --- /dev/null +++ b/db/schema_migrations/20230920122059 @@ -0,0 +1 @@ +25c5f9c4d26da1f4007ea775890b6ac8146667c5afb71d56b4df00dd4fa42190
\ No newline at end of file diff --git a/db/schema_migrations/20230920153321 b/db/schema_migrations/20230920153321 new file mode 100644 index 00000000000..edce6fcce4c --- /dev/null +++ b/db/schema_migrations/20230920153321 @@ -0,0 +1 @@ +821bf9cd2c93d34323edc587949a70779acdcc3f7866d7165ef3ebec2127ea0a
\ No newline at end of file diff --git a/db/schema_migrations/20230920154302 b/db/schema_migrations/20230920154302 new file mode 100644 index 00000000000..b1822f5c223 --- /dev/null +++ b/db/schema_migrations/20230920154302 @@ -0,0 +1 @@ +2bf8eac787f1a8599d429abf01d859af9072993111bf56836e4ad9c4b5aa6b78
\ No newline at end of file diff --git a/db/schema_migrations/20230920162613 b/db/schema_migrations/20230920162613 new file mode 100644 index 00000000000..9fb10e9fe35 --- /dev/null +++ b/db/schema_migrations/20230920162613 @@ -0,0 +1 @@ +5547fc402692964dd08d384a5e31778ee6708fffd08b47cce48ca93b9c19e94b
\ No newline at end of file diff --git a/db/schema_migrations/20230921081527 b/db/schema_migrations/20230921081527 new file mode 100644 index 00000000000..7ce01f1f771 --- /dev/null +++ b/db/schema_migrations/20230921081527 @@ -0,0 +1 @@ +9cc0cc5ea170c56f03224e71771c6638f31bf57ede060de51f7cbe181349c373
\ No newline at end of file diff --git a/db/schema_migrations/20230921082223 b/db/schema_migrations/20230921082223 new file mode 100644 index 00000000000..374b18be56e --- /dev/null +++ b/db/schema_migrations/20230921082223 @@ -0,0 +1 @@ +84b7cbffd811799e4d065e5488180f4335575589d0510d6f2ce1afe1c0bf6806
\ No newline at end of file diff --git a/db/schema_migrations/20230922004506 b/db/schema_migrations/20230922004506 new file mode 100644 index 00000000000..266ff7f1562 --- /dev/null +++ b/db/schema_migrations/20230922004506 @@ -0,0 +1 @@ +f67f0a5aa43db625638dd0c2ab54c09586c182d54366dd780b250704e35ebb89
\ No newline at end of file diff --git a/db/schema_migrations/20230923094438 b/db/schema_migrations/20230923094438 new file mode 100644 index 00000000000..dbb1f1b60e2 --- /dev/null +++ b/db/schema_migrations/20230923094438 @@ -0,0 +1 @@ +19af567b51abfdb299cdf9a988c484cdb4faf13d666bcedeed465f38d2723f27
\ No newline at end of file diff --git a/db/schema_migrations/20230924095357 b/db/schema_migrations/20230924095357 new file mode 100644 index 00000000000..935e7db3ea5 --- /dev/null +++ b/db/schema_migrations/20230924095357 @@ -0,0 +1 @@ +c9422a60a6b5397191b8c6fdb01f006db530b3d78e5d1d4034ac64c21c90c0b4
\ No newline at end of file diff --git a/db/schema_migrations/20230924134453 b/db/schema_migrations/20230924134453 new file mode 100644 index 00000000000..d0e3dbe288e --- /dev/null +++ b/db/schema_migrations/20230924134453 @@ -0,0 +1 @@ +207d8827fcf5749f8cc5d717ee73b114810b7064f072818ec388ba897bb25501
\ No newline at end of file diff --git a/db/schema_migrations/20230924154419 b/db/schema_migrations/20230924154419 new file mode 100644 index 00000000000..7371e780e42 --- /dev/null +++ b/db/schema_migrations/20230924154419 @@ -0,0 +1 @@ +56c0eb18400723d64dcb74ebfe5ad6e5ff9121cadf82210387df051574ff17ca
\ No newline at end of file diff --git a/db/schema_migrations/20230925024201 b/db/schema_migrations/20230925024201 new file mode 100644 index 00000000000..8ff937935a4 --- /dev/null +++ b/db/schema_migrations/20230925024201 @@ -0,0 +1 @@ +b092d4d11d0bfc4a7d20328ed6184e247b94cebe74db9f55586a8cc5eb76616d
\ No newline at end of file diff --git a/db/schema_migrations/20230925062516 b/db/schema_migrations/20230925062516 new file mode 100644 index 00000000000..be7dc8fff8f --- /dev/null +++ b/db/schema_migrations/20230925062516 @@ -0,0 +1 @@ +4dd5bb35ea88e56abf67cd57f4f72567253d5b4ef4d8120a824f131330a704c5
\ No newline at end of file diff --git a/db/schema_migrations/20230925062800 b/db/schema_migrations/20230925062800 new file mode 100644 index 00000000000..ec509c7bcc9 --- /dev/null +++ b/db/schema_migrations/20230925062800 @@ -0,0 +1 @@ +39434ff2c7d637c0be820654e6b716251c3776331cb622d12c38a3a1670a1dea
\ No newline at end of file diff --git a/db/schema_migrations/20230925095300 b/db/schema_migrations/20230925095300 new file mode 100644 index 00000000000..1d5ab748fd2 --- /dev/null +++ b/db/schema_migrations/20230925095300 @@ -0,0 +1 @@ +6d06ad9d2eec4ab19e96650a652119289326ad190d63ec340484fb09a64ba1aa
\ No newline at end of file diff --git a/db/schema_migrations/20230925095357 b/db/schema_migrations/20230925095357 new file mode 100644 index 00000000000..679c471ed8a --- /dev/null +++ b/db/schema_migrations/20230925095357 @@ -0,0 +1 @@ +8ee432895b4acd47a202f3bc656aae0f248d8bad45d4ff77db0bf1268a054304
\ No newline at end of file diff --git a/db/schema_migrations/20230925170448 b/db/schema_migrations/20230925170448 new file mode 100644 index 00000000000..a65842ec98f --- /dev/null +++ b/db/schema_migrations/20230925170448 @@ -0,0 +1 @@ +1ff542021d0b5f73fadb6bc9237404a9bcbc4658ea31a629115955098cb704b1
\ No newline at end of file diff --git a/db/schema_migrations/20230926024201 b/db/schema_migrations/20230926024201 new file mode 100644 index 00000000000..7719c2d2f59 --- /dev/null +++ b/db/schema_migrations/20230926024201 @@ -0,0 +1 @@ +5d1f9f29f61306de9f57176e9649ff5f29cfb7f66a803295133ee896c1cc17e1
\ No newline at end of file diff --git a/db/schema_migrations/20230926040722 b/db/schema_migrations/20230926040722 new file mode 100644 index 00000000000..e19a8e2687d --- /dev/null +++ b/db/schema_migrations/20230926040722 @@ -0,0 +1 @@ +c02b87c00ca0816376f797ba0e34cc7e2fe90c974e564887990b854b169e643f
\ No newline at end of file diff --git a/db/schema_migrations/20230926040755 b/db/schema_migrations/20230926040755 new file mode 100644 index 00000000000..c94cdebc156 --- /dev/null +++ b/db/schema_migrations/20230926040755 @@ -0,0 +1 @@ +a313f2ef41f96323ef9ba3ab4d59ead109f111603ad12a08caf4cd17785f5a87
\ No newline at end of file diff --git a/db/schema_migrations/20230926105908 b/db/schema_migrations/20230926105908 new file mode 100644 index 00000000000..06c02d80af1 --- /dev/null +++ b/db/schema_migrations/20230926105908 @@ -0,0 +1 @@ +75449ee0b04c4f61ac85c1d3a67a20613b8cc789d29ad123a700d8fc5ead0b6b
\ No newline at end of file diff --git a/db/schema_migrations/20230926113518 b/db/schema_migrations/20230926113518 new file mode 100644 index 00000000000..b0647d7fee2 --- /dev/null +++ b/db/schema_migrations/20230926113518 @@ -0,0 +1 @@ +85f7fe2c86afa3cc7e087697f4ef6a0e2ef4f5f83d2c5153076d53df5d2c5cc6
\ No newline at end of file diff --git a/db/schema_migrations/20230926115744 b/db/schema_migrations/20230926115744 new file mode 100644 index 00000000000..7ad829f4fa4 --- /dev/null +++ b/db/schema_migrations/20230926115744 @@ -0,0 +1 @@ +9eb6fdc76dd93bb38f3ccafb4914cefd8345fef37aa71910f9ec7636c25e5644
\ No newline at end of file diff --git a/db/schema_migrations/20230926133801 b/db/schema_migrations/20230926133801 new file mode 100644 index 00000000000..e3bd09c774c --- /dev/null +++ b/db/schema_migrations/20230926133801 @@ -0,0 +1 @@ +03edad77c4b9ca8754a6365f42abe3e1ae139b934603085fd88d01c0a3e0acbc
\ No newline at end of file diff --git a/db/schema_migrations/20230926201357 b/db/schema_migrations/20230926201357 new file mode 100644 index 00000000000..a35839a0d3b --- /dev/null +++ b/db/schema_migrations/20230926201357 @@ -0,0 +1 @@ +f943882abcb48cdf9b8fb7ad98342f0973026d45b127afd033a2a71393600ba8
\ No newline at end of file diff --git a/db/schema_migrations/20230927045103 b/db/schema_migrations/20230927045103 new file mode 100644 index 00000000000..3b5c4a30a3d --- /dev/null +++ b/db/schema_migrations/20230927045103 @@ -0,0 +1 @@ +f11dee8807d0fe5b537cc1dbb59a4e146fe6186d6a2457d6862d3cb048920a06
\ No newline at end of file diff --git a/db/schema_migrations/20230927141237 b/db/schema_migrations/20230927141237 new file mode 100644 index 00000000000..c905082519f --- /dev/null +++ b/db/schema_migrations/20230927141237 @@ -0,0 +1 @@ +784254092483e02ffc317a3243721fbe99ecc2d0aa9d394903f5a21666442751
\ No newline at end of file diff --git a/db/schema_migrations/20230928024357 b/db/schema_migrations/20230928024357 new file mode 100644 index 00000000000..ef98266b602 --- /dev/null +++ b/db/schema_migrations/20230928024357 @@ -0,0 +1 @@ +230cf1f339827016f9382c97983e78646d01f53f1023cf0030fac35e5a94666f
\ No newline at end of file diff --git a/db/schema_migrations/20230928073320 b/db/schema_migrations/20230928073320 new file mode 100644 index 00000000000..59edbd77b0b --- /dev/null +++ b/db/schema_migrations/20230928073320 @@ -0,0 +1 @@ +9ba594408fd6afc617c451fbcb6852f89cfb9392427491b192e055f53937133e
\ No newline at end of file diff --git a/db/schema_migrations/20230928104015 b/db/schema_migrations/20230928104015 new file mode 100644 index 00000000000..0a5c76846bf --- /dev/null +++ b/db/schema_migrations/20230928104015 @@ -0,0 +1 @@ +f71caebfefb4b4fabbb3f9cc059f6f105ea352da11380901b16c687dcca1e6d4
\ No newline at end of file diff --git a/db/schema_migrations/20230929063124 b/db/schema_migrations/20230929063124 new file mode 100644 index 00000000000..fb15e34aa62 --- /dev/null +++ b/db/schema_migrations/20230929063124 @@ -0,0 +1 @@ +7793aafff32e777ad91843f6d5eb8f365b2d8bf6ea1d98f83096beda4831c32a
\ No newline at end of file diff --git a/db/schema_migrations/20230929063406 b/db/schema_migrations/20230929063406 new file mode 100644 index 00000000000..26f0499bebb --- /dev/null +++ b/db/schema_migrations/20230929063406 @@ -0,0 +1 @@ +212db29694b69887d300c66446cf6dd167e724df9004dc5a8a571bd9bc3bfbaf
\ No newline at end of file diff --git a/db/schema_migrations/20230929095008 b/db/schema_migrations/20230929095008 new file mode 100644 index 00000000000..b338d4fac88 --- /dev/null +++ b/db/schema_migrations/20230929095008 @@ -0,0 +1 @@ +5a2a50056391506370b40206543d54b0068948cfeb831ae0cd8ceb914ea30063
\ No newline at end of file diff --git a/db/schema_migrations/20230929095728 b/db/schema_migrations/20230929095728 new file mode 100644 index 00000000000..79e0cbd0f5f --- /dev/null +++ b/db/schema_migrations/20230929095728 @@ -0,0 +1 @@ +9698d7685e3dacdee9201adcf9d97390a705b85ba55e1f9c4ed29eb270927760
\ No newline at end of file diff --git a/db/schema_migrations/20230929151451 b/db/schema_migrations/20230929151451 new file mode 100644 index 00000000000..fbc9c908c91 --- /dev/null +++ b/db/schema_migrations/20230929151451 @@ -0,0 +1 @@ +414442e7daf9e23bb33c8471f30c6465bcef6a19051d609888f5bbf88bb5306e
\ No newline at end of file diff --git a/db/schema_migrations/20230930094139 b/db/schema_migrations/20230930094139 new file mode 100644 index 00000000000..d076adbb7f7 --- /dev/null +++ b/db/schema_migrations/20230930094139 @@ -0,0 +1 @@ +e5a56945b0f18c1014905534f6ac8cbd026582bb57b49368558435331f0746de
\ No newline at end of file diff --git a/db/schema_migrations/20231001105945 b/db/schema_migrations/20231001105945 new file mode 100644 index 00000000000..5c3a5d97b1a --- /dev/null +++ b/db/schema_migrations/20231001105945 @@ -0,0 +1 @@ +fd6f6d7843a99d91dfb022f85d7dea5a942af7d7240b0638edc453fe2fb7c2ca
\ No newline at end of file diff --git a/db/schema_migrations/20231002023318 b/db/schema_migrations/20231002023318 new file mode 100644 index 00000000000..1ecab7e4ff4 --- /dev/null +++ b/db/schema_migrations/20231002023318 @@ -0,0 +1 @@ +033f69a6c29f71532a86b08ce3e7b8008246be4a79b86745c6b4ddcdf15ea47e
\ No newline at end of file diff --git a/db/schema_migrations/20231003003241 b/db/schema_migrations/20231003003241 new file mode 100644 index 00000000000..38d61d1f71a --- /dev/null +++ b/db/schema_migrations/20231003003241 @@ -0,0 +1 @@ +8e09b2216c8d64273e5025a813ee74e64ce549754f2e2b5f1aaf2d12a9bf5c95
\ No newline at end of file diff --git a/db/schema_migrations/20231003034711 b/db/schema_migrations/20231003034711 new file mode 100644 index 00000000000..ed4bca49dc0 --- /dev/null +++ b/db/schema_migrations/20231003034711 @@ -0,0 +1 @@ +a26c4b66297f2232cd60276e19df65e4e61e920a5c353470e530f610c21b6f81
\ No newline at end of file diff --git a/db/schema_migrations/20231003073437 b/db/schema_migrations/20231003073437 new file mode 100644 index 00000000000..a697807de7a --- /dev/null +++ b/db/schema_migrations/20231003073437 @@ -0,0 +1 @@ +bbb659c1227d5be57555494b23b1c7539213a39804efe6f3b7d523ffb078037a
\ No newline at end of file diff --git a/db/schema_migrations/20231003073505 b/db/schema_migrations/20231003073505 new file mode 100644 index 00000000000..9270e68f65d --- /dev/null +++ b/db/schema_migrations/20231003073505 @@ -0,0 +1 @@ +2410ae279f02e74a8efb69784cc09d5c3884dec9781e99c07e19cf376be40ff1
\ No newline at end of file diff --git a/db/schema_migrations/20231003073526 b/db/schema_migrations/20231003073526 new file mode 100644 index 00000000000..84fb3fdd30c --- /dev/null +++ b/db/schema_migrations/20231003073526 @@ -0,0 +1 @@ +39c1c0e4ce1990809132b339eefa0e4ab2af6f71d2f01ce598cbff920062b6fe
\ No newline at end of file diff --git a/db/schema_migrations/20231003083900 b/db/schema_migrations/20231003083900 new file mode 100644 index 00000000000..20390cbb9f3 --- /dev/null +++ b/db/schema_migrations/20231003083900 @@ -0,0 +1 @@ +1c4c519d896e77fe5bbd7f6fb301e075fef28c11a27a16f4450db4b3e1963697
\ No newline at end of file diff --git a/db/schema_migrations/20231003142534 b/db/schema_migrations/20231003142534 new file mode 100644 index 00000000000..def601195c3 --- /dev/null +++ b/db/schema_migrations/20231003142534 @@ -0,0 +1 @@ +9b703e130a262e779bad9d37cb3b013f99b6b594c4088a0d3f1e985d709bd06f
\ No newline at end of file diff --git a/db/schema_migrations/20231003142706 b/db/schema_migrations/20231003142706 new file mode 100644 index 00000000000..bbcd1749e73 --- /dev/null +++ b/db/schema_migrations/20231003142706 @@ -0,0 +1 @@ +a6cba1a3ad438ff00d24fcb44440d765e48edbd16505eda7c6a52bbc7651311d
\ No newline at end of file diff --git a/db/schema_migrations/20231003145757 b/db/schema_migrations/20231003145757 new file mode 100644 index 00000000000..f8833247d21 --- /dev/null +++ b/db/schema_migrations/20231003145757 @@ -0,0 +1 @@ +83ac7ebe7eaf3f9a7166467efc7660ed5083f753f757e2477155308e8afd0793
\ No newline at end of file diff --git a/db/schema_migrations/20231004053341 b/db/schema_migrations/20231004053341 new file mode 100644 index 00000000000..7037a1eebbe --- /dev/null +++ b/db/schema_migrations/20231004053341 @@ -0,0 +1 @@ +752365c845420a51028efdbc247745543c7bef9633921da95151e3c9495a8044
\ No newline at end of file diff --git a/db/schema_migrations/20231004080224 b/db/schema_migrations/20231004080224 new file mode 100644 index 00000000000..b186861f472 --- /dev/null +++ b/db/schema_migrations/20231004080224 @@ -0,0 +1 @@ +2345c4c9f61815ae9fe206577b32d962ab26c52d4b5e68dd19d2e57a876a6d77
\ No newline at end of file diff --git a/db/schema_migrations/20231004091113 b/db/schema_migrations/20231004091113 new file mode 100644 index 00000000000..6c3719a7bb7 --- /dev/null +++ b/db/schema_migrations/20231004091113 @@ -0,0 +1 @@ +23142181f15811a721d110b77568656828f757c64b3d0f8c67db9edc8c1ff1c7
\ No newline at end of file diff --git a/db/schema_migrations/20231004100000 b/db/schema_migrations/20231004100000 new file mode 100644 index 00000000000..19e14253ed9 --- /dev/null +++ b/db/schema_migrations/20231004100000 @@ -0,0 +1 @@ +11730ae4a1acf49c31b7a35e67753b53d8ade1f1c99b937c4cb95e3804777e3c
\ No newline at end of file diff --git a/db/schema_migrations/20231004120426 b/db/schema_migrations/20231004120426 new file mode 100644 index 00000000000..b81d70e03a6 --- /dev/null +++ b/db/schema_migrations/20231004120426 @@ -0,0 +1 @@ +7d7349723ad38ef6615437d563b01aff39b6eb1c58ec29601e770330d0d5ada6
\ No newline at end of file diff --git a/db/schema_migrations/20231005131445 b/db/schema_migrations/20231005131445 new file mode 100644 index 00000000000..5bc8e37f952 --- /dev/null +++ b/db/schema_migrations/20231005131445 @@ -0,0 +1 @@ +564a5cf5e449653a4492cfc25a010d7fb4cf7d4bc30c2c414f7a667ae147e7aa
\ No newline at end of file diff --git a/db/schema_migrations/20231005145648 b/db/schema_migrations/20231005145648 new file mode 100644 index 00000000000..3905d84a4f6 --- /dev/null +++ b/db/schema_migrations/20231005145648 @@ -0,0 +1 @@ +6ee8141c3bd9c2245fd16258aaa0ef7377222e4a8d933d474b5709cd6bcd516e
\ No newline at end of file diff --git a/db/schema_migrations/20231006154748 b/db/schema_migrations/20231006154748 new file mode 100644 index 00000000000..9290317c02e --- /dev/null +++ b/db/schema_migrations/20231006154748 @@ -0,0 +1 @@ +a895a8c09a53cb12d738aec7e35bdd32d7f98fef69c35f9216f8341181ee8e02
\ No newline at end of file diff --git a/db/schema_migrations/20231009104202 b/db/schema_migrations/20231009104202 new file mode 100644 index 00000000000..1cd43922af5 --- /dev/null +++ b/db/schema_migrations/20231009104202 @@ -0,0 +1 @@ +e95a1d1e260aca83026b0ba379c520c21627416eee44ab9a1fb4959614541b0a
\ No newline at end of file diff --git a/db/schema_migrations/20231009104325 b/db/schema_migrations/20231009104325 new file mode 100644 index 00000000000..e6894d0389b --- /dev/null +++ b/db/schema_migrations/20231009104325 @@ -0,0 +1 @@ +e24acc9cc5bd2ce38f02f514d63acfd69f6b657edc4f1d404d179b14976d1650
\ No newline at end of file diff --git a/db/schema_migrations/20231009105056 b/db/schema_migrations/20231009105056 new file mode 100644 index 00000000000..500df111a3c --- /dev/null +++ b/db/schema_migrations/20231009105056 @@ -0,0 +1 @@ +38add95186d36d7c736eb6c14fe7bf1bfc63a565ca04767afcac077a973fcbb1
\ No newline at end of file diff --git a/db/schema_migrations/20231009115743 b/db/schema_migrations/20231009115743 new file mode 100644 index 00000000000..dc85020bf4a --- /dev/null +++ b/db/schema_migrations/20231009115743 @@ -0,0 +1 @@ +55747d0be3472797422175e666d95022b21a1c42b017c1a72de4c8bdcbdba6c4
\ No newline at end of file diff --git a/db/schema_migrations/20231010011850 b/db/schema_migrations/20231010011850 new file mode 100644 index 00000000000..96bac16e783 --- /dev/null +++ b/db/schema_migrations/20231010011850 @@ -0,0 +1 @@ +af80679c8056de2b61a7b9df62cd6fc589df36c3dcdfd0571526b29154e35227
\ No newline at end of file diff --git a/db/schema_migrations/20231010101246 b/db/schema_migrations/20231010101246 new file mode 100644 index 00000000000..1b7622c9bc6 --- /dev/null +++ b/db/schema_migrations/20231010101246 @@ -0,0 +1 @@ +67323d7c15c28b7784bb1021184df4efcc72a38e72e4113a945101c32212a934
\ No newline at end of file diff --git a/db/schema_migrations/20231011142714 b/db/schema_migrations/20231011142714 new file mode 100644 index 00000000000..ba2f77b1d4e --- /dev/null +++ b/db/schema_migrations/20231011142714 @@ -0,0 +1 @@ +c495f8e107e32d4f5f10c4240cbd027e1dfbb5551bff8a0f8c752d5099ef3e05
\ No newline at end of file diff --git a/db/schema_migrations/20231011150241 b/db/schema_migrations/20231011150241 new file mode 100644 index 00000000000..f6fad411bf9 --- /dev/null +++ b/db/schema_migrations/20231011150241 @@ -0,0 +1 @@ +92e1c02f769e19e0a0eb6a5e23d2ae54cb02d4d1e1d6d2532dca736ae3d97cee
\ No newline at end of file diff --git a/db/schema_migrations/20231011200058 b/db/schema_migrations/20231011200058 new file mode 100644 index 00000000000..fbd04ba6342 --- /dev/null +++ b/db/schema_migrations/20231011200058 @@ -0,0 +1 @@ +0437aade771694981f1eca79c1bd8fed0857f1f10f1a616684fab3c906bd20b7
\ No newline at end of file diff --git a/db/schema_migrations/20231011232010 b/db/schema_migrations/20231011232010 new file mode 100644 index 00000000000..c960631e672 --- /dev/null +++ b/db/schema_migrations/20231011232010 @@ -0,0 +1 @@ +6a4a1e3c427fa7e525c8f6550eb26c66a323a9cda9ea5aab1b5984b292d4a172
\ No newline at end of file diff --git a/db/schema_migrations/20231012161226 b/db/schema_migrations/20231012161226 new file mode 100644 index 00000000000..95d1897823e --- /dev/null +++ b/db/schema_migrations/20231012161226 @@ -0,0 +1 @@ +c53d5ebf3c9e7732b44e58ed1fc0dac2362b88a5863cd66c95c2cb8227fdc0bd
\ No newline at end of file diff --git a/db/schema_migrations/20231012180342 b/db/schema_migrations/20231012180342 new file mode 100644 index 00000000000..c11a7e718aa --- /dev/null +++ b/db/schema_migrations/20231012180342 @@ -0,0 +1 @@ +a878340725435e55164967b459e190e1ade925baedac2000c904a101ad927ea9
\ No newline at end of file diff --git a/db/schema_migrations/20231013031159 b/db/schema_migrations/20231013031159 new file mode 100644 index 00000000000..73dd318c029 --- /dev/null +++ b/db/schema_migrations/20231013031159 @@ -0,0 +1 @@ +5b54d885aa74c238f6f543e5760b48fab216fcca44a556344a133a34f0c69cba
\ No newline at end of file diff --git a/db/schema_migrations/20231013135216 b/db/schema_migrations/20231013135216 new file mode 100644 index 00000000000..6d7bc82f432 --- /dev/null +++ b/db/schema_migrations/20231013135216 @@ -0,0 +1 @@ +2526de2653f981f7e9e06589b00d0ef063c5d82b80938eb92491366dc6390ee5
\ No newline at end of file diff --git a/db/schema_migrations/20231013174138 b/db/schema_migrations/20231013174138 new file mode 100644 index 00000000000..0ce3e8e16d6 --- /dev/null +++ b/db/schema_migrations/20231013174138 @@ -0,0 +1 @@ +3f948fc69b42bc11c67ad9b9eff71e08e397582e79cdf9c6469147ec56017f5f
\ No newline at end of file diff --git a/db/schema_migrations/20231013181758 b/db/schema_migrations/20231013181758 new file mode 100644 index 00000000000..f33825bca5e --- /dev/null +++ b/db/schema_migrations/20231013181758 @@ -0,0 +1 @@ +df947a6c033aaf3212743fc9e9d1b82c84d055618f211553422fbdbf839a41a6
\ No newline at end of file diff --git a/db/schema_migrations/20231014081832 b/db/schema_migrations/20231014081832 new file mode 100644 index 00000000000..f018ce0f09b --- /dev/null +++ b/db/schema_migrations/20231014081832 @@ -0,0 +1 @@ +6d696ed942f88109936ae18ca87a5a9e91703e3c353972f21a0c228edeb4ffa2
\ No newline at end of file diff --git a/db/schema_migrations/20231015111533 b/db/schema_migrations/20231015111533 new file mode 100644 index 00000000000..fd249195e63 --- /dev/null +++ b/db/schema_migrations/20231015111533 @@ -0,0 +1 @@ +d4fd2e43046da8892341767256fd7d5d1480dc57ce77699937243d04060985d4
\ No newline at end of file diff --git a/db/schema_migrations/20231015225919 b/db/schema_migrations/20231015225919 new file mode 100644 index 00000000000..9bd05b9d7df --- /dev/null +++ b/db/schema_migrations/20231015225919 @@ -0,0 +1 @@ +3cd23fe20ec6c5ab7b98b35a5f6d393979c1881d7ef42a7f4bd062db0171bec3
\ No newline at end of file diff --git a/db/schema_migrations/20231015230919 b/db/schema_migrations/20231015230919 new file mode 100644 index 00000000000..6e0ce386ae4 --- /dev/null +++ b/db/schema_migrations/20231015230919 @@ -0,0 +1 @@ +d529c8f8a64426b708cf175ee97a2908d85b5c3a6404e5a579994f3f000e9d2b
\ No newline at end of file diff --git a/db/schema_migrations/20231015231919 b/db/schema_migrations/20231015231919 new file mode 100644 index 00000000000..0eda877e703 --- /dev/null +++ b/db/schema_migrations/20231015231919 @@ -0,0 +1 @@ +289e8527ee8986350994b4a0097b55232c46cbc52a76918a636615f4cfb61541
\ No newline at end of file diff --git a/db/schema_migrations/20231015232919 b/db/schema_migrations/20231015232919 new file mode 100644 index 00000000000..94915a1414b --- /dev/null +++ b/db/schema_migrations/20231015232919 @@ -0,0 +1 @@ +37b2dc0863c344eb099183ac6012e3d3a965fc3211e88bc3d09e6ea49ae347dd
\ No newline at end of file diff --git a/db/schema_migrations/20231015233919 b/db/schema_migrations/20231015233919 new file mode 100644 index 00000000000..3288438cadb --- /dev/null +++ b/db/schema_migrations/20231015233919 @@ -0,0 +1 @@ +18da30a225d477df0f8c3317308b076cb2d43326f9740a516b57f68f6851f757
\ No newline at end of file diff --git a/db/schema_migrations/20231015234919 b/db/schema_migrations/20231015234919 new file mode 100644 index 00000000000..2054d1e3948 --- /dev/null +++ b/db/schema_migrations/20231015234919 @@ -0,0 +1 @@ +285964fe818b347995a2c9bdc9d444b948fad99008657288f8ef05dcfe2d1277
\ No newline at end of file diff --git a/db/schema_migrations/20231015235919 b/db/schema_migrations/20231015235919 new file mode 100644 index 00000000000..221dd934dba --- /dev/null +++ b/db/schema_migrations/20231015235919 @@ -0,0 +1 @@ +784925e2c826975925b1eccd22ef4deff3af85caf52aaec9b71a9b44bb4125ae
\ No newline at end of file diff --git a/db/schema_migrations/20231016000919 b/db/schema_migrations/20231016000919 new file mode 100644 index 00000000000..2368f6cbd4c --- /dev/null +++ b/db/schema_migrations/20231016000919 @@ -0,0 +1 @@ +169fecc0f790e7a4765b0985b3e43e864f7f01a556e761fa30279940a37dd48c
\ No newline at end of file diff --git a/db/schema_migrations/20231016001919 b/db/schema_migrations/20231016001919 new file mode 100644 index 00000000000..408807d7a44 --- /dev/null +++ b/db/schema_migrations/20231016001919 @@ -0,0 +1 @@ +f84c337bc2befb1adfa6503db4adb4def52ad21a7f54afdbb17f0101de29bca7
\ No newline at end of file diff --git a/db/schema_migrations/20231016002919 b/db/schema_migrations/20231016002919 new file mode 100644 index 00000000000..07347e8a482 --- /dev/null +++ b/db/schema_migrations/20231016002919 @@ -0,0 +1 @@ +044d1d9c92b1e919a46db38134e1c451a0d0f44f6ae8a5e6be9bb85fac75bae4
\ No newline at end of file diff --git a/db/schema_migrations/20231016003919 b/db/schema_migrations/20231016003919 new file mode 100644 index 00000000000..1affa939a1c --- /dev/null +++ b/db/schema_migrations/20231016003919 @@ -0,0 +1 @@ +97f73e53981498655ba7bf73a22b0d3ee2287c9e3aae598644a31a334e7d3706
\ No newline at end of file diff --git a/db/schema_migrations/20231016004919 b/db/schema_migrations/20231016004919 new file mode 100644 index 00000000000..9b413b5d212 --- /dev/null +++ b/db/schema_migrations/20231016004919 @@ -0,0 +1 @@ +ef0489e703573dd89523a5d0789b2e27b4d5a0224549ef585371f787278c578e
\ No newline at end of file diff --git a/db/schema_migrations/20231016005919 b/db/schema_migrations/20231016005919 new file mode 100644 index 00000000000..3c2341316e5 --- /dev/null +++ b/db/schema_migrations/20231016005919 @@ -0,0 +1 @@ +eb163a8ef9ab96364ebdb91d86a3fb27df2623cbb26e68e0e8de2ff675360f1f
\ No newline at end of file diff --git a/db/schema_migrations/20231016010919 b/db/schema_migrations/20231016010919 new file mode 100644 index 00000000000..fee9b0e672a --- /dev/null +++ b/db/schema_migrations/20231016010919 @@ -0,0 +1 @@ +06fadb1cdfcca7e7674f49933e13ffa2c2277f3f17d854459bb515e2f4685a6c
\ No newline at end of file diff --git a/db/schema_migrations/20231016011919 b/db/schema_migrations/20231016011919 new file mode 100644 index 00000000000..6dc926d5119 --- /dev/null +++ b/db/schema_migrations/20231016011919 @@ -0,0 +1 @@ +d8e42e7e8e25373a3c59d638bfd23d8397fa7ae9983b3239bfe862b37ed20912
\ No newline at end of file diff --git a/db/schema_migrations/20231016100238 b/db/schema_migrations/20231016100238 new file mode 100644 index 00000000000..cee29420251 --- /dev/null +++ b/db/schema_migrations/20231016100238 @@ -0,0 +1 @@ +653dd02dc2f2ad7728707135e9b45a76517db539ed1345919fe64e9bcabfbc7b
\ No newline at end of file diff --git a/db/schema_migrations/20231016101611 b/db/schema_migrations/20231016101611 new file mode 100644 index 00000000000..9ced5a965ad --- /dev/null +++ b/db/schema_migrations/20231016101611 @@ -0,0 +1 @@ +dfacd6a83c47d80d2b43aca4d76b7282f0a5c938fb19687af6221d0080ac0335
\ No newline at end of file diff --git a/db/schema_migrations/20231017055853 b/db/schema_migrations/20231017055853 new file mode 100644 index 00000000000..b4db25f37e2 --- /dev/null +++ b/db/schema_migrations/20231017055853 @@ -0,0 +1 @@ +803630d8612e6fc9a161fa547fce7a96e762904864c90c3deadcedb0f7864dd3
\ No newline at end of file diff --git a/db/schema_migrations/20231017060037 b/db/schema_migrations/20231017060037 new file mode 100644 index 00000000000..85e5d9d2776 --- /dev/null +++ b/db/schema_migrations/20231017060037 @@ -0,0 +1 @@ +a751114d7c212114dbf42d9209a36c8933cb1eadacb65c996e81c2d8bcfadc23
\ No newline at end of file diff --git a/db/schema_migrations/20231017064317 b/db/schema_migrations/20231017064317 new file mode 100644 index 00000000000..ab9a39d7939 --- /dev/null +++ b/db/schema_migrations/20231017064317 @@ -0,0 +1 @@ +1cda91e874cd6e0eb26f641ba00fce8afa7236f3008192711b4479e3ee7bb91b
\ No newline at end of file diff --git a/db/schema_migrations/20231017114131 b/db/schema_migrations/20231017114131 new file mode 100644 index 00000000000..330c7f6a1f0 --- /dev/null +++ b/db/schema_migrations/20231017114131 @@ -0,0 +1 @@ +1fce14747e839554b9bc165430f6d513acd316b4d48eddf0c7fc13015c93133f
\ No newline at end of file diff --git a/db/schema_migrations/20231017172156 b/db/schema_migrations/20231017172156 new file mode 100644 index 00000000000..4eebcb58734 --- /dev/null +++ b/db/schema_migrations/20231017172156 @@ -0,0 +1 @@ +e0c5245e0a7ce9daa5ffb609fb1d9f5b19f438320924d989011fcccc31b2594e
\ No newline at end of file diff --git a/db/schema_migrations/20231017184446 b/db/schema_migrations/20231017184446 new file mode 100644 index 00000000000..e224414d9e4 --- /dev/null +++ b/db/schema_migrations/20231017184446 @@ -0,0 +1 @@ +97f1fd832024c3622f87a77bc67b3a08b1d1686d6ea35fabcbec17204cedb9a0
\ No newline at end of file diff --git a/db/schema_migrations/20231018100907 b/db/schema_migrations/20231018100907 new file mode 100644 index 00000000000..b83d601cb68 --- /dev/null +++ b/db/schema_migrations/20231018100907 @@ -0,0 +1 @@ +66176906b640cd7226c81618e9deb26b51800f07e2ecc1192d72dea3273108c4
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index 9283a0c4800..d7d5d469d9e 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -298,15 +298,6 @@ BEGIN END; $$; -CREATE FUNCTION trigger_1a857e8db6cd() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."uuid_convert_string_to_uuid" := NEW."uuid"; - RETURN NEW; -END; -$$; - CREATE FUNCTION trigger_1bd97da9c1a4() RETURNS trigger LANGUAGE plpgsql AS $$ @@ -646,6 +637,14 @@ CREATE TABLE p_batched_git_ref_updates_deletions ( ) PARTITION BY LIST (partition_id); +CREATE TABLE p_ci_finished_build_ch_sync_events ( + build_id bigint NOT NULL, + partition bigint DEFAULT 1 NOT NULL, + build_finished_at timestamp without time zone NOT NULL, + processed boolean DEFAULT false NOT NULL +) +PARTITION BY LIST (partition); + CREATE TABLE projects_visits ( id bigint NOT NULL, entity_id bigint NOT NULL, @@ -720,7 +719,9 @@ CREATE TABLE analytics_cycle_analytics_issue_stage_events ( author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ) PARTITION BY HASH (stage_event_hash_id); @@ -733,9 +734,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 FOR VALUES WITH (modulus 32, remainder 0); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 ( stage_event_hash_id bigint NOT NULL, @@ -746,9 +748,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 FOR VALUES WITH (modulus 32, remainder 1); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 ( stage_event_hash_id bigint NOT NULL, @@ -759,9 +762,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 FOR VALUES WITH (modulus 32, remainder 2); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 ( stage_event_hash_id bigint NOT NULL, @@ -772,9 +776,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 FOR VALUES WITH (modulus 32, remainder 3); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 ( stage_event_hash_id bigint NOT NULL, @@ -785,9 +790,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 FOR VALUES WITH (modulus 32, remainder 4); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 ( stage_event_hash_id bigint NOT NULL, @@ -798,9 +804,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 FOR VALUES WITH (modulus 32, remainder 5); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 ( stage_event_hash_id bigint NOT NULL, @@ -811,9 +818,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 FOR VALUES WITH (modulus 32, remainder 6); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 ( stage_event_hash_id bigint NOT NULL, @@ -824,9 +832,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 FOR VALUES WITH (modulus 32, remainder 7); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 ( stage_event_hash_id bigint NOT NULL, @@ -837,9 +846,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 FOR VALUES WITH (modulus 32, remainder 8); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 ( stage_event_hash_id bigint NOT NULL, @@ -850,9 +860,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 FOR VALUES WITH (modulus 32, remainder 9); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 ( stage_event_hash_id bigint NOT NULL, @@ -863,9 +874,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 FOR VALUES WITH (modulus 32, remainder 10); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 ( stage_event_hash_id bigint NOT NULL, @@ -876,9 +888,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 FOR VALUES WITH (modulus 32, remainder 11); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 ( stage_event_hash_id bigint NOT NULL, @@ -889,9 +902,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 FOR VALUES WITH (modulus 32, remainder 12); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 ( stage_event_hash_id bigint NOT NULL, @@ -902,9 +916,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 FOR VALUES WITH (modulus 32, remainder 13); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 ( stage_event_hash_id bigint NOT NULL, @@ -915,9 +930,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 FOR VALUES WITH (modulus 32, remainder 14); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 ( stage_event_hash_id bigint NOT NULL, @@ -928,9 +944,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 FOR VALUES WITH (modulus 32, remainder 15); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 ( stage_event_hash_id bigint NOT NULL, @@ -941,9 +958,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 FOR VALUES WITH (modulus 32, remainder 16); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 ( stage_event_hash_id bigint NOT NULL, @@ -954,9 +972,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 FOR VALUES WITH (modulus 32, remainder 17); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 ( stage_event_hash_id bigint NOT NULL, @@ -967,9 +986,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 FOR VALUES WITH (modulus 32, remainder 18); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 ( stage_event_hash_id bigint NOT NULL, @@ -980,9 +1000,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 FOR VALUES WITH (modulus 32, remainder 19); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 ( stage_event_hash_id bigint NOT NULL, @@ -993,9 +1014,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 FOR VALUES WITH (modulus 32, remainder 20); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 ( stage_event_hash_id bigint NOT NULL, @@ -1006,9 +1028,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 FOR VALUES WITH (modulus 32, remainder 21); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 ( stage_event_hash_id bigint NOT NULL, @@ -1019,9 +1042,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 FOR VALUES WITH (modulus 32, remainder 22); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 ( stage_event_hash_id bigint NOT NULL, @@ -1032,9 +1056,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 FOR VALUES WITH (modulus 32, remainder 23); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 ( stage_event_hash_id bigint NOT NULL, @@ -1045,9 +1070,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 FOR VALUES WITH (modulus 32, remainder 24); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 ( stage_event_hash_id bigint NOT NULL, @@ -1058,9 +1084,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 FOR VALUES WITH (modulus 32, remainder 25); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 ( stage_event_hash_id bigint NOT NULL, @@ -1071,9 +1098,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 FOR VALUES WITH (modulus 32, remainder 26); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 ( stage_event_hash_id bigint NOT NULL, @@ -1084,9 +1112,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 FOR VALUES WITH (modulus 32, remainder 27); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 ( stage_event_hash_id bigint NOT NULL, @@ -1097,9 +1126,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 FOR VALUES WITH (modulus 32, remainder 28); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 ( stage_event_hash_id bigint NOT NULL, @@ -1110,9 +1140,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 FOR VALUES WITH (modulus 32, remainder 29); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 ( stage_event_hash_id bigint NOT NULL, @@ -1123,9 +1154,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 FOR VALUES WITH (modulus 32, remainder 30); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 ( stage_event_hash_id bigint NOT NULL, @@ -1136,9 +1168,10 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_issue_stage_even author_id bigint, start_event_timestamp timestamp with time zone NOT NULL, end_event_timestamp timestamp with time zone, - state_id smallint DEFAULT 1 NOT NULL + state_id smallint DEFAULT 1 NOT NULL, + weight integer, + sprint_id bigint ); -ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 FOR VALUES WITH (modulus 32, remainder 31); CREATE TABLE analytics_cycle_analytics_merge_request_stage_events ( stage_event_hash_id bigint NOT NULL, @@ -1164,7 +1197,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 FOR VALUES WITH (modulus 32, remainder 0); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 ( stage_event_hash_id bigint NOT NULL, @@ -1177,7 +1209,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 FOR VALUES WITH (modulus 32, remainder 1); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 ( stage_event_hash_id bigint NOT NULL, @@ -1190,7 +1221,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 FOR VALUES WITH (modulus 32, remainder 2); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 ( stage_event_hash_id bigint NOT NULL, @@ -1203,7 +1233,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 FOR VALUES WITH (modulus 32, remainder 3); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 ( stage_event_hash_id bigint NOT NULL, @@ -1216,7 +1245,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 FOR VALUES WITH (modulus 32, remainder 4); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 ( stage_event_hash_id bigint NOT NULL, @@ -1229,7 +1257,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 FOR VALUES WITH (modulus 32, remainder 5); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 ( stage_event_hash_id bigint NOT NULL, @@ -1242,7 +1269,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 FOR VALUES WITH (modulus 32, remainder 6); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 ( stage_event_hash_id bigint NOT NULL, @@ -1255,7 +1281,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 FOR VALUES WITH (modulus 32, remainder 7); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 ( stage_event_hash_id bigint NOT NULL, @@ -1268,7 +1293,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 FOR VALUES WITH (modulus 32, remainder 8); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 ( stage_event_hash_id bigint NOT NULL, @@ -1281,7 +1305,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 FOR VALUES WITH (modulus 32, remainder 9); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 ( stage_event_hash_id bigint NOT NULL, @@ -1294,7 +1317,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 FOR VALUES WITH (modulus 32, remainder 10); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 ( stage_event_hash_id bigint NOT NULL, @@ -1307,7 +1329,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 FOR VALUES WITH (modulus 32, remainder 11); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 ( stage_event_hash_id bigint NOT NULL, @@ -1320,7 +1341,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 FOR VALUES WITH (modulus 32, remainder 12); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 ( stage_event_hash_id bigint NOT NULL, @@ -1333,7 +1353,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 FOR VALUES WITH (modulus 32, remainder 13); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 ( stage_event_hash_id bigint NOT NULL, @@ -1346,7 +1365,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 FOR VALUES WITH (modulus 32, remainder 14); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 ( stage_event_hash_id bigint NOT NULL, @@ -1359,7 +1377,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 FOR VALUES WITH (modulus 32, remainder 15); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 ( stage_event_hash_id bigint NOT NULL, @@ -1372,7 +1389,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 FOR VALUES WITH (modulus 32, remainder 16); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 ( stage_event_hash_id bigint NOT NULL, @@ -1385,7 +1401,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 FOR VALUES WITH (modulus 32, remainder 17); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 ( stage_event_hash_id bigint NOT NULL, @@ -1398,7 +1413,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 FOR VALUES WITH (modulus 32, remainder 18); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 ( stage_event_hash_id bigint NOT NULL, @@ -1411,7 +1425,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 FOR VALUES WITH (modulus 32, remainder 19); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 ( stage_event_hash_id bigint NOT NULL, @@ -1424,7 +1437,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 FOR VALUES WITH (modulus 32, remainder 20); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 ( stage_event_hash_id bigint NOT NULL, @@ -1437,7 +1449,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 FOR VALUES WITH (modulus 32, remainder 21); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 ( stage_event_hash_id bigint NOT NULL, @@ -1450,7 +1461,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 FOR VALUES WITH (modulus 32, remainder 22); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 ( stage_event_hash_id bigint NOT NULL, @@ -1463,7 +1473,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 FOR VALUES WITH (modulus 32, remainder 23); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 ( stage_event_hash_id bigint NOT NULL, @@ -1476,7 +1485,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 FOR VALUES WITH (modulus 32, remainder 24); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 ( stage_event_hash_id bigint NOT NULL, @@ -1489,7 +1497,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 FOR VALUES WITH (modulus 32, remainder 25); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 ( stage_event_hash_id bigint NOT NULL, @@ -1502,7 +1509,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 FOR VALUES WITH (modulus 32, remainder 26); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 ( stage_event_hash_id bigint NOT NULL, @@ -1515,7 +1521,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 FOR VALUES WITH (modulus 32, remainder 27); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 ( stage_event_hash_id bigint NOT NULL, @@ -1528,7 +1533,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 FOR VALUES WITH (modulus 32, remainder 28); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 ( stage_event_hash_id bigint NOT NULL, @@ -1541,7 +1545,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 FOR VALUES WITH (modulus 32, remainder 29); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 ( stage_event_hash_id bigint NOT NULL, @@ -1554,7 +1557,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 FOR VALUES WITH (modulus 32, remainder 30); CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 ( stage_event_hash_id bigint NOT NULL, @@ -1567,7 +1569,6 @@ CREATE TABLE gitlab_partitions_static.analytics_cycle_analytics_merge_request_st end_event_timestamp timestamp with time zone, state_id smallint DEFAULT 1 NOT NULL ); -ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 FOR VALUES WITH (modulus 32, remainder 31); CREATE TABLE issue_search_data ( project_id bigint NOT NULL, @@ -1587,7 +1588,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_00 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_00 FOR VALUES WITH (modulus 64, remainder 0); CREATE TABLE gitlab_partitions_static.issue_search_data_01 ( project_id bigint NOT NULL, @@ -1597,7 +1597,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_01 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_01 FOR VALUES WITH (modulus 64, remainder 1); CREATE TABLE gitlab_partitions_static.issue_search_data_02 ( project_id bigint NOT NULL, @@ -1607,7 +1606,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_02 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_02 FOR VALUES WITH (modulus 64, remainder 2); CREATE TABLE gitlab_partitions_static.issue_search_data_03 ( project_id bigint NOT NULL, @@ -1617,7 +1615,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_03 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_03 FOR VALUES WITH (modulus 64, remainder 3); CREATE TABLE gitlab_partitions_static.issue_search_data_04 ( project_id bigint NOT NULL, @@ -1627,7 +1624,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_04 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_04 FOR VALUES WITH (modulus 64, remainder 4); CREATE TABLE gitlab_partitions_static.issue_search_data_05 ( project_id bigint NOT NULL, @@ -1637,7 +1633,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_05 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_05 FOR VALUES WITH (modulus 64, remainder 5); CREATE TABLE gitlab_partitions_static.issue_search_data_06 ( project_id bigint NOT NULL, @@ -1647,7 +1642,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_06 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_06 FOR VALUES WITH (modulus 64, remainder 6); CREATE TABLE gitlab_partitions_static.issue_search_data_07 ( project_id bigint NOT NULL, @@ -1657,7 +1651,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_07 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_07 FOR VALUES WITH (modulus 64, remainder 7); CREATE TABLE gitlab_partitions_static.issue_search_data_08 ( project_id bigint NOT NULL, @@ -1667,7 +1660,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_08 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_08 FOR VALUES WITH (modulus 64, remainder 8); CREATE TABLE gitlab_partitions_static.issue_search_data_09 ( project_id bigint NOT NULL, @@ -1677,7 +1669,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_09 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_09 FOR VALUES WITH (modulus 64, remainder 9); CREATE TABLE gitlab_partitions_static.issue_search_data_10 ( project_id bigint NOT NULL, @@ -1687,7 +1678,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_10 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_10 FOR VALUES WITH (modulus 64, remainder 10); CREATE TABLE gitlab_partitions_static.issue_search_data_11 ( project_id bigint NOT NULL, @@ -1697,7 +1687,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_11 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_11 FOR VALUES WITH (modulus 64, remainder 11); CREATE TABLE gitlab_partitions_static.issue_search_data_12 ( project_id bigint NOT NULL, @@ -1707,7 +1696,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_12 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_12 FOR VALUES WITH (modulus 64, remainder 12); CREATE TABLE gitlab_partitions_static.issue_search_data_13 ( project_id bigint NOT NULL, @@ -1717,7 +1705,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_13 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_13 FOR VALUES WITH (modulus 64, remainder 13); CREATE TABLE gitlab_partitions_static.issue_search_data_14 ( project_id bigint NOT NULL, @@ -1727,7 +1714,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_14 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_14 FOR VALUES WITH (modulus 64, remainder 14); CREATE TABLE gitlab_partitions_static.issue_search_data_15 ( project_id bigint NOT NULL, @@ -1737,7 +1723,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_15 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_15 FOR VALUES WITH (modulus 64, remainder 15); CREATE TABLE gitlab_partitions_static.issue_search_data_16 ( project_id bigint NOT NULL, @@ -1747,7 +1732,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_16 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_16 FOR VALUES WITH (modulus 64, remainder 16); CREATE TABLE gitlab_partitions_static.issue_search_data_17 ( project_id bigint NOT NULL, @@ -1757,7 +1741,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_17 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_17 FOR VALUES WITH (modulus 64, remainder 17); CREATE TABLE gitlab_partitions_static.issue_search_data_18 ( project_id bigint NOT NULL, @@ -1767,7 +1750,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_18 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_18 FOR VALUES WITH (modulus 64, remainder 18); CREATE TABLE gitlab_partitions_static.issue_search_data_19 ( project_id bigint NOT NULL, @@ -1777,7 +1759,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_19 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_19 FOR VALUES WITH (modulus 64, remainder 19); CREATE TABLE gitlab_partitions_static.issue_search_data_20 ( project_id bigint NOT NULL, @@ -1787,7 +1768,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_20 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_20 FOR VALUES WITH (modulus 64, remainder 20); CREATE TABLE gitlab_partitions_static.issue_search_data_21 ( project_id bigint NOT NULL, @@ -1797,7 +1777,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_21 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_21 FOR VALUES WITH (modulus 64, remainder 21); CREATE TABLE gitlab_partitions_static.issue_search_data_22 ( project_id bigint NOT NULL, @@ -1807,7 +1786,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_22 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_22 FOR VALUES WITH (modulus 64, remainder 22); CREATE TABLE gitlab_partitions_static.issue_search_data_23 ( project_id bigint NOT NULL, @@ -1817,7 +1795,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_23 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_23 FOR VALUES WITH (modulus 64, remainder 23); CREATE TABLE gitlab_partitions_static.issue_search_data_24 ( project_id bigint NOT NULL, @@ -1827,7 +1804,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_24 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_24 FOR VALUES WITH (modulus 64, remainder 24); CREATE TABLE gitlab_partitions_static.issue_search_data_25 ( project_id bigint NOT NULL, @@ -1837,7 +1813,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_25 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_25 FOR VALUES WITH (modulus 64, remainder 25); CREATE TABLE gitlab_partitions_static.issue_search_data_26 ( project_id bigint NOT NULL, @@ -1847,7 +1822,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_26 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_26 FOR VALUES WITH (modulus 64, remainder 26); CREATE TABLE gitlab_partitions_static.issue_search_data_27 ( project_id bigint NOT NULL, @@ -1857,7 +1831,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_27 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_27 FOR VALUES WITH (modulus 64, remainder 27); CREATE TABLE gitlab_partitions_static.issue_search_data_28 ( project_id bigint NOT NULL, @@ -1867,7 +1840,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_28 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_28 FOR VALUES WITH (modulus 64, remainder 28); CREATE TABLE gitlab_partitions_static.issue_search_data_29 ( project_id bigint NOT NULL, @@ -1877,7 +1849,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_29 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_29 FOR VALUES WITH (modulus 64, remainder 29); CREATE TABLE gitlab_partitions_static.issue_search_data_30 ( project_id bigint NOT NULL, @@ -1887,7 +1858,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_30 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_30 FOR VALUES WITH (modulus 64, remainder 30); CREATE TABLE gitlab_partitions_static.issue_search_data_31 ( project_id bigint NOT NULL, @@ -1897,7 +1867,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_31 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_31 FOR VALUES WITH (modulus 64, remainder 31); CREATE TABLE gitlab_partitions_static.issue_search_data_32 ( project_id bigint NOT NULL, @@ -1907,7 +1876,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_32 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_32 FOR VALUES WITH (modulus 64, remainder 32); CREATE TABLE gitlab_partitions_static.issue_search_data_33 ( project_id bigint NOT NULL, @@ -1917,7 +1885,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_33 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_33 FOR VALUES WITH (modulus 64, remainder 33); CREATE TABLE gitlab_partitions_static.issue_search_data_34 ( project_id bigint NOT NULL, @@ -1927,7 +1894,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_34 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_34 FOR VALUES WITH (modulus 64, remainder 34); CREATE TABLE gitlab_partitions_static.issue_search_data_35 ( project_id bigint NOT NULL, @@ -1937,7 +1903,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_35 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_35 FOR VALUES WITH (modulus 64, remainder 35); CREATE TABLE gitlab_partitions_static.issue_search_data_36 ( project_id bigint NOT NULL, @@ -1947,7 +1912,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_36 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_36 FOR VALUES WITH (modulus 64, remainder 36); CREATE TABLE gitlab_partitions_static.issue_search_data_37 ( project_id bigint NOT NULL, @@ -1957,7 +1921,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_37 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_37 FOR VALUES WITH (modulus 64, remainder 37); CREATE TABLE gitlab_partitions_static.issue_search_data_38 ( project_id bigint NOT NULL, @@ -1967,7 +1930,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_38 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_38 FOR VALUES WITH (modulus 64, remainder 38); CREATE TABLE gitlab_partitions_static.issue_search_data_39 ( project_id bigint NOT NULL, @@ -1977,7 +1939,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_39 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_39 FOR VALUES WITH (modulus 64, remainder 39); CREATE TABLE gitlab_partitions_static.issue_search_data_40 ( project_id bigint NOT NULL, @@ -1987,7 +1948,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_40 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_40 FOR VALUES WITH (modulus 64, remainder 40); CREATE TABLE gitlab_partitions_static.issue_search_data_41 ( project_id bigint NOT NULL, @@ -1997,7 +1957,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_41 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_41 FOR VALUES WITH (modulus 64, remainder 41); CREATE TABLE gitlab_partitions_static.issue_search_data_42 ( project_id bigint NOT NULL, @@ -2007,7 +1966,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_42 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_42 FOR VALUES WITH (modulus 64, remainder 42); CREATE TABLE gitlab_partitions_static.issue_search_data_43 ( project_id bigint NOT NULL, @@ -2017,7 +1975,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_43 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_43 FOR VALUES WITH (modulus 64, remainder 43); CREATE TABLE gitlab_partitions_static.issue_search_data_44 ( project_id bigint NOT NULL, @@ -2027,7 +1984,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_44 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_44 FOR VALUES WITH (modulus 64, remainder 44); CREATE TABLE gitlab_partitions_static.issue_search_data_45 ( project_id bigint NOT NULL, @@ -2037,7 +1993,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_45 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_45 FOR VALUES WITH (modulus 64, remainder 45); CREATE TABLE gitlab_partitions_static.issue_search_data_46 ( project_id bigint NOT NULL, @@ -2047,7 +2002,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_46 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_46 FOR VALUES WITH (modulus 64, remainder 46); CREATE TABLE gitlab_partitions_static.issue_search_data_47 ( project_id bigint NOT NULL, @@ -2057,7 +2011,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_47 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_47 FOR VALUES WITH (modulus 64, remainder 47); CREATE TABLE gitlab_partitions_static.issue_search_data_48 ( project_id bigint NOT NULL, @@ -2067,7 +2020,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_48 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_48 FOR VALUES WITH (modulus 64, remainder 48); CREATE TABLE gitlab_partitions_static.issue_search_data_49 ( project_id bigint NOT NULL, @@ -2077,7 +2029,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_49 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_49 FOR VALUES WITH (modulus 64, remainder 49); CREATE TABLE gitlab_partitions_static.issue_search_data_50 ( project_id bigint NOT NULL, @@ -2087,7 +2038,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_50 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_50 FOR VALUES WITH (modulus 64, remainder 50); CREATE TABLE gitlab_partitions_static.issue_search_data_51 ( project_id bigint NOT NULL, @@ -2097,7 +2047,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_51 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_51 FOR VALUES WITH (modulus 64, remainder 51); CREATE TABLE gitlab_partitions_static.issue_search_data_52 ( project_id bigint NOT NULL, @@ -2107,7 +2056,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_52 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_52 FOR VALUES WITH (modulus 64, remainder 52); CREATE TABLE gitlab_partitions_static.issue_search_data_53 ( project_id bigint NOT NULL, @@ -2117,7 +2065,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_53 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_53 FOR VALUES WITH (modulus 64, remainder 53); CREATE TABLE gitlab_partitions_static.issue_search_data_54 ( project_id bigint NOT NULL, @@ -2127,7 +2074,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_54 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_54 FOR VALUES WITH (modulus 64, remainder 54); CREATE TABLE gitlab_partitions_static.issue_search_data_55 ( project_id bigint NOT NULL, @@ -2137,7 +2083,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_55 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_55 FOR VALUES WITH (modulus 64, remainder 55); CREATE TABLE gitlab_partitions_static.issue_search_data_56 ( project_id bigint NOT NULL, @@ -2147,7 +2092,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_56 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_56 FOR VALUES WITH (modulus 64, remainder 56); CREATE TABLE gitlab_partitions_static.issue_search_data_57 ( project_id bigint NOT NULL, @@ -2157,7 +2101,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_57 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_57 FOR VALUES WITH (modulus 64, remainder 57); CREATE TABLE gitlab_partitions_static.issue_search_data_58 ( project_id bigint NOT NULL, @@ -2167,7 +2110,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_58 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_58 FOR VALUES WITH (modulus 64, remainder 58); CREATE TABLE gitlab_partitions_static.issue_search_data_59 ( project_id bigint NOT NULL, @@ -2177,7 +2119,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_59 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_59 FOR VALUES WITH (modulus 64, remainder 59); CREATE TABLE gitlab_partitions_static.issue_search_data_60 ( project_id bigint NOT NULL, @@ -2187,7 +2128,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_60 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_60 FOR VALUES WITH (modulus 64, remainder 60); CREATE TABLE gitlab_partitions_static.issue_search_data_61 ( project_id bigint NOT NULL, @@ -2197,7 +2137,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_61 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_61 FOR VALUES WITH (modulus 64, remainder 61); CREATE TABLE gitlab_partitions_static.issue_search_data_62 ( project_id bigint NOT NULL, @@ -2207,7 +2146,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_62 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_62 FOR VALUES WITH (modulus 64, remainder 62); CREATE TABLE gitlab_partitions_static.issue_search_data_63 ( project_id bigint NOT NULL, @@ -2217,7 +2155,6 @@ CREATE TABLE gitlab_partitions_static.issue_search_data_63 ( search_vector tsvector, namespace_id bigint ); -ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_63 FOR VALUES WITH (modulus 64, remainder 63); CREATE TABLE product_analytics_events_experimental ( id bigint NOT NULL, @@ -2492,7 +2429,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_00 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_00 FOR VALUES WITH (modulus 64, remainder 0); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_01 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -2625,7 +2561,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_01 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_01 FOR VALUES WITH (modulus 64, remainder 1); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_02 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -2758,7 +2693,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_02 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_02 FOR VALUES WITH (modulus 64, remainder 2); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_03 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -2891,7 +2825,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_03 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_03 FOR VALUES WITH (modulus 64, remainder 3); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_04 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -3024,7 +2957,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_04 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_04 FOR VALUES WITH (modulus 64, remainder 4); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_05 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -3157,7 +3089,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_05 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_05 FOR VALUES WITH (modulus 64, remainder 5); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_06 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -3290,7 +3221,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_06 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_06 FOR VALUES WITH (modulus 64, remainder 6); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_07 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -3423,7 +3353,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_07 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_07 FOR VALUES WITH (modulus 64, remainder 7); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_08 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -3556,7 +3485,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_08 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_08 FOR VALUES WITH (modulus 64, remainder 8); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_09 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -3689,7 +3617,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_09 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_09 FOR VALUES WITH (modulus 64, remainder 9); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_10 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -3822,7 +3749,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_10 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_10 FOR VALUES WITH (modulus 64, remainder 10); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_11 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -3955,7 +3881,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_11 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_11 FOR VALUES WITH (modulus 64, remainder 11); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_12 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -4088,7 +4013,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_12 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_12 FOR VALUES WITH (modulus 64, remainder 12); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_13 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -4221,7 +4145,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_13 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_13 FOR VALUES WITH (modulus 64, remainder 13); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_14 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -4354,7 +4277,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_14 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_14 FOR VALUES WITH (modulus 64, remainder 14); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_15 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -4487,7 +4409,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_15 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_15 FOR VALUES WITH (modulus 64, remainder 15); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_16 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -4620,7 +4541,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_16 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_16 FOR VALUES WITH (modulus 64, remainder 16); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_17 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -4753,7 +4673,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_17 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_17 FOR VALUES WITH (modulus 64, remainder 17); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_18 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -4886,7 +4805,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_18 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_18 FOR VALUES WITH (modulus 64, remainder 18); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_19 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -5019,7 +4937,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_19 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_19 FOR VALUES WITH (modulus 64, remainder 19); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_20 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -5152,7 +5069,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_20 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_20 FOR VALUES WITH (modulus 64, remainder 20); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_21 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -5285,7 +5201,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_21 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_21 FOR VALUES WITH (modulus 64, remainder 21); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_22 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -5418,7 +5333,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_22 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_22 FOR VALUES WITH (modulus 64, remainder 22); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_23 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -5551,7 +5465,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_23 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_23 FOR VALUES WITH (modulus 64, remainder 23); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_24 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -5684,7 +5597,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_24 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_24 FOR VALUES WITH (modulus 64, remainder 24); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_25 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -5817,7 +5729,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_25 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_25 FOR VALUES WITH (modulus 64, remainder 25); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_26 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -5950,7 +5861,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_26 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_26 FOR VALUES WITH (modulus 64, remainder 26); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_27 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -6083,7 +5993,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_27 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_27 FOR VALUES WITH (modulus 64, remainder 27); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_28 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -6216,7 +6125,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_28 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_28 FOR VALUES WITH (modulus 64, remainder 28); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_29 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -6349,7 +6257,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_29 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_29 FOR VALUES WITH (modulus 64, remainder 29); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_30 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -6482,7 +6389,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_30 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_30 FOR VALUES WITH (modulus 64, remainder 30); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_31 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -6615,7 +6521,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_31 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_31 FOR VALUES WITH (modulus 64, remainder 31); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_32 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -6748,7 +6653,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_32 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_32 FOR VALUES WITH (modulus 64, remainder 32); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_33 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -6881,7 +6785,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_33 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_33 FOR VALUES WITH (modulus 64, remainder 33); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_34 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -7014,7 +6917,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_34 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_34 FOR VALUES WITH (modulus 64, remainder 34); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_35 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -7147,7 +7049,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_35 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_35 FOR VALUES WITH (modulus 64, remainder 35); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_36 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -7280,7 +7181,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_36 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_36 FOR VALUES WITH (modulus 64, remainder 36); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_37 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -7413,7 +7313,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_37 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_37 FOR VALUES WITH (modulus 64, remainder 37); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_38 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -7546,7 +7445,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_38 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_38 FOR VALUES WITH (modulus 64, remainder 38); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_39 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -7679,7 +7577,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_39 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_39 FOR VALUES WITH (modulus 64, remainder 39); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_40 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -7812,7 +7709,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_40 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_40 FOR VALUES WITH (modulus 64, remainder 40); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_41 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -7945,7 +7841,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_41 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_41 FOR VALUES WITH (modulus 64, remainder 41); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_42 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -8078,7 +7973,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_42 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_42 FOR VALUES WITH (modulus 64, remainder 42); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_43 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -8211,7 +8105,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_43 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_43 FOR VALUES WITH (modulus 64, remainder 43); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_44 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -8344,7 +8237,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_44 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_44 FOR VALUES WITH (modulus 64, remainder 44); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_45 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -8477,7 +8369,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_45 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_45 FOR VALUES WITH (modulus 64, remainder 45); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_46 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -8610,7 +8501,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_46 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_46 FOR VALUES WITH (modulus 64, remainder 46); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_47 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -8743,7 +8633,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_47 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_47 FOR VALUES WITH (modulus 64, remainder 47); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_48 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -8876,7 +8765,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_48 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_48 FOR VALUES WITH (modulus 64, remainder 48); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_49 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -9009,7 +8897,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_49 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_49 FOR VALUES WITH (modulus 64, remainder 49); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_50 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -9142,7 +9029,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_50 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_50 FOR VALUES WITH (modulus 64, remainder 50); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_51 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -9275,7 +9161,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_51 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_51 FOR VALUES WITH (modulus 64, remainder 51); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_52 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -9408,7 +9293,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_52 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_52 FOR VALUES WITH (modulus 64, remainder 52); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_53 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -9541,7 +9425,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_53 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_53 FOR VALUES WITH (modulus 64, remainder 53); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_54 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -9674,7 +9557,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_54 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_54 FOR VALUES WITH (modulus 64, remainder 54); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_55 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -9807,7 +9689,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_55 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_55 FOR VALUES WITH (modulus 64, remainder 55); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_56 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -9940,7 +9821,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_56 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_56 FOR VALUES WITH (modulus 64, remainder 56); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_57 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -10073,7 +9953,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_57 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_57 FOR VALUES WITH (modulus 64, remainder 57); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_58 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -10206,7 +10085,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_58 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_58 FOR VALUES WITH (modulus 64, remainder 58); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_59 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -10339,7 +10217,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_59 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_59 FOR VALUES WITH (modulus 64, remainder 59); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_60 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -10472,7 +10349,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_60 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_60 FOR VALUES WITH (modulus 64, remainder 60); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_61 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -10605,7 +10481,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_61 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_61 FOR VALUES WITH (modulus 64, remainder 61); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_62 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -10738,7 +10613,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_62 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_62 FOR VALUES WITH (modulus 64, remainder 62); CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_63 ( id bigint DEFAULT nextval('product_analytics_events_experimental_id_seq'::regclass) NOT NULL, @@ -10871,7 +10745,6 @@ CREATE TABLE gitlab_partitions_static.product_analytics_events_experimental_63 ( event_fingerprint character varying(128), true_tstamp timestamp with time zone ); -ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_63 FOR VALUES WITH (modulus 64, remainder 63); CREATE TABLE abuse_events ( id bigint NOT NULL, @@ -10913,6 +10786,24 @@ CREATE SEQUENCE abuse_report_events_id_seq ALTER SEQUENCE abuse_report_events_id_seq OWNED BY abuse_report_events.id; +CREATE TABLE abuse_report_user_mentions ( + id bigint NOT NULL, + abuse_report_id bigint NOT NULL, + note_id bigint NOT NULL, + mentioned_users_ids bigint[], + mentioned_projects_ids bigint[], + mentioned_groups_ids bigint[] +); + +CREATE SEQUENCE abuse_report_user_mentions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE abuse_report_user_mentions_id_seq OWNED BY abuse_report_user_mentions.id; + CREATE TABLE abuse_reports ( id integer NOT NULL, reporter_id integer, @@ -11306,6 +11197,12 @@ CREATE SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq ALTER SEQUENCE analytics_cycle_analytics_stage_event_hashes_id_seq OWNED BY analytics_cycle_analytics_stage_event_hashes.id; +CREATE TABLE analytics_cycle_analytics_value_stream_settings ( + value_stream_id bigint NOT NULL, + project_ids_filter bigint[] DEFAULT '{}'::bigint[], + CONSTRAINT project_ids_filter_array_check CHECK (((cardinality(project_ids_filter) <= 100) AND (array_position(project_ids_filter, NULL::bigint) IS NULL))) +); + CREATE TABLE analytics_dashboards_pointers ( id bigint NOT NULL, namespace_id bigint, @@ -11888,11 +11785,6 @@ CREATE TABLE application_settings ( cube_api_base_url text, encrypted_cube_api_key bytea, encrypted_cube_api_key_iv bytea, - jitsu_host text, - jitsu_project_xid text, - jitsu_administrator_email text, - encrypted_jitsu_administrator_password bytea, - encrypted_jitsu_administrator_password_iv bytea, dashboard_limit_enabled boolean DEFAULT false NOT NULL, dashboard_limit integer DEFAULT 0 NOT NULL, can_create_group boolean DEFAULT true NOT NULL, @@ -11919,8 +11811,6 @@ CREATE TABLE application_settings ( user_defaults_to_private_profile boolean DEFAULT false NOT NULL, allow_possible_spam boolean DEFAULT false NOT NULL, default_syntax_highlighting_theme integer DEFAULT 1 NOT NULL, - encrypted_product_analytics_clickhouse_connection_string bytea, - encrypted_product_analytics_clickhouse_connection_string_iv bytea, search_max_shard_size_gb integer DEFAULT 50 NOT NULL, search_max_docs_denominator integer DEFAULT 5000000 NOT NULL, search_min_docs_before_rollover integer DEFAULT 100000 NOT NULL, @@ -11965,12 +11855,11 @@ CREATE TABLE application_settings ( 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, + protected_paths_for_get_request text[] DEFAULT '{}'::text[] NOT NULL, namespace_storage_forks_cost_factor double precision DEFAULT 1.0 NOT NULL, package_registry_allow_anyone_to_pull_option boolean DEFAULT true NOT NULL, bulk_import_max_download_file_size bigint DEFAULT 5120 NOT NULL, max_import_remote_file_size bigint DEFAULT 10240 NOT NULL, - protected_paths_for_get_request text[] DEFAULT '{}'::text[] NOT NULL, max_decompressed_archive_size integer DEFAULT 25600 NOT NULL, sentry_clientside_traces_sample_rate double precision DEFAULT 0.0 NOT NULL, prometheus_alert_db_indicators_settings jsonb, @@ -11978,13 +11867,22 @@ CREATE TABLE application_settings ( decompress_archive_file_timeout integer DEFAULT 210 NOT NULL, search_rate_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL, snowplow_database_collector_hostname text, + container_registry_db_enabled boolean DEFAULT false NOT NULL, + failed_login_attempts_unlock_period_in_minutes integer, + max_login_attempts integer, + encrypted_vertex_ai_access_token bytea, + encrypted_vertex_ai_access_token_iv bytea, + project_jobs_api_rate_limit integer DEFAULT 600 NOT NULL, + math_rendering_limits_enabled boolean DEFAULT true 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)), CONSTRAINT app_settings_ext_pipeline_validation_service_url_text_limit CHECK ((char_length(external_pipeline_validation_service_url) <= 255)), + CONSTRAINT app_settings_failed_login_attempts_unlock_period_positive CHECK ((failed_login_attempts_unlock_period_in_minutes > 0)), CONSTRAINT app_settings_git_rate_limit_users_alertlist_max_usernames CHECK ((cardinality(git_rate_limit_users_alertlist) <= 100)), CONSTRAINT app_settings_git_rate_limit_users_allowlist_max_usernames CHECK ((cardinality(git_rate_limit_users_allowlist) <= 100)), CONSTRAINT app_settings_max_decompressed_archive_size_positive CHECK ((max_decompressed_archive_size >= 0)), + CONSTRAINT app_settings_max_login_attempts_positive CHECK ((max_login_attempts > 0)), CONSTRAINT app_settings_max_pages_custom_domains_per_project_check CHECK ((max_pages_custom_domains_per_project >= 0)), CONSTRAINT app_settings_max_terraform_state_size_bytes_check CHECK ((max_terraform_state_size_bytes >= 0)), CONSTRAINT app_settings_p_cleanup_package_file_worker_capacity_positive CHECK ((packages_cleanup_package_file_worker_capacity >= 0)), @@ -12029,15 +11927,12 @@ CREATE TABLE application_settings ( 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)), - CONSTRAINT check_dea8792229 CHECK ((char_length(jitsu_host) <= 255)), CONSTRAINT check_e2692d7523 CHECK ((char_length(default_preferred_language) <= 32)), CONSTRAINT check_e2dd6e290a CHECK ((char_length(jira_connect_application_key) <= 255)), CONSTRAINT check_e5024c8801 CHECK ((char_length(elasticsearch_username) <= 255)), CONSTRAINT check_e5aba18f02 CHECK ((char_length(container_registry_version) <= 255)), - CONSTRAINT check_ec3ca9aa8d CHECK ((char_length(jitsu_administrator_email) <= 255)), CONSTRAINT check_ef6176834f CHECK ((char_length(encrypted_cloud_license_auth_token_iv) <= 255)), - CONSTRAINT check_f6563bc000 CHECK ((char_length(arkose_labs_verify_api_url) <= 255)), - CONSTRAINT check_fc732c181e CHECK ((char_length(jitsu_project_xid) <= 255)) + CONSTRAINT check_f6563bc000 CHECK ((char_length(arkose_labs_verify_api_url) <= 255)) ); COMMENT ON COLUMN application_settings.content_validation_endpoint_url IS 'JiHu-specific column'; @@ -12124,6 +12019,7 @@ CREATE TABLE approval_merge_request_rules ( vulnerability_states text[] DEFAULT '{newly_detected}'::text[] NOT NULL, security_orchestration_policy_configuration_id bigint, scan_result_policy_id bigint, + applicable_post_merge boolean, CONSTRAINT check_6fca5928b2 CHECK ((char_length(section) <= 255)) ); @@ -12693,9 +12589,11 @@ CREATE TABLE batched_background_migrations ( on_hold_until timestamp with time zone, gitlab_schema text NOT NULL, finished_at timestamp with time zone, + queued_migration_version text, CONSTRAINT check_0406d9776f CHECK ((char_length(gitlab_schema) <= 255)), CONSTRAINT check_5bb0382d6f CHECK ((char_length(column_name) <= 63)), CONSTRAINT check_6b6a06254a CHECK ((char_length(table_name) <= 63)), + CONSTRAINT check_713f147aea CHECK ((char_length(queued_migration_version) <= 14)), CONSTRAINT check_batch_size_in_range CHECK ((batch_size >= sub_batch_size)), CONSTRAINT check_e6c75b1e29 CHECK ((char_length(job_class_name) <= 100)), CONSTRAINT check_fe10674721 CHECK ((char_length(batch_class_name) <= 100)), @@ -13240,7 +13138,8 @@ CREATE TABLE catalog_resources ( id bigint NOT NULL, project_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, - state smallint DEFAULT 0 NOT NULL + state smallint DEFAULT 0 NOT NULL, + latest_released_at timestamp with time zone ); CREATE SEQUENCE catalog_resources_id_seq @@ -13413,6 +13312,7 @@ CREATE TABLE p_ci_builds ( id bigint NOT NULL, stage_id bigint, partition_id bigint NOT NULL, + auto_canceled_by_partition_id bigint DEFAULT 100 NOT NULL, CONSTRAINT check_1e2fbd1b39 CHECK ((lock_version IS NOT NULL)) ) PARTITION BY LIST (partition_id); @@ -13462,9 +13362,9 @@ CREATE TABLE ci_builds ( id bigint NOT NULL, stage_id bigint, partition_id bigint NOT NULL, + auto_canceled_by_partition_id bigint DEFAULT 100 NOT NULL, CONSTRAINT check_1e2fbd1b39 CHECK ((lock_version IS NOT NULL)) ); -ALTER TABLE ONLY p_ci_builds ATTACH PARTITION ci_builds FOR VALUES IN ('100'); CREATE SEQUENCE ci_builds_id_seq START WITH 1 @@ -13522,7 +13422,6 @@ CREATE TABLE ci_builds_metadata ( partition_id bigint NOT NULL, debug_trace_enabled boolean DEFAULT false NOT NULL ); -ALTER TABLE ONLY p_ci_builds_metadata ATTACH PARTITION ci_builds_metadata FOR VALUES IN ('100'); CREATE TABLE ci_builds_runner_session ( id bigint NOT NULL, @@ -13805,10 +13704,10 @@ CREATE TABLE ci_namespace_monthly_usages ( namespace_id bigint NOT NULL, date date NOT NULL, notification_level smallint DEFAULT 100 NOT NULL, - shared_runners_duration integer DEFAULT 0 NOT NULL, + shared_runners_duration_convert_to_bigint integer DEFAULT 0 NOT NULL, created_at timestamp with time zone, amount_used numeric(18,4) DEFAULT 0.0 NOT NULL, - shared_runners_duration_convert_to_bigint bigint DEFAULT 0 NOT NULL, + shared_runners_duration bigint DEFAULT 0 NOT NULL, CONSTRAINT ci_namespace_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone))) ); @@ -13895,10 +13794,10 @@ ALTER SEQUENCE ci_pipeline_artifacts_id_seq OWNED BY ci_pipeline_artifacts.id; CREATE TABLE ci_pipeline_chat_data ( id bigint NOT NULL, - pipeline_id integer NOT NULL, + pipeline_id_convert_to_bigint integer DEFAULT 0 NOT NULL, chat_name_id integer NOT NULL, response_url text NOT NULL, - pipeline_id_convert_to_bigint bigint DEFAULT 0 NOT NULL + pipeline_id bigint NOT NULL ); CREATE SEQUENCE ci_pipeline_chat_data_id_seq @@ -13913,9 +13812,9 @@ ALTER SEQUENCE ci_pipeline_chat_data_id_seq OWNED BY ci_pipeline_chat_data.id; CREATE TABLE ci_pipeline_messages ( id bigint NOT NULL, severity smallint DEFAULT 0 NOT NULL, - pipeline_id integer NOT NULL, + pipeline_id_convert_to_bigint integer DEFAULT 0 NOT NULL, content text NOT NULL, - pipeline_id_convert_to_bigint bigint DEFAULT 0 NOT NULL, + pipeline_id bigint NOT NULL, CONSTRAINT check_58ca2981b2 CHECK ((char_length(content) <= 10000)) ); @@ -13988,12 +13887,12 @@ CREATE TABLE ci_pipeline_variables ( encrypted_value text, encrypted_value_salt character varying, encrypted_value_iv character varying, - pipeline_id integer NOT NULL, + pipeline_id_convert_to_bigint integer DEFAULT 0 NOT NULL, variable_type smallint DEFAULT 1 NOT NULL, partition_id bigint NOT NULL, raw boolean DEFAULT false NOT NULL, id bigint NOT NULL, - pipeline_id_convert_to_bigint bigint DEFAULT 0 NOT NULL + pipeline_id bigint NOT NULL ); CREATE SEQUENCE ci_pipeline_variables_id_seq @@ -14092,10 +13991,10 @@ CREATE TABLE ci_project_monthly_usages ( id bigint NOT NULL, project_id bigint NOT NULL, date date NOT NULL, - shared_runners_duration integer DEFAULT 0 NOT NULL, + shared_runners_duration_convert_to_bigint integer DEFAULT 0 NOT NULL, created_at timestamp with time zone, amount_used numeric(18,4) DEFAULT 0.0 NOT NULL, - shared_runners_duration_convert_to_bigint bigint DEFAULT 0 NOT NULL, + shared_runners_duration bigint DEFAULT 0 NOT NULL, CONSTRAINT ci_project_monthly_usages_year_month_constraint CHECK ((date = date_trunc('month'::text, (date)::timestamp with time zone))) ); @@ -14341,14 +14240,14 @@ ALTER SEQUENCE ci_secure_files_id_seq OWNED BY ci_secure_files.id; CREATE TABLE ci_sources_pipelines ( id integer NOT NULL, project_id integer, - pipeline_id integer, + pipeline_id_convert_to_bigint integer, source_project_id integer, - source_pipeline_id integer, + source_pipeline_id_convert_to_bigint integer, source_job_id bigint, partition_id bigint NOT NULL, source_partition_id bigint NOT NULL, - pipeline_id_convert_to_bigint bigint, - source_pipeline_id_convert_to_bigint bigint + pipeline_id bigint, + source_pipeline_id bigint ); CREATE SEQUENCE ci_sources_pipelines_id_seq @@ -14821,6 +14720,26 @@ CREATE TABLE container_registry_data_repair_details ( status smallint DEFAULT 0 NOT NULL ); +CREATE TABLE container_registry_protection_rules ( + id bigint NOT NULL, + project_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + delete_protected_up_to_access_level smallint NOT NULL, + push_protected_up_to_access_level smallint NOT NULL, + container_path_pattern text NOT NULL, + CONSTRAINT check_96811ef9dc CHECK ((char_length(container_path_pattern) <= 255)) +); + +CREATE SEQUENCE container_registry_protection_rules_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE container_registry_protection_rules_id_seq OWNED BY container_registry_protection_rules.id; + CREATE TABLE container_repositories ( id integer NOT NULL, project_id integer NOT NULL, @@ -16517,7 +16436,9 @@ CREATE TABLE geo_node_statuses ( lfs_objects_count integer, lfs_objects_synced_count integer, lfs_objects_failed_count integer, + last_event_id bigint, last_event_date timestamp without time zone, + cursor_last_event_id bigint, cursor_last_event_date timestamp without time zone, created_at timestamp without time zone NOT NULL, updated_at timestamp without time zone NOT NULL, @@ -16526,8 +16447,6 @@ CREATE TABLE geo_node_statuses ( replication_slots_count integer, replication_slots_used_count integer, replication_slots_max_retained_wal_bytes bigint, - wikis_synced_count integer, - wikis_failed_count integer, job_artifacts_count integer, job_artifacts_synced_count integer, job_artifacts_failed_count integer, @@ -16535,31 +16454,19 @@ CREATE TABLE geo_node_statuses ( revision character varying, repositories_verified_count integer, repositories_verification_failed_count integer, - wikis_verified_count integer, - wikis_verification_failed_count integer, lfs_objects_synced_missing_on_primary_count integer, job_artifacts_synced_missing_on_primary_count integer, repositories_checksummed_count integer, repositories_checksum_failed_count integer, repositories_checksum_mismatch_count integer, - wikis_checksummed_count integer, - wikis_checksum_failed_count integer, - wikis_checksum_mismatch_count integer, storage_configuration_digest bytea, repositories_retrying_verification_count integer, - wikis_retrying_verification_count integer, projects_count integer, container_repositories_count integer, container_repositories_synced_count integer, container_repositories_failed_count integer, container_repositories_registry_count integer, - design_repositories_count integer, - design_repositories_synced_count integer, - design_repositories_failed_count integer, - design_repositories_registry_count integer, - status jsonb DEFAULT '{}'::jsonb NOT NULL, - last_event_id bigint, - cursor_last_event_id bigint + status jsonb DEFAULT '{}'::jsonb NOT NULL ); CREATE SEQUENCE geo_node_statuses_id_seq @@ -18257,6 +18164,8 @@ CREATE TABLE member_roles ( name text DEFAULT 'Custom'::text NOT NULL, description text, admin_merge_request boolean DEFAULT false NOT NULL, + admin_group_member boolean DEFAULT false NOT NULL, + manage_project_access_tokens boolean DEFAULT false NOT NULL, CONSTRAINT check_4364846f58 CHECK ((char_length(description) <= 255)), CONSTRAINT check_9907916995 CHECK ((char_length(name) <= 255)) ); @@ -18270,24 +18179,6 @@ CREATE SEQUENCE member_roles_id_seq ALTER SEQUENCE member_roles_id_seq OWNED BY member_roles.id; -CREATE TABLE member_tasks ( - id bigint NOT NULL, - member_id bigint NOT NULL, - project_id bigint NOT NULL, - created_at timestamp with time zone NOT NULL, - updated_at timestamp with time zone NOT NULL, - tasks smallint[] DEFAULT '{}'::smallint[] NOT NULL -); - -CREATE SEQUENCE member_tasks_id_seq - START WITH 1 - INCREMENT BY 1 - NO MINVALUE - NO MAXVALUE - CACHE 1; - -ALTER SEQUENCE member_tasks_id_seq OWNED BY member_tasks.id; - CREATE TABLE members ( id integer NOT NULL, access_level integer NOT NULL, @@ -20329,10 +20220,12 @@ CREATE TABLE packages_protection_rules ( project_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - push_protected_up_to_access_level integer NOT NULL, + push_protected_up_to_access_level smallint NOT NULL, package_type smallint NOT NULL, package_name_pattern text NOT NULL, - CONSTRAINT check_d2d75d206d CHECK ((char_length(package_name_pattern) <= 255)) + package_name_pattern_ilike_query text NOT NULL, + CONSTRAINT check_d2d75d206d CHECK ((char_length(package_name_pattern) <= 255)), + CONSTRAINT check_ff47b09794 CHECK ((char_length(package_name_pattern_ilike_query) <= 255)) ); CREATE SEQUENCE packages_protection_rules_id_seq @@ -21814,14 +21707,7 @@ CREATE TABLE project_settings ( pages_unique_domain text, runner_registration_enabled boolean DEFAULT true, product_analytics_instrumentation_key text, - jitsu_host text, - jitsu_project_xid text, - jitsu_administrator_email text, - encrypted_jitsu_administrator_password bytea, - encrypted_jitsu_administrator_password_iv bytea, product_analytics_data_collector_host text, - encrypted_product_analytics_clickhouse_connection_string bytea, - encrypted_product_analytics_clickhouse_connection_string_iv bytea, cube_api_base_url text, encrypted_cube_api_key bytea, encrypted_cube_api_key_iv bytea, @@ -21837,10 +21723,7 @@ CREATE TABLE project_settings ( CONSTRAINT check_acb7fad2f9 CHECK ((char_length(product_analytics_instrumentation_key) <= 255)), CONSTRAINT check_b09644994b CHECK ((char_length(squash_commit_template) <= 500)), CONSTRAINT check_bde223416c CHECK ((show_default_award_emojis IS NOT NULL)), - CONSTRAINT check_ea15225016 CHECK ((char_length(jitsu_project_xid) <= 255)), CONSTRAINT check_eaf7cfb6a7 CHECK ((char_length(merge_commit_template) <= 500)), - CONSTRAINT check_f4499c0fa4 CHECK ((char_length(jitsu_host) <= 255)), - CONSTRAINT check_f5495015f5 CHECK ((char_length(jitsu_administrator_email) <= 255)), CONSTRAINT check_f9df7bcee2 CHECK ((char_length(cube_api_base_url) <= 512)) ); @@ -22757,8 +22640,7 @@ 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, - relay_state_domain_allowlist text[] DEFAULT '{}'::text[] NOT NULL + git_check_enforced boolean DEFAULT false NOT NULL ); CREATE SEQUENCE saml_providers_id_seq @@ -22842,6 +22724,7 @@ CREATE TABLE sbom_occurrences ( component_name text, input_file_path text, licenses jsonb DEFAULT '[]'::jsonb, + vulnerabilities jsonb DEFAULT '[]'::jsonb, CONSTRAINT check_3f2d2c7ffc CHECK ((char_length(package_manager) <= 255)), CONSTRAINT check_9b29021fa8 CHECK ((char_length(component_name) <= 255)), CONSTRAINT check_bd1367d4c1 CHECK ((char_length(input_file_path) <= 255)) @@ -22903,6 +22786,24 @@ CREATE SEQUENCE scan_result_policies_id_seq ALTER SEQUENCE scan_result_policies_id_seq OWNED BY scan_result_policies.id; +CREATE TABLE scan_result_policy_violations ( + id bigint NOT NULL, + scan_result_policy_id bigint NOT NULL, + merge_request_id bigint NOT NULL, + project_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE scan_result_policy_violations_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE scan_result_policy_violations_id_seq OWNED BY scan_result_policy_violations.id; + CREATE TABLE schema_migrations ( version character varying NOT NULL, finished_at timestamp with time zone DEFAULT now() @@ -23221,6 +23122,7 @@ CREATE TABLE service_desk_settings ( encrypted_custom_email_smtp_password bytea, encrypted_custom_email_smtp_password_iv bytea, service_desk_enabled boolean DEFAULT true NOT NULL, + add_external_participants_from_cc boolean DEFAULT false NOT NULL, CONSTRAINT check_57a79552e1 CHECK ((char_length(custom_email) <= 255)), CONSTRAINT check_b283637a9e CHECK ((char_length(custom_email_smtp_address) <= 255)), CONSTRAINT check_e3535d46ee CHECK ((char_length(custom_email_smtp_username) <= 255)) @@ -23576,6 +23478,7 @@ CREATE TABLE subscription_add_on_purchases ( quantity integer NOT NULL, expires_on date NOT NULL, purchase_xid text NOT NULL, + last_assigned_users_refreshed_at timestamp with time zone, CONSTRAINT check_3313c4d200 CHECK ((char_length(purchase_xid) <= 255)) ); @@ -24058,7 +23961,8 @@ CREATE TABLE user_achievements ( revoked_by_user_id bigint, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, - revoked_at timestamp with time zone + revoked_at timestamp with time zone, + priority integer ); CREATE SEQUENCE user_achievements_id_seq @@ -24574,6 +24478,28 @@ CREATE SEQUENCE value_stream_dashboard_counts_id_seq ALTER SEQUENCE value_stream_dashboard_counts_id_seq OWNED BY value_stream_dashboard_counts.id; +CREATE TABLE vs_code_settings ( + 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, + setting_type text NOT NULL, + content text NOT NULL, + uuid uuid, + version integer DEFAULT 0, + CONSTRAINT check_5da3b2910b CHECK ((char_length(content) <= 524288)), + CONSTRAINT check_994c503fc4 CHECK ((char_length(setting_type) <= 256)) +); + +CREATE SEQUENCE vs_code_settings_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE vs_code_settings_id_seq OWNED BY vs_code_settings.id; + CREATE TABLE vulnerabilities ( id bigint NOT NULL, milestone_id bigint, @@ -24609,7 +24535,8 @@ CREATE TABLE vulnerabilities ( resolved_on_default_branch boolean DEFAULT false NOT NULL, present_on_default_branch boolean DEFAULT true NOT NULL, detected_at timestamp with time zone DEFAULT now(), - finding_id bigint + finding_id bigint, + cvss jsonb DEFAULT '[]'::jsonb ); CREATE SEQUENCE vulnerabilities_id_seq @@ -24917,7 +24844,6 @@ CREATE TABLE vulnerability_occurrences ( primary_identifier_id bigint NOT NULL, project_fingerprint bytea NOT NULL, location_fingerprint bytea NOT NULL, - uuid character varying(36) NOT NULL, name character varying NOT NULL, metadata_version character varying NOT NULL, raw_metadata text NOT NULL, @@ -24928,7 +24854,7 @@ CREATE TABLE vulnerability_occurrences ( cve text, location jsonb, detection_method smallint DEFAULT 0 NOT NULL, - uuid_convert_string_to_uuid uuid DEFAULT '00000000-0000-0000-0000-000000000000'::uuid NOT NULL, + 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_f602da68dd CHECK ((char_length(cve) <= 48400)) @@ -25223,7 +25149,8 @@ CREATE TABLE work_item_hierarchy_restrictions ( id bigint NOT NULL, parent_type_id bigint NOT NULL, child_type_id bigint NOT NULL, - maximum_depth smallint + maximum_depth smallint, + cross_hierarchy_enabled boolean DEFAULT false NOT NULL ); CREATE SEQUENCE work_item_hierarchy_restrictions_id_seq @@ -25262,9 +25189,26 @@ CREATE TABLE work_item_progresses ( end_value double precision DEFAULT 100.0 NOT NULL, current_value double precision DEFAULT 0.0 NOT NULL, rollup_progress boolean DEFAULT true NOT NULL, - reminder_frequency smallint DEFAULT 0 NOT NULL + reminder_frequency smallint DEFAULT 0 NOT NULL, + last_reminder_sent_at timestamp with time zone +); + +CREATE TABLE work_item_related_link_restrictions ( + id bigint NOT NULL, + source_type_id bigint NOT NULL, + target_type_id bigint NOT NULL, + link_type smallint DEFAULT 0 NOT NULL ); +CREATE SEQUENCE work_item_related_link_restrictions_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE work_item_related_link_restrictions_id_seq OWNED BY work_item_related_link_restrictions.id; + CREATE TABLE work_item_types ( id bigint NOT NULL, base_type smallint DEFAULT 0 NOT NULL, @@ -25353,6 +25297,7 @@ CREATE TABLE workspaces ( personal_access_token_id bigint, config_version integer DEFAULT 1 NOT NULL, force_full_reconciliation boolean DEFAULT false NOT NULL, + force_include_all_resources boolean DEFAULT true NOT NULL, CONSTRAINT check_15543fb0fa CHECK ((char_length(name) <= 64)), CONSTRAINT check_157d5f955c CHECK ((char_length(namespace) <= 64)), CONSTRAINT check_2b401b0034 CHECK ((char_length(deployment_resource_version) <= 64)), @@ -25482,6 +25427,11 @@ CREATE TABLE zoekt_shards ( search_base_url text NOT NULL, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, + uuid uuid DEFAULT '00000000-0000-0000-0000-000000000000'::uuid NOT NULL, + last_seen_at timestamp with time zone DEFAULT '1970-01-01 00:00:00+00'::timestamp with time zone NOT NULL, + used_bytes bigint DEFAULT 0 NOT NULL, + total_bytes bigint DEFAULT 0 NOT NULL, + metadata jsonb DEFAULT '{}'::jsonb NOT NULL, CONSTRAINT check_61794bac26 CHECK ((char_length(search_base_url) <= 1024)), CONSTRAINT check_c65bb85a32 CHECK ((char_length(index_base_url) <= 1024)) ); @@ -25514,10 +25464,400 @@ CREATE SEQUENCE zoom_meetings_id_seq ALTER SEQUENCE zoom_meetings_id_seq OWNED BY zoom_meetings.id; +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_00 FOR VALUES WITH (modulus 32, remainder 0); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_01 FOR VALUES WITH (modulus 32, remainder 1); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_02 FOR VALUES WITH (modulus 32, remainder 2); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_03 FOR VALUES WITH (modulus 32, remainder 3); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_04 FOR VALUES WITH (modulus 32, remainder 4); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_05 FOR VALUES WITH (modulus 32, remainder 5); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_06 FOR VALUES WITH (modulus 32, remainder 6); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_07 FOR VALUES WITH (modulus 32, remainder 7); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_08 FOR VALUES WITH (modulus 32, remainder 8); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_09 FOR VALUES WITH (modulus 32, remainder 9); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_10 FOR VALUES WITH (modulus 32, remainder 10); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_11 FOR VALUES WITH (modulus 32, remainder 11); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_12 FOR VALUES WITH (modulus 32, remainder 12); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_13 FOR VALUES WITH (modulus 32, remainder 13); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_14 FOR VALUES WITH (modulus 32, remainder 14); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_15 FOR VALUES WITH (modulus 32, remainder 15); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_16 FOR VALUES WITH (modulus 32, remainder 16); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_17 FOR VALUES WITH (modulus 32, remainder 17); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_18 FOR VALUES WITH (modulus 32, remainder 18); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_19 FOR VALUES WITH (modulus 32, remainder 19); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_20 FOR VALUES WITH (modulus 32, remainder 20); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_21 FOR VALUES WITH (modulus 32, remainder 21); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_22 FOR VALUES WITH (modulus 32, remainder 22); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_23 FOR VALUES WITH (modulus 32, remainder 23); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_24 FOR VALUES WITH (modulus 32, remainder 24); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_25 FOR VALUES WITH (modulus 32, remainder 25); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_26 FOR VALUES WITH (modulus 32, remainder 26); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_27 FOR VALUES WITH (modulus 32, remainder 27); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_28 FOR VALUES WITH (modulus 32, remainder 28); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_29 FOR VALUES WITH (modulus 32, remainder 29); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_30 FOR VALUES WITH (modulus 32, remainder 30); + +ALTER TABLE ONLY analytics_cycle_analytics_issue_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_issue_stage_events_31 FOR VALUES WITH (modulus 32, remainder 31); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_00 FOR VALUES WITH (modulus 32, remainder 0); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_01 FOR VALUES WITH (modulus 32, remainder 1); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_02 FOR VALUES WITH (modulus 32, remainder 2); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_03 FOR VALUES WITH (modulus 32, remainder 3); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_04 FOR VALUES WITH (modulus 32, remainder 4); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_05 FOR VALUES WITH (modulus 32, remainder 5); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_06 FOR VALUES WITH (modulus 32, remainder 6); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_07 FOR VALUES WITH (modulus 32, remainder 7); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_08 FOR VALUES WITH (modulus 32, remainder 8); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_09 FOR VALUES WITH (modulus 32, remainder 9); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_10 FOR VALUES WITH (modulus 32, remainder 10); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_11 FOR VALUES WITH (modulus 32, remainder 11); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_12 FOR VALUES WITH (modulus 32, remainder 12); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_13 FOR VALUES WITH (modulus 32, remainder 13); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_14 FOR VALUES WITH (modulus 32, remainder 14); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_15 FOR VALUES WITH (modulus 32, remainder 15); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_16 FOR VALUES WITH (modulus 32, remainder 16); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_17 FOR VALUES WITH (modulus 32, remainder 17); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_18 FOR VALUES WITH (modulus 32, remainder 18); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_19 FOR VALUES WITH (modulus 32, remainder 19); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_20 FOR VALUES WITH (modulus 32, remainder 20); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_21 FOR VALUES WITH (modulus 32, remainder 21); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_22 FOR VALUES WITH (modulus 32, remainder 22); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_23 FOR VALUES WITH (modulus 32, remainder 23); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_24 FOR VALUES WITH (modulus 32, remainder 24); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_25 FOR VALUES WITH (modulus 32, remainder 25); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_26 FOR VALUES WITH (modulus 32, remainder 26); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_27 FOR VALUES WITH (modulus 32, remainder 27); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_28 FOR VALUES WITH (modulus 32, remainder 28); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_29 FOR VALUES WITH (modulus 32, remainder 29); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_30 FOR VALUES WITH (modulus 32, remainder 30); + +ALTER TABLE ONLY analytics_cycle_analytics_merge_request_stage_events ATTACH PARTITION gitlab_partitions_static.analytics_cycle_analytics_merge_request_stage_events_31 FOR VALUES WITH (modulus 32, remainder 31); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_00 FOR VALUES WITH (modulus 64, remainder 0); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_01 FOR VALUES WITH (modulus 64, remainder 1); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_02 FOR VALUES WITH (modulus 64, remainder 2); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_03 FOR VALUES WITH (modulus 64, remainder 3); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_04 FOR VALUES WITH (modulus 64, remainder 4); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_05 FOR VALUES WITH (modulus 64, remainder 5); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_06 FOR VALUES WITH (modulus 64, remainder 6); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_07 FOR VALUES WITH (modulus 64, remainder 7); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_08 FOR VALUES WITH (modulus 64, remainder 8); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_09 FOR VALUES WITH (modulus 64, remainder 9); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_10 FOR VALUES WITH (modulus 64, remainder 10); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_11 FOR VALUES WITH (modulus 64, remainder 11); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_12 FOR VALUES WITH (modulus 64, remainder 12); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_13 FOR VALUES WITH (modulus 64, remainder 13); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_14 FOR VALUES WITH (modulus 64, remainder 14); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_15 FOR VALUES WITH (modulus 64, remainder 15); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_16 FOR VALUES WITH (modulus 64, remainder 16); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_17 FOR VALUES WITH (modulus 64, remainder 17); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_18 FOR VALUES WITH (modulus 64, remainder 18); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_19 FOR VALUES WITH (modulus 64, remainder 19); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_20 FOR VALUES WITH (modulus 64, remainder 20); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_21 FOR VALUES WITH (modulus 64, remainder 21); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_22 FOR VALUES WITH (modulus 64, remainder 22); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_23 FOR VALUES WITH (modulus 64, remainder 23); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_24 FOR VALUES WITH (modulus 64, remainder 24); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_25 FOR VALUES WITH (modulus 64, remainder 25); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_26 FOR VALUES WITH (modulus 64, remainder 26); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_27 FOR VALUES WITH (modulus 64, remainder 27); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_28 FOR VALUES WITH (modulus 64, remainder 28); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_29 FOR VALUES WITH (modulus 64, remainder 29); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_30 FOR VALUES WITH (modulus 64, remainder 30); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_31 FOR VALUES WITH (modulus 64, remainder 31); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_32 FOR VALUES WITH (modulus 64, remainder 32); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_33 FOR VALUES WITH (modulus 64, remainder 33); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_34 FOR VALUES WITH (modulus 64, remainder 34); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_35 FOR VALUES WITH (modulus 64, remainder 35); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_36 FOR VALUES WITH (modulus 64, remainder 36); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_37 FOR VALUES WITH (modulus 64, remainder 37); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_38 FOR VALUES WITH (modulus 64, remainder 38); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_39 FOR VALUES WITH (modulus 64, remainder 39); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_40 FOR VALUES WITH (modulus 64, remainder 40); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_41 FOR VALUES WITH (modulus 64, remainder 41); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_42 FOR VALUES WITH (modulus 64, remainder 42); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_43 FOR VALUES WITH (modulus 64, remainder 43); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_44 FOR VALUES WITH (modulus 64, remainder 44); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_45 FOR VALUES WITH (modulus 64, remainder 45); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_46 FOR VALUES WITH (modulus 64, remainder 46); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_47 FOR VALUES WITH (modulus 64, remainder 47); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_48 FOR VALUES WITH (modulus 64, remainder 48); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_49 FOR VALUES WITH (modulus 64, remainder 49); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_50 FOR VALUES WITH (modulus 64, remainder 50); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_51 FOR VALUES WITH (modulus 64, remainder 51); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_52 FOR VALUES WITH (modulus 64, remainder 52); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_53 FOR VALUES WITH (modulus 64, remainder 53); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_54 FOR VALUES WITH (modulus 64, remainder 54); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_55 FOR VALUES WITH (modulus 64, remainder 55); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_56 FOR VALUES WITH (modulus 64, remainder 56); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_57 FOR VALUES WITH (modulus 64, remainder 57); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_58 FOR VALUES WITH (modulus 64, remainder 58); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_59 FOR VALUES WITH (modulus 64, remainder 59); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_60 FOR VALUES WITH (modulus 64, remainder 60); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_61 FOR VALUES WITH (modulus 64, remainder 61); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_62 FOR VALUES WITH (modulus 64, remainder 62); + +ALTER TABLE ONLY issue_search_data ATTACH PARTITION gitlab_partitions_static.issue_search_data_63 FOR VALUES WITH (modulus 64, remainder 63); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_00 FOR VALUES WITH (modulus 64, remainder 0); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_01 FOR VALUES WITH (modulus 64, remainder 1); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_02 FOR VALUES WITH (modulus 64, remainder 2); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_03 FOR VALUES WITH (modulus 64, remainder 3); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_04 FOR VALUES WITH (modulus 64, remainder 4); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_05 FOR VALUES WITH (modulus 64, remainder 5); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_06 FOR VALUES WITH (modulus 64, remainder 6); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_07 FOR VALUES WITH (modulus 64, remainder 7); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_08 FOR VALUES WITH (modulus 64, remainder 8); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_09 FOR VALUES WITH (modulus 64, remainder 9); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_10 FOR VALUES WITH (modulus 64, remainder 10); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_11 FOR VALUES WITH (modulus 64, remainder 11); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_12 FOR VALUES WITH (modulus 64, remainder 12); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_13 FOR VALUES WITH (modulus 64, remainder 13); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_14 FOR VALUES WITH (modulus 64, remainder 14); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_15 FOR VALUES WITH (modulus 64, remainder 15); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_16 FOR VALUES WITH (modulus 64, remainder 16); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_17 FOR VALUES WITH (modulus 64, remainder 17); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_18 FOR VALUES WITH (modulus 64, remainder 18); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_19 FOR VALUES WITH (modulus 64, remainder 19); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_20 FOR VALUES WITH (modulus 64, remainder 20); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_21 FOR VALUES WITH (modulus 64, remainder 21); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_22 FOR VALUES WITH (modulus 64, remainder 22); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_23 FOR VALUES WITH (modulus 64, remainder 23); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_24 FOR VALUES WITH (modulus 64, remainder 24); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_25 FOR VALUES WITH (modulus 64, remainder 25); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_26 FOR VALUES WITH (modulus 64, remainder 26); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_27 FOR VALUES WITH (modulus 64, remainder 27); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_28 FOR VALUES WITH (modulus 64, remainder 28); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_29 FOR VALUES WITH (modulus 64, remainder 29); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_30 FOR VALUES WITH (modulus 64, remainder 30); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_31 FOR VALUES WITH (modulus 64, remainder 31); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_32 FOR VALUES WITH (modulus 64, remainder 32); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_33 FOR VALUES WITH (modulus 64, remainder 33); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_34 FOR VALUES WITH (modulus 64, remainder 34); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_35 FOR VALUES WITH (modulus 64, remainder 35); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_36 FOR VALUES WITH (modulus 64, remainder 36); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_37 FOR VALUES WITH (modulus 64, remainder 37); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_38 FOR VALUES WITH (modulus 64, remainder 38); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_39 FOR VALUES WITH (modulus 64, remainder 39); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_40 FOR VALUES WITH (modulus 64, remainder 40); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_41 FOR VALUES WITH (modulus 64, remainder 41); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_42 FOR VALUES WITH (modulus 64, remainder 42); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_43 FOR VALUES WITH (modulus 64, remainder 43); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_44 FOR VALUES WITH (modulus 64, remainder 44); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_45 FOR VALUES WITH (modulus 64, remainder 45); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_46 FOR VALUES WITH (modulus 64, remainder 46); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_47 FOR VALUES WITH (modulus 64, remainder 47); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_48 FOR VALUES WITH (modulus 64, remainder 48); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_49 FOR VALUES WITH (modulus 64, remainder 49); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_50 FOR VALUES WITH (modulus 64, remainder 50); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_51 FOR VALUES WITH (modulus 64, remainder 51); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_52 FOR VALUES WITH (modulus 64, remainder 52); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_53 FOR VALUES WITH (modulus 64, remainder 53); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_54 FOR VALUES WITH (modulus 64, remainder 54); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_55 FOR VALUES WITH (modulus 64, remainder 55); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_56 FOR VALUES WITH (modulus 64, remainder 56); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_57 FOR VALUES WITH (modulus 64, remainder 57); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_58 FOR VALUES WITH (modulus 64, remainder 58); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_59 FOR VALUES WITH (modulus 64, remainder 59); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_60 FOR VALUES WITH (modulus 64, remainder 60); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_61 FOR VALUES WITH (modulus 64, remainder 61); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_62 FOR VALUES WITH (modulus 64, remainder 62); + +ALTER TABLE ONLY product_analytics_events_experimental ATTACH PARTITION gitlab_partitions_static.product_analytics_events_experimental_63 FOR VALUES WITH (modulus 64, remainder 63); + +ALTER TABLE ONLY p_ci_builds ATTACH PARTITION ci_builds FOR VALUES IN ('100'); + +ALTER TABLE ONLY p_ci_builds_metadata ATTACH PARTITION ci_builds_metadata FOR VALUES IN ('100'); + ALTER TABLE ONLY abuse_events ALTER COLUMN id SET DEFAULT nextval('abuse_events_id_seq'::regclass); ALTER TABLE ONLY abuse_report_events ALTER COLUMN id SET DEFAULT nextval('abuse_report_events_id_seq'::regclass); +ALTER TABLE ONLY abuse_report_user_mentions ALTER COLUMN id SET DEFAULT nextval('abuse_report_user_mentions_id_seq'::regclass); + ALTER TABLE ONLY abuse_reports ALTER COLUMN id SET DEFAULT nextval('abuse_reports_id_seq'::regclass); ALTER TABLE ONLY abuse_trust_scores ALTER COLUMN id SET DEFAULT nextval('abuse_trust_scores_id_seq'::regclass); @@ -25798,6 +26138,8 @@ ALTER TABLE ONLY commit_user_mentions ALTER COLUMN id SET DEFAULT nextval('commi ALTER TABLE ONLY compliance_management_frameworks ALTER COLUMN id SET DEFAULT nextval('compliance_management_frameworks_id_seq'::regclass); +ALTER TABLE ONLY container_registry_protection_rules ALTER COLUMN id SET DEFAULT nextval('container_registry_protection_rules_id_seq'::regclass); + ALTER TABLE ONLY container_repositories ALTER COLUMN id SET DEFAULT nextval('container_repositories_id_seq'::regclass); ALTER TABLE ONLY content_blocked_states ALTER COLUMN id SET DEFAULT nextval('content_blocked_states_id_seq'::regclass); @@ -26102,8 +26444,6 @@ ALTER TABLE ONLY loose_foreign_keys_deleted_records ALTER COLUMN id SET DEFAULT ALTER TABLE ONLY member_roles ALTER COLUMN id SET DEFAULT nextval('member_roles_id_seq'::regclass); -ALTER TABLE ONLY member_tasks ALTER COLUMN id SET DEFAULT nextval('member_tasks_id_seq'::regclass); - ALTER TABLE ONLY members ALTER COLUMN id SET DEFAULT nextval('members_id_seq'::regclass); ALTER TABLE ONLY merge_request_assignees ALTER COLUMN id SET DEFAULT nextval('merge_request_assignees_id_seq'::regclass); @@ -26456,6 +26796,8 @@ ALTER TABLE ONLY sbom_sources ALTER COLUMN id SET DEFAULT nextval('sbom_sources_ ALTER TABLE ONLY scan_result_policies ALTER COLUMN id SET DEFAULT nextval('scan_result_policies_id_seq'::regclass); +ALTER TABLE ONLY scan_result_policy_violations ALTER COLUMN id SET DEFAULT nextval('scan_result_policy_violations_id_seq'::regclass); + ALTER TABLE ONLY scim_identities ALTER COLUMN id SET DEFAULT nextval('scim_identities_id_seq'::regclass); ALTER TABLE ONLY scim_oauth_access_tokens ALTER COLUMN id SET DEFAULT nextval('scim_oauth_access_tokens_id_seq'::regclass); @@ -26598,6 +26940,8 @@ ALTER TABLE ONLY users_statistics ALTER COLUMN id SET DEFAULT nextval('users_sta ALTER TABLE ONLY value_stream_dashboard_counts ALTER COLUMN id SET DEFAULT nextval('value_stream_dashboard_counts_id_seq'::regclass); +ALTER TABLE ONLY vs_code_settings ALTER COLUMN id SET DEFAULT nextval('vs_code_settings_id_seq'::regclass); + ALTER TABLE ONLY vulnerabilities ALTER COLUMN id SET DEFAULT nextval('vulnerabilities_id_seq'::regclass); ALTER TABLE ONLY vulnerability_exports ALTER COLUMN id SET DEFAULT nextval('vulnerability_exports_id_seq'::regclass); @@ -26658,6 +27002,8 @@ ALTER TABLE ONLY work_item_hierarchy_restrictions ALTER COLUMN id SET DEFAULT ne ALTER TABLE ONLY work_item_parent_links ALTER COLUMN id SET DEFAULT nextval('work_item_parent_links_id_seq'::regclass); +ALTER TABLE ONLY work_item_related_link_restrictions ALTER COLUMN id SET DEFAULT nextval('work_item_related_link_restrictions_id_seq'::regclass); + ALTER TABLE ONLY work_item_types ALTER COLUMN id SET DEFAULT nextval('work_item_types_id_seq'::regclass); ALTER TABLE ONLY work_item_widget_definitions ALTER COLUMN id SET DEFAULT nextval('work_item_widget_definitions_id_seq'::regclass); @@ -27274,6 +27620,9 @@ ALTER TABLE ONLY abuse_events ALTER TABLE ONLY abuse_report_events ADD CONSTRAINT abuse_report_events_pkey PRIMARY KEY (id); +ALTER TABLE ONLY abuse_report_user_mentions + ADD CONSTRAINT abuse_report_user_mentions_pkey PRIMARY KEY (id); + ALTER TABLE ONLY abuse_reports ADD CONSTRAINT abuse_reports_pkey PRIMARY KEY (id); @@ -27328,6 +27677,9 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_value_streams ALTER TABLE ONLY analytics_cycle_analytics_stage_event_hashes ADD CONSTRAINT analytics_cycle_analytics_stage_event_hashes_pkey PRIMARY KEY (id); +ALTER TABLE ONLY analytics_cycle_analytics_value_stream_settings + ADD CONSTRAINT analytics_cycle_analytics_value_stream_settings_pkey PRIMARY KEY (value_stream_id); + ALTER TABLE ONLY analytics_dashboards_pointers ADD CONSTRAINT analytics_dashboards_pointers_pkey PRIMARY KEY (id); @@ -27535,6 +27887,9 @@ ALTER TABLE ONLY chat_names ALTER TABLE ONLY chat_teams ADD CONSTRAINT chat_teams_pkey PRIMARY KEY (id); +ALTER TABLE workspaces + ADD CONSTRAINT check_2a89035b04 CHECK ((personal_access_token_id IS NOT NULL)) NOT VALID; + ALTER TABLE vulnerability_scanners ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID; @@ -27778,6 +28133,9 @@ ALTER TABLE ONLY container_expiration_policies ALTER TABLE ONLY container_registry_data_repair_details ADD CONSTRAINT container_registry_data_repair_details_pkey PRIMARY KEY (project_id); +ALTER TABLE ONLY container_registry_protection_rules + ADD CONSTRAINT container_registry_protection_rules_pkey PRIMARY KEY (id); + ALTER TABLE ONLY container_repositories ADD CONSTRAINT container_repositories_pkey PRIMARY KEY (id); @@ -28312,9 +28670,6 @@ ALTER TABLE ONLY loose_foreign_keys_deleted_records ALTER TABLE ONLY member_roles ADD CONSTRAINT member_roles_pkey PRIMARY KEY (id); -ALTER TABLE ONLY member_tasks - ADD CONSTRAINT member_tasks_pkey PRIMARY KEY (id); - ALTER TABLE ONLY members ADD CONSTRAINT members_pkey PRIMARY KEY (id); @@ -28525,6 +28880,9 @@ ALTER TABLE ONLY organizations ALTER TABLE ONLY p_batched_git_ref_updates_deletions ADD CONSTRAINT p_batched_git_ref_updates_deletions_pkey PRIMARY KEY (id, partition_id); +ALTER TABLE ONLY p_ci_finished_build_ch_sync_events + ADD CONSTRAINT p_ci_finished_build_ch_sync_events_pkey PRIMARY KEY (build_id, partition); + ALTER TABLE ONLY p_ci_job_annotations ADD CONSTRAINT p_ci_job_annotations_pkey PRIMARY KEY (id, partition_id); @@ -28942,6 +29300,9 @@ ALTER TABLE ONLY sbom_sources ALTER TABLE ONLY scan_result_policies ADD CONSTRAINT scan_result_policies_pkey PRIMARY KEY (id); +ALTER TABLE ONLY scan_result_policy_violations + ADD CONSTRAINT scan_result_policy_violations_pkey PRIMARY KEY (id); + ALTER TABLE ONLY schema_migrations ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version); @@ -29200,6 +29561,9 @@ ALTER TABLE ONLY value_stream_dashboard_counts ALTER TABLE ONLY verification_codes ADD CONSTRAINT verification_codes_pkey PRIMARY KEY (created_at, visitor_id_code, code, phone); +ALTER TABLE ONLY vs_code_settings + ADD CONSTRAINT vs_code_settings_pkey PRIMARY KEY (id); + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT vulnerabilities_pkey PRIMARY KEY (id); @@ -29293,6 +29657,9 @@ ALTER TABLE ONLY work_item_parent_links ALTER TABLE ONLY work_item_progresses ADD CONSTRAINT work_item_progresses_pkey PRIMARY KEY (issue_id); +ALTER TABLE ONLY work_item_related_link_restrictions + ADD CONSTRAINT work_item_related_link_restrictions_pkey PRIMARY KEY (id); + ALTER TABLE ONLY work_item_types ADD CONSTRAINT work_item_types_pkey PRIMARY KEY (id); @@ -30574,6 +30941,8 @@ CREATE UNIQUE INDEX i_bulk_import_trackers_id_batch_number ON bulk_import_batch_ CREATE INDEX i_compliance_frameworks_on_id_and_created_at ON compliance_management_frameworks USING btree (id, created_at, pipeline_configuration_full_path); +CREATE INDEX i_compliance_violations_for_export ON merge_requests_compliance_violations USING btree (target_project_id, id); + CREATE INDEX i_compliance_violations_on_project_id_merged_at_and_id ON merge_requests_compliance_violations USING btree (target_project_id, merged_at, id); CREATE INDEX i_compliance_violations_on_project_id_reason_and_id ON merge_requests_compliance_violations USING btree (target_project_id, reason, id); @@ -30582,6 +30951,8 @@ CREATE INDEX i_compliance_violations_on_project_id_severity_and_id ON merge_requ CREATE INDEX i_compliance_violations_on_project_id_title_and_id ON merge_requests_compliance_violations USING btree (target_project_id, title, id); +CREATE UNIQUE INDEX i_container_protection_unique_project_id_container_path_pattern ON container_registry_protection_rules USING btree (project_id, container_path_pattern); + CREATE INDEX i_custom_email_verifications_on_triggered_at_and_state_started ON service_desk_custom_email_verifications USING btree (triggered_at) WHERE (state = 0); CREATE INDEX i_dast_pre_scan_verification_steps_on_pre_scan_verification_id ON dast_pre_scan_verification_steps USING btree (dast_pre_scan_verification_id); @@ -30604,6 +30975,8 @@ CREATE UNIQUE INDEX i_pm_packages_purl_type_and_name ON pm_packages USING btree CREATE INDEX idx_abuse_reports_user_id_status_and_category ON abuse_reports USING btree (user_id, status, category); +CREATE INDEX idx_addon_purchases_on_last_refreshed_at_desc_nulls_last ON subscription_add_on_purchases USING btree (last_assigned_users_refreshed_at DESC NULLS LAST); + CREATE INDEX idx_alert_management_alerts_on_created_at_project_id_with_issue ON alert_management_alerts USING btree (created_at, project_id) WHERE (issue_id IS NOT NULL); CREATE INDEX idx_analytics_devops_adoption_segments_on_namespace_id ON analytics_devops_adoption_segments USING btree (namespace_id); @@ -30770,6 +31143,8 @@ CREATE INDEX idx_projects_on_repository_storage_last_repository_updated_at ON pr CREATE UNIQUE INDEX idx_protected_branch_id_external_approval_rule_id ON external_approval_rules_protected_branches USING btree (protected_branch_id, external_approval_rule_id); +CREATE INDEX idx_reminder_frequency_on_work_item_progresses ON work_item_progresses USING btree (reminder_frequency); + CREATE INDEX idx_repository_states_on_last_repository_verification_ran_at ON project_repository_states USING btree (project_id, last_repository_verification_ran_at) WHERE ((repository_verification_checksum IS NOT NULL) AND (last_repository_verification_failure IS NULL)); CREATE INDEX idx_repository_states_on_last_wiki_verification_ran_at ON project_repository_states USING btree (project_id, last_wiki_verification_ran_at) WHERE ((wiki_verification_checksum IS NOT NULL) AND (last_wiki_verification_failure IS NULL)); @@ -30794,6 +31169,10 @@ CREATE INDEX idx_test_reports_on_issue_id_created_at_and_id ON requirements_mana CREATE UNIQUE INDEX idx_uniq_analytics_dashboards_pointers_on_project_id ON analytics_dashboards_pointers USING btree (project_id); +CREATE INDEX idx_user_credit_card_validations_on_holder_name_hash ON user_credit_card_validations USING btree (holder_name_hash); + +CREATE INDEX idx_user_credit_card_validations_on_similar_to_meta_data ON user_credit_card_validations USING btree (expiration_date_hash, last_digits_hash, network_hash, credit_card_validated_at); + CREATE INDEX idx_user_details_on_provisioned_by_group_id_user_id ON user_details USING btree (provisioned_by_group_id, user_id); CREATE INDEX idx_vuln_reads_for_filtering ON vulnerability_reads USING btree (project_id, state, dismissal_reason, severity DESC, vulnerability_id DESC NULLS LAST); @@ -30826,6 +31205,10 @@ CREATE INDEX index_abuse_report_events_on_abuse_report_id ON abuse_report_events CREATE INDEX index_abuse_report_events_on_user_id ON abuse_report_events USING btree (user_id); +CREATE UNIQUE INDEX index_abuse_report_user_mentions_on_abuse_report_id_and_note_id ON abuse_report_user_mentions USING btree (abuse_report_id, note_id); + +CREATE INDEX index_abuse_report_user_mentions_on_note_id ON abuse_report_user_mentions USING btree (note_id); + CREATE INDEX index_abuse_reports_on_assignee_id ON abuse_reports USING btree (assignee_id); CREATE INDEX index_abuse_reports_on_resolved_by_id ON abuse_reports USING btree (resolved_by_id); @@ -31102,8 +31485,6 @@ CREATE INDEX index_boards_on_project_id ON boards USING btree (project_id); CREATE INDEX index_broadcast_message_on_ends_at_and_broadcast_type_and_id ON broadcast_messages USING btree (ends_at, broadcast_type, id); -CREATE INDEX index_btree_namespaces_traversal_ids ON namespaces USING btree (traversal_ids); - CREATE INDEX index_bulk_import_batch_trackers_on_tracker_id ON bulk_import_batch_trackers USING btree (tracker_id); CREATE INDEX index_bulk_import_configurations_on_bulk_import_id ON bulk_import_configurations USING btree (bulk_import_id); @@ -31270,6 +31651,8 @@ CREATE INDEX index_ci_editor_ai_messages_on_user_project_and_created_at ON ci_ed CREATE INDEX index_ci_editor_ai_messages_project_id ON ci_editor_ai_conversation_messages USING btree (project_id); +CREATE INDEX index_ci_finished_build_ch_sync_events_for_partitioned_query ON ONLY p_ci_finished_build_ch_sync_events USING btree (((build_id % (100)::bigint)), build_id) WHERE (processed = false); + CREATE INDEX index_ci_freeze_periods_on_project_id ON ci_freeze_periods USING btree (project_id); CREATE UNIQUE INDEX index_ci_group_variables_on_group_id_and_key_and_environment ON ci_group_variables USING btree (group_id, key, environment_scope); @@ -31286,6 +31669,8 @@ CREATE INDEX index_ci_job_artifacts_id_for_terraform_reports ON ci_job_artifacts CREATE INDEX index_ci_job_artifacts_on_expire_at_and_job_id ON ci_job_artifacts USING btree (expire_at, job_id); +CREATE INDEX index_ci_job_artifacts_on_file_final_path ON ci_job_artifacts USING btree (file_final_path) WHERE (file_final_path IS NOT NULL); + CREATE INDEX index_ci_job_artifacts_on_file_store ON ci_job_artifacts USING btree (file_store); CREATE INDEX index_ci_job_artifacts_on_file_type_for_devops_adoption ON ci_job_artifacts USING btree (file_type, project_id, created_at) WHERE (file_type = ANY (ARRAY[5, 6, 8, 23])); @@ -31384,6 +31769,8 @@ CREATE INDEX index_ci_pipelines_for_ondemand_dast_scans ON ci_pipelines USING bt CREATE INDEX index_ci_pipelines_on_auto_canceled_by_id ON ci_pipelines USING btree (auto_canceled_by_id); +CREATE INDEX index_ci_pipelines_on_auto_canceled_by_id_bigint ON ci_pipelines USING btree (auto_canceled_by_id_convert_to_bigint); + CREATE INDEX index_ci_pipelines_on_ci_ref_id_and_more ON ci_pipelines USING btree (ci_ref_id, id DESC, source, status) WHERE (ci_ref_id IS NOT NULL); CREATE INDEX index_ci_pipelines_on_external_pull_request_id ON ci_pipelines USING btree (external_pull_request_id) WHERE (external_pull_request_id IS NOT NULL); @@ -31506,6 +31893,8 @@ CREATE INDEX index_ci_secure_files_on_project_id ON ci_secure_files USING btree CREATE INDEX index_ci_sources_pipelines_on_pipeline_id ON ci_sources_pipelines USING btree (pipeline_id); +CREATE INDEX index_ci_sources_pipelines_on_pipeline_id_bigint ON ci_sources_pipelines USING btree (pipeline_id_convert_to_bigint); + CREATE INDEX index_ci_sources_pipelines_on_project_id ON ci_sources_pipelines USING btree (project_id); CREATE INDEX index_ci_sources_pipelines_on_source_job_id ON ci_sources_pipelines USING btree (source_job_id); @@ -31514,6 +31903,8 @@ CREATE INDEX index_ci_sources_pipelines_on_source_partition_id_source_job_id ON CREATE INDEX index_ci_sources_pipelines_on_source_pipeline_id ON ci_sources_pipelines USING btree (source_pipeline_id); +CREATE INDEX index_ci_sources_pipelines_on_source_pipeline_id_bigint ON ci_sources_pipelines USING btree (source_pipeline_id_convert_to_bigint); + CREATE INDEX index_ci_sources_pipelines_on_source_project_id ON ci_sources_pipelines USING btree (source_project_id); CREATE INDEX index_ci_sources_projects_on_pipeline_id ON ci_sources_projects USING btree (pipeline_id); @@ -31800,8 +32191,6 @@ CREATE INDEX index_deployments_on_project_id_and_id ON deployments USING btree ( CREATE UNIQUE INDEX index_deployments_on_project_id_and_iid ON deployments USING btree (project_id, iid); -CREATE INDEX index_deployments_on_project_id_and_ref ON deployments USING btree (project_id, ref); - CREATE INDEX index_deployments_on_project_id_and_status_and_created_at ON deployments USING btree (project_id, status, created_at); CREATE INDEX index_deployments_on_project_id_and_updated_at_and_id ON deployments USING btree (project_id, updated_at DESC, id DESC); @@ -31982,8 +32371,6 @@ CREATE INDEX index_events_for_project_activity ON events USING btree (project_id CREATE INDEX index_events_on_author_id_and_created_at ON events USING btree (author_id, created_at); -CREATE INDEX index_events_on_author_id_and_created_at_merge_requests ON events USING btree (author_id, created_at) WHERE ((target_type)::text = 'MergeRequest'::text); - CREATE INDEX index_events_on_author_id_and_id ON events USING btree (author_id, id); CREATE INDEX index_events_on_created_at_and_id ON events USING btree (created_at, id) WHERE (created_at > '2021-08-27 00:00:00+00'::timestamp with time zone); @@ -32112,7 +32499,7 @@ CREATE INDEX index_gpg_keys_on_user_id ON gpg_keys USING btree (user_id); CREATE UNIQUE INDEX index_gpg_signatures_on_commit_sha ON gpg_signatures USING btree (commit_sha); -CREATE INDEX index_gpg_signatures_on_gpg_key_id ON gpg_signatures USING btree (gpg_key_id); +CREATE INDEX index_gpg_signatures_on_gpg_key_id_and_id ON gpg_signatures USING btree (gpg_key_id, id); CREATE INDEX index_gpg_signatures_on_gpg_key_primary_keyid ON gpg_signatures USING btree (gpg_key_primary_keyid); @@ -32516,12 +32903,6 @@ CREATE INDEX index_manifest_states_pending_verification ON dependency_proxy_mani CREATE INDEX index_member_roles_on_namespace_id ON member_roles USING btree (namespace_id); -CREATE INDEX index_member_tasks_on_member_id ON member_tasks USING btree (member_id); - -CREATE UNIQUE INDEX index_member_tasks_on_member_id_and_project_id ON member_tasks USING btree (member_id, project_id); - -CREATE INDEX index_member_tasks_on_project_id ON member_tasks USING btree (project_id); - CREATE INDEX index_members_on_access_level ON members USING btree (access_level); CREATE INDEX index_members_on_expires_at ON members USING btree (expires_at); @@ -32792,8 +33173,6 @@ CREATE INDEX index_namespaces_on_file_template_project_id ON namespaces USING bt CREATE INDEX index_namespaces_on_ldap_sync_last_successful_update_at ON namespaces USING btree (ldap_sync_last_successful_update_at); -CREATE INDEX index_namespaces_on_ldap_sync_last_update_at ON namespaces USING btree (ldap_sync_last_update_at); - 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); @@ -32812,8 +33191,6 @@ CREATE UNIQUE INDEX index_namespaces_on_push_rule_id ON namespaces USING btree ( CREATE INDEX index_namespaces_on_require_two_factor_authentication ON namespaces USING btree (require_two_factor_authentication); -CREATE UNIQUE INDEX index_namespaces_on_runners_token ON namespaces USING btree (runners_token); - CREATE UNIQUE INDEX index_namespaces_on_runners_token_encrypted ON namespaces USING btree (runners_token_encrypted); CREATE INDEX index_namespaces_on_shared_and_extra_runners_minutes_limit ON namespaces USING btree (shared_runners_minutes_limit, extra_shared_runners_minutes_limit); @@ -32826,10 +33203,6 @@ CREATE INDEX index_namespaces_on_traversal_ids_for_groups_btree ON namespaces US CREATE INDEX index_namespaces_on_type_and_id ON namespaces USING btree (type, id); -CREATE INDEX index_namespaces_on_type_and_visibility_and_parent_id ON namespaces USING btree (id) WHERE (((type)::text = 'Group'::text) AND (parent_id IS NULL) AND (visibility_level <> 20)); - -CREATE INDEX index_namespaces_on_updated_at ON namespaces USING btree (updated_at); - CREATE INDEX index_namespaces_public_groups_name_id ON namespaces USING btree (name, id) WHERE (((type)::text = 'Group'::text) AND (visibility_level = 20)); CREATE INDEX index_namespaces_sync_events_on_namespace_id ON namespaces_sync_events USING btree (namespace_id); @@ -33112,6 +33485,8 @@ CREATE INDEX index_pages_deployment_states_pending_verification ON pages_deploym CREATE INDEX index_pages_deployments_on_ci_build_id ON pages_deployments USING btree (ci_build_id); +CREATE INDEX index_pages_deployments_on_deleted_at ON pages_deployments USING btree (deleted_at) WHERE (deleted_at IS NOT NULL); + CREATE INDEX index_pages_deployments_on_file_store_and_id ON pages_deployments USING btree (file_store, id); CREATE INDEX index_pages_deployments_on_project_id ON pages_deployments USING btree (project_id); @@ -33354,6 +33729,8 @@ CREATE INDEX index_projects_api_vis20_path ON projects USING btree (path, id) WH CREATE INDEX index_projects_api_vis20_updated_at ON projects USING btree (updated_at, id) WHERE (visibility_level = 20); +CREATE INDEX index_projects_id_for_aimed_for_deletion ON projects USING btree (id, marked_for_deletion_at) WHERE ((marked_for_deletion_at IS NOT NULL) AND (pending_delete = false)); + CREATE INDEX index_projects_not_aimed_for_deletion ON projects USING btree (id) WHERE (marked_for_deletion_at IS NULL); CREATE INDEX index_projects_on_created_at_and_id ON projects USING btree (created_at, id); @@ -33678,6 +34055,12 @@ CREATE UNIQUE INDEX index_scan_result_policies_on_position_in_configuration ON s CREATE INDEX index_scan_result_policies_on_project_id ON scan_result_policies USING btree (project_id); +CREATE INDEX index_scan_result_policy_violations_on_merge_request_id ON scan_result_policy_violations USING btree (merge_request_id); + +CREATE UNIQUE INDEX index_scan_result_policy_violations_on_policy_and_merge_request ON scan_result_policy_violations USING btree (scan_result_policy_id, merge_request_id); + +CREATE INDEX index_scan_result_policy_violations_on_project_id ON scan_result_policy_violations USING btree (project_id); + CREATE INDEX index_scim_identities_on_group_id ON scim_identities USING btree (group_id); CREATE UNIQUE INDEX index_scim_identities_on_lower_extern_uid_and_group_id ON scim_identities USING btree (lower((extern_uid)::text), group_id); @@ -34078,6 +34461,8 @@ CREATE INDEX index_users_on_created_at ON users USING btree (created_at); CREATE UNIQUE INDEX index_users_on_email ON users USING btree (email); +CREATE INDEX index_users_on_email_domain_and_id ON users USING btree (lower(split_part((email)::text, '@'::text, 2)), id); + CREATE INDEX index_users_on_email_trigram ON users USING gin (email gin_trgm_ops); CREATE INDEX index_users_on_feed_token ON users USING btree (feed_token); @@ -34138,9 +34523,9 @@ CREATE UNIQUE INDEX index_verification_codes_on_phone_and_visitor_id_code ON ONL COMMENT ON INDEX index_verification_codes_on_phone_and_visitor_id_code IS 'JiHu-specific index'; -CREATE UNIQUE INDEX index_vuln_findings_on_uuid_including_vuln_id ON vulnerability_occurrences USING btree (uuid) INCLUDE (vulnerability_id); +CREATE INDEX index_vs_code_settings_on_user_id ON vs_code_settings USING btree (user_id); -CREATE UNIQUE INDEX index_vuln_findings_on_uuid_including_vuln_id_1 ON vulnerability_occurrences USING btree (uuid_convert_string_to_uuid) INCLUDE (vulnerability_id); +CREATE UNIQUE INDEX index_vuln_findings_on_uuid_including_vuln_id_1 ON vulnerability_occurrences USING btree (uuid) INCLUDE (vulnerability_id); CREATE UNIQUE INDEX index_vuln_historical_statistics_on_project_id_and_date ON vulnerability_historical_statistics USING btree (project_id, date); @@ -34172,6 +34557,8 @@ CREATE INDEX index_vulnerabilities_on_last_edited_by_id ON vulnerabilities USING CREATE INDEX index_vulnerabilities_on_milestone_id ON vulnerabilities USING btree (milestone_id); +CREATE INDEX index_vulnerabilities_on_project_id_and_id ON vulnerabilities USING btree (project_id, id); + CREATE INDEX index_vulnerabilities_on_project_id_and_state_and_severity ON vulnerabilities USING btree (project_id, state, severity); CREATE INDEX index_vulnerabilities_on_resolved_by_id ON vulnerabilities USING btree (resolved_by_id); @@ -34260,9 +34647,7 @@ CREATE INDEX index_vulnerability_occurrences_on_project_fingerprint ON vulnerabi CREATE INDEX index_vulnerability_occurrences_on_scanner_id ON vulnerability_occurrences USING btree (scanner_id); -CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid ON vulnerability_occurrences USING btree (uuid); - -CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid_1 ON vulnerability_occurrences USING btree (uuid_convert_string_to_uuid); +CREATE UNIQUE INDEX index_vulnerability_occurrences_on_uuid_1 ON vulnerability_occurrences USING btree (uuid); CREATE INDEX index_vulnerability_occurrences_on_vulnerability_id ON vulnerability_occurrences USING btree (vulnerability_id); @@ -34354,10 +34739,14 @@ CREATE UNIQUE INDEX index_work_item_hierarchy_restrictions_on_parent_and_child O CREATE INDEX index_work_item_hierarchy_restrictions_on_parent_type_id ON work_item_hierarchy_restrictions USING btree (parent_type_id); +CREATE UNIQUE INDEX index_work_item_link_restrictions_on_source_link_type_target ON work_item_related_link_restrictions USING btree (source_type_id, link_type, target_type_id); + CREATE UNIQUE INDEX index_work_item_parent_links_on_work_item_id ON work_item_parent_links USING btree (work_item_id); CREATE INDEX index_work_item_parent_links_on_work_item_parent_id ON work_item_parent_links USING btree (work_item_parent_id); +CREATE INDEX index_work_item_related_link_restrictions_on_target_type_id ON work_item_related_link_restrictions USING btree (target_type_id); + CREATE INDEX index_work_item_types_on_base_type_and_id ON work_item_types USING btree (base_type, id); CREATE UNIQUE INDEX index_work_item_widget_definitions_on_default_witype_and_name ON work_item_widget_definitions USING btree (work_item_type_id, name) WHERE (namespace_id IS NULL); @@ -34398,6 +34787,8 @@ CREATE UNIQUE INDEX index_zoekt_shard_and_namespace ON zoekt_indexed_namespaces CREATE UNIQUE INDEX index_zoekt_shards_on_index_base_url ON zoekt_shards USING btree (index_base_url); +CREATE INDEX index_zoekt_shards_on_last_seen_at ON zoekt_shards USING btree (last_seen_at); + CREATE UNIQUE INDEX index_zoekt_shards_on_search_base_url ON zoekt_shards USING btree (search_base_url); CREATE INDEX index_zoom_meetings_on_issue_id ON zoom_meetings USING btree (issue_id); @@ -34500,8 +34891,6 @@ CREATE INDEX tmp_idx_orphaned_approval_project_rules ON approval_project_rules U 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_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_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); @@ -34516,8 +34905,6 @@ CREATE INDEX tmp_index_on_vulnerabilities_non_dismissed ON vulnerabilities USING CREATE INDEX tmp_index_project_statistics_cont_registry_size ON project_statistics USING btree (project_id) WHERE (container_registry_size = 0); -CREATE INDEX tmp_index_project_statistics_pipeline_artifacts_size ON project_statistics USING btree (project_id) WHERE (pipeline_artifacts_size <> 0); - CREATE INDEX tmp_index_project_statistics_updated_at ON project_statistics USING btree (project_id, updated_at) WHERE (repository_size > 0); CREATE INDEX tmp_index_vulnerability_dismissal_info ON vulnerabilities USING btree (id) WHERE ((state = 2) AND ((dismissed_at IS NULL) OR (dismissed_by_id IS NULL))); @@ -34552,6 +34939,10 @@ CREATE UNIQUE INDEX unique_amazon_s3_configurations_namespace_id_and_bucket_name CREATE UNIQUE INDEX unique_amazon_s3_configurations_namespace_id_and_name ON audit_events_amazon_s3_configurations USING btree (namespace_id, name); +CREATE UNIQUE INDEX unique_any_approver_merge_request_rule_type_post_merge ON approval_merge_request_rules USING btree (merge_request_id, rule_type, applicable_post_merge) WHERE (rule_type = 4); + +CREATE UNIQUE INDEX unique_batched_background_migrations_queued_migration_version ON batched_background_migrations USING btree (queued_migration_version); + 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); @@ -34596,6 +34987,8 @@ CREATE UNIQUE INDEX unique_streaming_instance_event_type_filters_destination_id CREATE UNIQUE INDEX unique_vuln_merge_request_link_vuln_id_and_mr_id ON vulnerability_merge_request_links USING btree (vulnerability_id, merge_request_id); +CREATE UNIQUE INDEX unique_zoekt_shards_uuid ON zoekt_shards USING btree (uuid); + CREATE INDEX user_follow_users_followee_id_idx ON user_follow_users USING btree (followee_id); CREATE INDEX users_forbidden_state_idx ON users USING btree (id) WHERE ((confirmed_at IS NOT NULL) AND ((state)::text <> ALL (ARRAY['blocked'::text, 'banned'::text, 'ldap_blocked'::text]))); @@ -36234,8 +36627,6 @@ CREATE TRIGGER tags_loose_fk_trigger AFTER DELETE ON tags REFERENCING OLD TABLE CREATE TRIGGER trigger_07bc3c48f407 BEFORE INSERT OR UPDATE ON ci_stages FOR EACH ROW EXECUTE FUNCTION trigger_07bc3c48f407(); -CREATE TRIGGER trigger_1a857e8db6cd BEFORE INSERT OR UPDATE ON vulnerability_occurrences FOR EACH ROW EXECUTE FUNCTION trigger_1a857e8db6cd(); - CREATE TRIGGER trigger_1bd97da9c1a4 BEFORE INSERT OR UPDATE ON ci_pipelines FOR EACH ROW EXECUTE FUNCTION trigger_1bd97da9c1a4(); CREATE TRIGGER trigger_239c8032a8d6 BEFORE INSERT OR UPDATE ON ci_pipeline_chat_data FOR EACH ROW EXECUTE FUNCTION trigger_239c8032a8d6(); @@ -36324,9 +36715,6 @@ ALTER TABLE ONLY service_desk_settings ALTER TABLE ONLY design_management_designs_versions ADD CONSTRAINT fk_03c671965c FOREIGN KEY (design_id) REFERENCES design_management_designs(id) ON DELETE CASCADE; -ALTER TABLE ONLY projects - ADD CONSTRAINT fk_03ec10b0d3 FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL; - ALTER TABLE ONLY analytics_dashboards_pointers ADD CONSTRAINT fk_05d96922bd FOREIGN KEY (target_project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -36336,6 +36724,9 @@ ALTER TABLE ONLY issues ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_06067f5644 FOREIGN KEY (latest_merge_request_diff_id) REFERENCES merge_request_diffs(id) ON DELETE SET NULL; +ALTER TABLE ONLY abuse_report_user_mentions + ADD CONSTRAINT fk_088018ecd8 FOREIGN KEY (abuse_report_id) REFERENCES abuse_reports(id) ON DELETE CASCADE; + ALTER TABLE ONLY user_interacted_projects ADD CONSTRAINT fk_0894651f08 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; @@ -36343,7 +36734,7 @@ ALTER TABLE ONLY merge_request_assignment_events ADD CONSTRAINT fk_08f7602bfd FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; ALTER TABLE ONLY ci_pipeline_messages - ADD CONSTRAINT fk_0946fea681 FOREIGN KEY (pipeline_id_convert_to_bigint) REFERENCES ci_pipelines(id) ON DELETE CASCADE NOT VALID; + ADD CONSTRAINT fk_0946fea681 FOREIGN KEY (pipeline_id_convert_to_bigint) REFERENCES ci_pipelines(id) ON DELETE CASCADE; ALTER TABLE ONLY remote_development_agent_configs ADD CONSTRAINT fk_0a3c0ada56 FOREIGN KEY (cluster_agent_id) REFERENCES cluster_agents(id) ON DELETE CASCADE; @@ -36375,9 +36766,6 @@ ALTER TABLE ONLY project_pages_metadata ALTER TABLE ONLY group_deletion_schedules ADD CONSTRAINT fk_11e3ebfcdd FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; -ALTER TABLE ONLY member_tasks - ADD CONSTRAINT fk_12816d4bbb FOREIGN KEY (member_id) REFERENCES members(id) ON DELETE CASCADE; - ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_1302949740 FOREIGN KEY (last_edited_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -36399,6 +36787,9 @@ ALTER TABLE ONLY internal_ids ALTER TABLE ONLY incident_management_timeline_events ADD CONSTRAINT fk_17a5fafbd4 FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY scan_result_policy_violations + ADD CONSTRAINT fk_17ce579abf FOREIGN KEY (merge_request_id) REFERENCES merge_requests(id) ON DELETE CASCADE; + ALTER TABLE ONLY incident_management_timeline_events ADD CONSTRAINT fk_1800597ef9 FOREIGN KEY (author_id) REFERENCES users(id) ON DELETE SET NULL; @@ -36423,6 +36814,9 @@ ALTER TABLE ONLY agent_project_authorizations ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_1d37cddf91 FOREIGN KEY (epic_id) REFERENCES epics(id) ON DELETE SET NULL; +ALTER TABLE ONLY ci_sources_pipelines + ADD CONSTRAINT fk_1df371767f FOREIGN KEY (source_pipeline_id_convert_to_bigint) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + ALTER TABLE ONLY boards ADD CONSTRAINT fk_1e9a074a35 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -36459,9 +36853,6 @@ ALTER TABLE ONLY agent_activity_events ALTER TABLE ONLY epics ADD CONSTRAINT fk_25b99c1be3 FOREIGN KEY (parent_id) REFERENCES epics(id) ON DELETE CASCADE; -ALTER TABLE ONLY projects - ADD CONSTRAINT fk_25d8780d11 FOREIGN KEY (marked_for_deletion_by_user_id) REFERENCES users(id) ON DELETE SET NULL; - ALTER TABLE ONLY ci_pipelines ADD CONSTRAINT fk_262d4c2d19 FOREIGN KEY (auto_canceled_by_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL; @@ -36714,9 +37105,15 @@ ALTER TABLE ONLY vulnerability_reads ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_641731faff FOREIGN KEY (updated_by_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY ci_pipeline_chat_data + ADD CONSTRAINT fk_64ebfab6b3 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + ALTER TABLE p_ci_builds ADD CONSTRAINT fk_6661f4f0e8 FOREIGN KEY (resource_group_id) REFERENCES ci_resource_groups(id) ON DELETE SET NULL; +ALTER TABLE ONLY ci_pipelines + ADD CONSTRAINT fk_67e4288f3a FOREIGN KEY (auto_canceled_by_id_convert_to_bigint) REFERENCES ci_pipelines(id) ON DELETE SET NULL; + ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_6a5165a692 FOREIGN KEY (milestone_id) REFERENCES milestones(id) ON DELETE SET NULL; @@ -36774,6 +37171,9 @@ ALTER TABLE ONLY notes ALTER TABLE ONLY oauth_openid_requests ADD CONSTRAINT fk_77114b3b09 FOREIGN KEY (access_grant_id) REFERENCES oauth_access_grants(id) ON DELETE CASCADE; +ALTER TABLE ONLY scan_result_policy_violations + ADD CONSTRAINT fk_77251168f1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY agent_user_access_project_authorizations ADD CONSTRAINT fk_78034b05d8 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -36972,6 +37372,9 @@ ALTER TABLE p_ci_builds ALTER TABLE ONLY bulk_import_entities ADD CONSTRAINT fk_a44ff95be5 FOREIGN KEY (parent_id) REFERENCES bulk_import_entities(id) ON DELETE CASCADE; +ALTER TABLE ONLY abuse_report_user_mentions + ADD CONSTRAINT fk_a4bd02b7df FOREIGN KEY (note_id) REFERENCES notes(id) ON DELETE CASCADE; + ALTER TABLE ONLY security_orchestration_policy_configurations ADD CONSTRAINT fk_a50430b375 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -36999,9 +37402,6 @@ ALTER TABLE ONLY identities ALTER TABLE ONLY boards ADD CONSTRAINT fk_ab0a250ff6 FOREIGN KEY (iteration_cadence_id) REFERENCES iterations_cadences(id) ON DELETE CASCADE; -ALTER TABLE ONLY member_tasks - ADD CONSTRAINT fk_ab636303dd FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; - ALTER TABLE ONLY merge_requests ADD CONSTRAINT fk_ad525e1f87 FOREIGN KEY (merge_user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -37110,6 +37510,9 @@ ALTER TABLE ONLY design_management_versions ALTER TABLE ONLY packages_packages ADD CONSTRAINT fk_c188f0dba4 FOREIGN KEY (creator_id) REFERENCES users(id) ON DELETE SET NULL; +ALTER TABLE ONLY ci_sources_pipelines + ADD CONSTRAINT fk_c1b5dc6b6f FOREIGN KEY (pipeline_id_convert_to_bigint) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + ALTER TABLE ONLY sbom_occurrences ADD CONSTRAINT fk_c2a5562923 FOREIGN KEY (source_id) REFERENCES sbom_sources(id) ON DELETE CASCADE; @@ -37125,6 +37528,9 @@ ALTER TABLE ONLY timelogs ALTER TABLE ONLY geo_event_log ADD CONSTRAINT fk_c4b1c1f66e FOREIGN KEY (repository_deleted_event_id) REFERENCES geo_repository_deleted_events(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_stages + ADD CONSTRAINT fk_c5ddde695f FOREIGN KEY (pipeline_id_convert_to_bigint) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + ALTER TABLE ONLY issues ADD CONSTRAINT fk_c63cbf6c25 FOREIGN KEY (closed_by_id) REFERENCES users(id) ON DELETE SET NULL; @@ -37350,6 +37756,9 @@ ALTER TABLE ONLY status_check_responses ALTER TABLE ONLY design_management_designs_versions ADD CONSTRAINT fk_f4d25ba00c FOREIGN KEY (version_id) REFERENCES design_management_versions(id) ON DELETE CASCADE; +ALTER TABLE ONLY scan_result_policy_violations + ADD CONSTRAINT fk_f53706dbdd FOREIGN KEY (scan_result_policy_id) REFERENCES scan_result_policies(id) ON DELETE CASCADE; + ALTER TABLE ONLY analytics_devops_adoption_segments ADD CONSTRAINT fk_f5aa768998 FOREIGN KEY (namespace_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -37860,6 +38269,9 @@ ALTER TABLE ONLY batched_background_migration_jobs ALTER TABLE ONLY operations_strategies_user_lists ADD CONSTRAINT fk_rails_43241e8d29 FOREIGN KEY (strategy_id) REFERENCES operations_strategies(id) ON DELETE CASCADE; +ALTER TABLE ONLY analytics_cycle_analytics_value_stream_settings + ADD CONSTRAINT fk_rails_4360d37256 FOREIGN KEY (value_stream_id) REFERENCES analytics_cycle_analytics_group_value_streams(id) ON DELETE CASCADE; + ALTER TABLE ONLY merge_request_assignment_events ADD CONSTRAINT fk_rails_4378a2e8d7 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -37875,6 +38287,9 @@ ALTER TABLE ONLY merge_request_assignees ALTER TABLE ONLY packages_dependency_links ADD CONSTRAINT fk_rails_4437bf4070 FOREIGN KEY (dependency_id) REFERENCES packages_dependencies(id) ON DELETE CASCADE; +ALTER TABLE ONLY work_item_related_link_restrictions + ADD CONSTRAINT fk_rails_4513f0061c FOREIGN KEY (target_type_id) REFERENCES work_item_types(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_auto_devops ADD CONSTRAINT fk_rails_45436b12b2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -38115,9 +38530,6 @@ ALTER TABLE ONLY board_group_recent_visits ALTER TABLE ONLY approval_merge_request_rule_sources ADD CONSTRAINT fk_rails_64e8ed3c7e FOREIGN KEY (approval_project_rule_id) REFERENCES approval_project_rules(id) ON DELETE CASCADE; -ALTER TABLE ONLY ci_pipeline_chat_data - ADD CONSTRAINT fk_rails_64ebfab6b3 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; - ALTER TABLE ONLY approval_project_rules_protected_branches ADD CONSTRAINT fk_rails_65203aa786 FOREIGN KEY (approval_project_rule_id) REFERENCES approval_project_rules(id) ON DELETE CASCADE; @@ -38598,6 +39010,9 @@ ALTER TABLE ONLY dast_profiles_tags ALTER TABLE ONLY resource_iteration_events ADD CONSTRAINT fk_rails_abf5d4affa FOREIGN KEY (issue_id) REFERENCES issues(id) ON DELETE CASCADE; +ALTER TABLE ONLY container_registry_protection_rules + ADD CONSTRAINT fk_rails_ac331fcba9 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY clusters ADD CONSTRAINT fk_rails_ac3a663d79 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; @@ -38625,6 +39040,9 @@ ALTER TABLE ONLY pool_repositories ALTER TABLE ONLY vulnerability_statistics ADD CONSTRAINT fk_rails_af61a7df4c FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY work_item_related_link_restrictions + ADD CONSTRAINT fk_rails_b013a0fa65 FOREIGN KEY (source_type_id) REFERENCES work_item_types(id) ON DELETE CASCADE; + ALTER TABLE ONLY resource_label_events ADD CONSTRAINT fk_rails_b126799f57 FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE SET NULL; @@ -38952,6 +39370,9 @@ ALTER TABLE ONLY analytics_cycle_analytics_group_stages ALTER TABLE ONLY bulk_import_export_uploads ADD CONSTRAINT fk_rails_dfbfb45eca FOREIGN KEY (export_id) REFERENCES bulk_import_exports(id) ON DELETE CASCADE; +ALTER TABLE ONLY vs_code_settings + ADD CONSTRAINT fk_rails_e02b1ed535 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY label_priorities ADD CONSTRAINT fk_rails_e161058b0f FOREIGN KEY (label_id) REFERENCES labels(id) ON DELETE CASCADE; |