diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 09:40:42 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-10-20 09:40:42 +0000 |
commit | ee664acb356f8123f4f6b00b73c1e1cf0866c7fb (patch) | |
tree | f8479f94a28f66654c6a4f6fb99bad6b4e86a40e /db | |
parent | 62f7d5c5b69180e82ae8196b7b429eeffc8e7b4f (diff) | |
download | gitlab-ce-ee664acb356f8123f4f6b00b73c1e1cf0866c7fb.tar.gz |
Add latest changes from gitlab-org/gitlab@15-5-stable-eev15.5.0-rc42
Diffstat (limited to 'db')
230 files changed, 2481 insertions, 141 deletions
diff --git a/db/docs/ci_pipeline_metadata.yml b/db/docs/ci_pipeline_metadata.yml new file mode 100644 index 00000000000..ed0bd896841 --- /dev/null +++ b/db/docs/ci_pipeline_metadata.yml @@ -0,0 +1,9 @@ +--- +table_name: ci_pipelines_metadata +classes: +- Ci::PipelineMetadata +feature_categories: +- continuous_integration +description: 'Stores additional information about CI pipelines' +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/97139 +milestone: '15.5' diff --git a/db/docs/incident_management_timeline_event_tag_links.yml b/db/docs/incident_management_timeline_event_tag_links.yml new file mode 100644 index 00000000000..429371aefb7 --- /dev/null +++ b/db/docs/incident_management_timeline_event_tag_links.yml @@ -0,0 +1,9 @@ +--- +table_name: incident_management_timeline_event_tag_links +classes: +- IncidentManagement::TimelineEventTagLink +feature_categories: +- incident_management +description: Persists links between timeline event tags and timeline events. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/100271 +milestone: '15.6' diff --git a/db/docs/incident_management_timeline_event_tags.yml b/db/docs/incident_management_timeline_event_tags.yml new file mode 100644 index 00000000000..47dedaf3de2 --- /dev/null +++ b/db/docs/incident_management_timeline_event_tags.yml @@ -0,0 +1,9 @@ +--- +table_name: incident_management_timeline_event_tags +classes: +- IncidentManagement::TimelineEventTag +feature_categories: +- incident_management +description: Persists tags for timeline events in a project. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/100271 +milestone: '15.6' diff --git a/db/docs/packages_rpm_repository_files.yml b/db/docs/packages_rpm_repository_files.yml new file mode 100644 index 00000000000..3aac984265c --- /dev/null +++ b/db/docs/packages_rpm_repository_files.yml @@ -0,0 +1,9 @@ +--- +table_name: packages_rpm_repository_files +classes: +- Packages::RPM::RepositoryFile +feature_categories: +- package_registry +description: Package registry file links and file metadata for RPM packages +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/97484 +milestone: '15.5' diff --git a/db/docs/project_wiki_repository_states.yml b/db/docs/project_wiki_repository_states.yml new file mode 100644 index 00000000000..b074eca3c89 --- /dev/null +++ b/db/docs/project_wiki_repository_states.yml @@ -0,0 +1,9 @@ +--- +table_name: project_wiki_repository_states +classes: +- ProjectWikiRepositoryState +feature_categories: +- geo_replication +description: Separate table for project wikis containing Geo verification metadata. +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/99168 +milestone: '15.5' diff --git a/db/docs/push_rules.yml b/db/docs/push_rules.yml index 6b62013892b..6a51fc79b33 100644 --- a/db/docs/push_rules.yml +++ b/db/docs/push_rules.yml @@ -3,7 +3,7 @@ table_name: push_rules classes: - PushRule feature_categories: -- compliance_management +- source_code_management description: TODO introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/commit/1b98b5ab97ce3e9997df542059cbf3c6ce0bf0e1 milestone: '8.10' diff --git a/db/docs/sbom_component_versions.yml b/db/docs/sbom_component_versions.yml index 7fb9b7fcec5..1bee0ddb3fb 100644 --- a/db/docs/sbom_component_versions.yml +++ b/db/docs/sbom_component_versions.yml @@ -3,9 +3,7 @@ table_name: sbom_component_versions classes: - Sbom::ComponentVersion feature_categories: -- container_scanning -- dependency_scanning -- license_compliance +- dependency_management description: Stores version information for software components produced by a Software Bill of Materials (SBoM) introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90809 milestone: '15.2' diff --git a/db/docs/sbom_components.yml b/db/docs/sbom_components.yml index 8860c253cd5..0bb1a4d7b30 100644 --- a/db/docs/sbom_components.yml +++ b/db/docs/sbom_components.yml @@ -3,9 +3,7 @@ table_name: sbom_components classes: - Sbom::Component feature_categories: -- container_scanning -- dependency_scanning -- license_compliance +- dependency_management description: Stores information about software components produced by a Software Bill of Materials (SBoM) introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90809 milestone: '15.2' diff --git a/db/docs/sbom_occurrences.yml b/db/docs/sbom_occurrences.yml index 82d9e21aa42..b30bac79698 100644 --- a/db/docs/sbom_occurrences.yml +++ b/db/docs/sbom_occurrences.yml @@ -3,9 +3,7 @@ table_name: sbom_occurrences classes: - Sbom::Occurrence feature_categories: -- container_scanning -- dependency_scanning -- license_compliance +- dependency_management description: Tracks each occurrence of an SBoM component introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90814 milestone: '15.2' diff --git a/db/docs/sbom_sources.yml b/db/docs/sbom_sources.yml index 514386536da..dd17b02a3dd 100644 --- a/db/docs/sbom_sources.yml +++ b/db/docs/sbom_sources.yml @@ -3,9 +3,7 @@ table_name: sbom_sources classes: - Sbom::Source feature_categories: -- container_scanning -- dependency_scanning -- license_compliance +- dependency_management description: Stores information about where an SBoM component originated from introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90812 milestone: '15.2' diff --git a/db/docs/sbom_vulnerable_component_versions.yml b/db/docs/sbom_vulnerable_component_versions.yml index 147af9c046b..bb67c6e4f68 100644 --- a/db/docs/sbom_vulnerable_component_versions.yml +++ b/db/docs/sbom_vulnerable_component_versions.yml @@ -3,9 +3,7 @@ table_name: sbom_vulnerable_component_versions classes: - Sbom::VulnerableComponentVersion feature_categories: -- container_scanning -- dependency_scanning -- license_compliance +- dependency_management description: Stores information about vulnerable SBoM components introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/95622 milestone: '15.4' diff --git a/db/docs/user_phone_number_validations.yml b/db/docs/user_phone_number_validations.yml new file mode 100644 index 00000000000..9feacd76c5a --- /dev/null +++ b/db/docs/user_phone_number_validations.yml @@ -0,0 +1,9 @@ +--- +table_name: user_phone_number_validations +classes: +- Users::PhoneNumberValidation +feature_categories: +- onboarding +description: Stores whether the user has verified their phone number +introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/97762 +milestone: '15.5' diff --git a/db/migrate/20220126191624_add_scan_file_path_to_dast_site_profile.rb b/db/migrate/20220126191624_add_scan_file_path_to_dast_site_profile.rb new file mode 100644 index 00000000000..eab02663e26 --- /dev/null +++ b/db/migrate/20220126191624_add_scan_file_path_to_dast_site_profile.rb @@ -0,0 +1,14 @@ +# frozen_string_literal: true + +class AddScanFilePathToDastSiteProfile < Gitlab::Database::Migration[2.0] + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20221012135524_add_scan_file_path_limit_for_dast_site_profile + def up + add_column :dast_site_profiles, :scan_file_path, :text + end + # rubocop:enable Migration/AddLimitToTextColumns + + def down + remove_column :dast_site_profiles, :scan_file_path, :text + end +end diff --git a/db/migrate/20220615172230_add_user_preference_to_turn_off_automatic_lists.rb b/db/migrate/20220615172230_add_user_preference_to_turn_off_automatic_lists.rb new file mode 100644 index 00000000000..4a0255aad06 --- /dev/null +++ b/db/migrate/20220615172230_add_user_preference_to_turn_off_automatic_lists.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddUserPreferenceToTurnOffAutomaticLists < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def up + add_column :user_preferences, :markdown_automatic_lists, :boolean, default: true, null: false + end + + def down + remove_column :user_preferences, :markdown_automatic_lists, :boolean + end +end diff --git a/db/migrate/20220802200719_add_user_details_profile_fields.rb b/db/migrate/20220802200719_add_user_details_profile_fields.rb new file mode 100644 index 00000000000..952b0bc1d9a --- /dev/null +++ b/db/migrate/20220802200719_add_user_details_profile_fields.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddUserDetailsProfileFields < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + # rubocop:disable Migration/AddLimitToTextColumns + # limits are added in 20220802202505_add_user_details_field_limits + def change + add_column :user_details, :linkedin, :text, null: false, default: '' + add_column :user_details, :twitter, :text, null: false, default: '' + add_column :user_details, :skype, :text, null: false, default: '' + add_column :user_details, :website_url, :text, null: false, default: '' + add_column :user_details, :location, :text, null: false, default: '' + add_column :user_details, :organization, :text, null: false, default: '' + end + # rubocop:enable Migration/AddLimitToTextColumns +end diff --git a/db/migrate/20220802202505_add_user_details_field_limits.rb b/db/migrate/20220802202505_add_user_details_field_limits.rb new file mode 100644 index 00000000000..83b6a4528d3 --- /dev/null +++ b/db/migrate/20220802202505_add_user_details_field_limits.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class AddUserDetailsFieldLimits < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + USER_DETAILS_FIELD_LIMIT = 500 + + def up + add_text_limit :user_details, :linkedin, USER_DETAILS_FIELD_LIMIT + add_text_limit :user_details, :twitter, USER_DETAILS_FIELD_LIMIT + add_text_limit :user_details, :skype, USER_DETAILS_FIELD_LIMIT + add_text_limit :user_details, :website_url, USER_DETAILS_FIELD_LIMIT + add_text_limit :user_details, :location, USER_DETAILS_FIELD_LIMIT + add_text_limit :user_details, :organization, USER_DETAILS_FIELD_LIMIT + end + + def down + remove_text_limit :user_details, :linkedin + remove_text_limit :user_details, :twitter + remove_text_limit :user_details, :skype + remove_text_limit :user_details, :website_url + remove_text_limit :user_details, :location + remove_text_limit :user_details, :organization + end +end diff --git a/db/migrate/20220805180311_add_unique_index_on_sbom_component_type_and_name.rb b/db/migrate/20220805180311_add_unique_index_on_sbom_component_type_and_name.rb new file mode 100644 index 00000000000..852b1283e92 --- /dev/null +++ b/db/migrate/20220805180311_add_unique_index_on_sbom_component_type_and_name.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddUniqueIndexOnSbomComponentTypeAndName < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_sbom_components_on_component_type_and_name' + + disable_ddl_transaction! + + def up + add_concurrent_index :sbom_components, [:component_type, :name], unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :sbom_components, name: INDEX_NAME + end +end diff --git a/db/migrate/20220805183952_add_unique_index_to_sbom_component_versions_on_component_id_and_version.rb b/db/migrate/20220805183952_add_unique_index_to_sbom_component_versions_on_component_id_and_version.rb new file mode 100644 index 00000000000..03023bc6f2c --- /dev/null +++ b/db/migrate/20220805183952_add_unique_index_to_sbom_component_versions_on_component_id_and_version.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddUniqueIndexToSbomComponentVersionsOnComponentIdAndVersion < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_sbom_component_versions_on_component_id_and_version' + + disable_ddl_transaction! + + def up + add_concurrent_index :sbom_component_versions, [:component_id, :version], unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :sbom_component_versions, name: INDEX_NAME + end +end diff --git a/db/migrate/20220805193117_add_unique_index_to_sbom_sources_on_source_type_and_source.rb b/db/migrate/20220805193117_add_unique_index_to_sbom_sources_on_source_type_and_source.rb new file mode 100644 index 00000000000..973cacaec5b --- /dev/null +++ b/db/migrate/20220805193117_add_unique_index_to_sbom_sources_on_source_type_and_source.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddUniqueIndexToSbomSourcesOnSourceTypeAndSource < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_sbom_sources_on_source_type_and_source' + + disable_ddl_transaction! + + def up + add_concurrent_index :sbom_sources, [:source_type, :source], unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :sbom_sources, name: INDEX_NAME + end +end diff --git a/db/migrate/20220818125332_add_jitsu_tracking_columns_to_application_settings.rb b/db/migrate/20220818125332_add_jitsu_tracking_columns_to_application_settings.rb new file mode 100644 index 00000000000..9013168c2c5 --- /dev/null +++ b/db/migrate/20220818125332_add_jitsu_tracking_columns_to_application_settings.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddJitsuTrackingColumnsToApplicationSettings < Gitlab::Database::Migration[2.0] + def change + # rubocop:disable Migration/AddLimitToTextColumns + # limit is added in 20220818125703_add_jitsu_tracking_columns_to_application_settings_text_limits.rb + add_column :application_settings, :jitsu_host, :text + add_column :application_settings, :jitsu_project_xid, :text + add_column :application_settings, :clickhouse_connection_string, :text + add_column :application_settings, :jitsu_administrator_email, :text + add_column :application_settings, :encrypted_jitsu_administrator_password, :binary + add_column :application_settings, :encrypted_jitsu_administrator_password_iv, :binary + # rubocop:enable Migration/AddLimitToTextColumns + end +end diff --git a/db/migrate/20220818125703_add_jitsu_tracking_columns_to_application_settings_text_limits.rb b/db/migrate/20220818125703_add_jitsu_tracking_columns_to_application_settings_text_limits.rb new file mode 100644 index 00000000000..41de6e34724 --- /dev/null +++ b/db/migrate/20220818125703_add_jitsu_tracking_columns_to_application_settings_text_limits.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddJitsuTrackingColumnsToApplicationSettingsTextLimits < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + add_text_limit :application_settings, :jitsu_host, 255 + add_text_limit :application_settings, :jitsu_project_xid, 255 + add_text_limit :application_settings, :clickhouse_connection_string, 1024 + add_text_limit :application_settings, :jitsu_administrator_email, 255 + end + + def down + remove_text_limit :application_settings, :jitsu_host + remove_text_limit :application_settings, :jitsu_project_xid + remove_text_limit :application_settings, :clickhouse_connection_string + remove_text_limit :application_settings, :jitsu_administrator_email + end +end diff --git a/db/migrate/20220818140553_add_unique_index_to_sbom_occurrences_on_ingestion_attributes.rb b/db/migrate/20220818140553_add_unique_index_to_sbom_occurrences_on_ingestion_attributes.rb new file mode 100644 index 00000000000..2538017e287 --- /dev/null +++ b/db/migrate/20220818140553_add_unique_index_to_sbom_occurrences_on_ingestion_attributes.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class AddUniqueIndexToSbomOccurrencesOnIngestionAttributes < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_sbom_occurrences_on_ingestion_attributes' + ATTRIBUTES = %i[ + project_id + component_id + component_version_id + source_id + commit_sha + ].freeze + + disable_ddl_transaction! + + def up + add_concurrent_index :sbom_occurrences, ATTRIBUTES, unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :sbom_occurrences, name: INDEX_NAME + end +end diff --git a/db/migrate/20220819184945_add_dashboard_limit_to_application_settings.rb b/db/migrate/20220819184945_add_dashboard_limit_to_application_settings.rb new file mode 100644 index 00000000000..f2ab4a043ea --- /dev/null +++ b/db/migrate/20220819184945_add_dashboard_limit_to_application_settings.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class AddDashboardLimitToApplicationSettings < Gitlab::Database::Migration[2.0] + def change + add_column :application_settings, :dashboard_limit_enabled, :boolean, default: false, null: false + add_column :application_settings, :dashboard_limit, :integer, default: 0, null: false + add_column :application_settings, :dashboard_notification_limit, :integer, default: 0, null: false + add_column :application_settings, :dashboard_enforcement_limit, :integer, default: 0, null: false + add_column :application_settings, :dashboard_limit_new_namespace_creation_enforcement_date, :date + end +end diff --git a/db/migrate/20220901090004_add_can_create_group_to_application_settings.rb b/db/migrate/20220901090004_add_can_create_group_to_application_settings.rb new file mode 100644 index 00000000000..a61f7c9a080 --- /dev/null +++ b/db/migrate/20220901090004_add_can_create_group_to_application_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddCanCreateGroupToApplicationSettings < Gitlab::Database::Migration[2.0] + def change + add_column(:application_settings, :can_create_group, :boolean, default: true, null: false) + end +end diff --git a/db/migrate/20220901092853_update_can_create_group_application_setting.rb b/db/migrate/20220901092853_update_can_create_group_application_setting.rb new file mode 100644 index 00000000000..42508184d62 --- /dev/null +++ b/db/migrate/20220901092853_update_can_create_group_application_setting.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class UpdateCanCreateGroupApplicationSetting < Gitlab::Database::Migration[2.0] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + value = gitlab_config.respond_to?(:default_can_create_group) ? gitlab_config.default_can_create_group : true + value = Gitlab::Utils.to_boolean(value, default: true) + + execute_update(value: value) + end + + def down + execute_update(value: true) + end + + private + + def execute_update(value:) + execute "UPDATE application_settings SET can_create_group = #{value}" + end + + def gitlab_config + Gitlab.config.gitlab + end +end diff --git a/db/migrate/20220901114501_only_allow_merge_if_all_status_checks_passed.rb b/db/migrate/20220901114501_only_allow_merge_if_all_status_checks_passed.rb new file mode 100644 index 00000000000..059ed657264 --- /dev/null +++ b/db/migrate/20220901114501_only_allow_merge_if_all_status_checks_passed.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class OnlyAllowMergeIfAllStatusChecksPassed < Gitlab::Database::Migration[2.0] + def change + add_column :project_settings, :only_allow_merge_if_all_status_checks_passed, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20220907115806_add_security_orchestration_policy_configuration_id.rb b/db/migrate/20220907115806_add_security_orchestration_policy_configuration_id.rb new file mode 100644 index 00000000000..de83288a0ca --- /dev/null +++ b/db/migrate/20220907115806_add_security_orchestration_policy_configuration_id.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +class AddSecurityOrchestrationPolicyConfigurationId < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + PROJECT_INDEX_NAME = 'idx_approval_project_rules_on_sec_orchestration_config_id' + MERGE_REQUEST_INDEX_NAME = 'idx_approval_merge_request_rules_on_sec_orchestration_config_id' + + def up + with_lock_retries do + unless column_exists?(:approval_project_rules, :security_orchestration_policy_configuration_id) + add_column :approval_project_rules, :security_orchestration_policy_configuration_id, :bigint + end + end + + with_lock_retries do + unless column_exists?(:approval_merge_request_rules, :security_orchestration_policy_configuration_id) + add_column :approval_merge_request_rules, :security_orchestration_policy_configuration_id, :bigint + end + end + + add_concurrent_index :approval_project_rules, + :security_orchestration_policy_configuration_id, + name: PROJECT_INDEX_NAME + add_concurrent_index :approval_merge_request_rules, + :security_orchestration_policy_configuration_id, + name: MERGE_REQUEST_INDEX_NAME + + add_concurrent_foreign_key :approval_project_rules, + :security_orchestration_policy_configurations, + column: :security_orchestration_policy_configuration_id, + on_delete: :cascade + add_concurrent_foreign_key :approval_merge_request_rules, + :security_orchestration_policy_configurations, + column: :security_orchestration_policy_configuration_id, + on_delete: :cascade + end + + def down + with_lock_retries do + if column_exists?(:approval_project_rules, :security_orchestration_policy_configuration_id) + remove_column :approval_project_rules, :security_orchestration_policy_configuration_id + end + end + + with_lock_retries do + if column_exists?(:approval_merge_request_rules, :security_orchestration_policy_configuration_id) + remove_column :approval_merge_request_rules, :security_orchestration_policy_configuration_id + end + end + + remove_foreign_key_if_exists :approval_project_rules, column: :security_orchestration_policy_configuration_id + remove_foreign_key_if_exists :approval_merge_request_rules, column: :security_orchestration_policy_configuration_id + + remove_concurrent_index_by_name :approval_project_rules, name: PROJECT_INDEX_NAME + remove_concurrent_index_by_name :approval_merge_request_rules, name: MERGE_REQUEST_INDEX_NAME + end +end diff --git a/db/migrate/20220912153839_create_packages_rpm_repository_file.rb b/db/migrate/20220912153839_create_packages_rpm_repository_file.rb new file mode 100644 index 00000000000..889720df233 --- /dev/null +++ b/db/migrate/20220912153839_create_packages_rpm_repository_file.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class CreatePackagesRpmRepositoryFile < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def up + create_table :packages_rpm_repository_files do |t| + t.timestamps_with_timezone + + t.references :project, index: true, null: false, foreign_key: { on_delete: :cascade }, type: :bigint + t.integer :file_store, default: 1 + t.integer :status, default: 0, null: false, limit: 2 + t.integer :size + t.binary :file_md5 + t.binary :file_sha1 + t.binary :file_sha256 + t.text :file, null: false, limit: 255 + t.text :file_name, null: false, limit: 255 + end + end + + def down + drop_table :packages_rpm_repository_files + end +end diff --git a/db/migrate/20220913043728_create_user_phone_number_validations.rb b/db/migrate/20220913043728_create_user_phone_number_validations.rb new file mode 100644 index 00000000000..21a5b4d5519 --- /dev/null +++ b/db/migrate/20220913043728_create_user_phone_number_validations.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class CreateUserPhoneNumberValidations < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def up + create_table :user_phone_number_validations, id: false do |t| + t.references :user, primary_key: true, default: nil, type: :bigint, index: false, + foreign_key: { on_delete: :cascade } + + t.datetime_with_timezone :validated_at + t.timestamps_with_timezone null: false + + t.integer :international_dial_code, null: false, limit: 1 + t.integer :verification_attempts, null: false, default: 0, limit: 1 + t.integer :risk_score, null: false, default: 0, limit: 1 + + t.text :country, null: false, limit: 3 + t.text :phone_number, null: false, limit: 12 + t.text :telesign_reference_xid, limit: 255 + + t.index [:international_dial_code, :phone_number], name: :index_user_phone_validations_on_dial_code_phone_number + end + end + + def down + drop_table :user_phone_number_validations + end +end diff --git a/db/migrate/20220913082824_finalize_invalid_group_member_cleanup.rb b/db/migrate/20220913082824_finalize_invalid_group_member_cleanup.rb new file mode 100644 index 00000000000..d5fb04f3fa3 --- /dev/null +++ b/db/migrate/20220913082824_finalize_invalid_group_member_cleanup.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class FinalizeInvalidGroupMemberCleanup < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + # noop: this fails because the cleanup invalid members migration(ScheduleDestroyInvalidGroupMembers) + # cannot succeed, so we need to cleanup that first. + # + # issue with some details: https://gitlab.com/gitlab-org/gitlab/-/issues/365028#note_1107166816 + # # incident: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/7779 + end + + def down + # noop + end +end diff --git a/db/migrate/20220913084123_add_timestamp_to_ml_candidate_metrics.rb b/db/migrate/20220913084123_add_timestamp_to_ml_candidate_metrics.rb new file mode 100644 index 00000000000..293bca2d6d7 --- /dev/null +++ b/db/migrate/20220913084123_add_timestamp_to_ml_candidate_metrics.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddTimestampToMlCandidateMetrics < Gitlab::Database::Migration[2.0] + def change + add_column :ml_candidate_metrics, :tracked_at, :bigint + end +end diff --git a/db/migrate/20220914070927_finalize_invalid_project_member_cleanup.rb b/db/migrate/20220914070927_finalize_invalid_project_member_cleanup.rb new file mode 100644 index 00000000000..30f6519ed0f --- /dev/null +++ b/db/migrate/20220914070927_finalize_invalid_project_member_cleanup.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class FinalizeInvalidProjectMemberCleanup < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + # noop: this fails because the cleanup invalid members migration(ScheduleDestroyInvalidProjectMembers) + # cannot succeed, so we need to cleanup that first. + # + # issue with some details: https://gitlab.com/gitlab-org/gitlab/-/issues/365028#note_1107166816 + # # incident: https://gitlab.com/gitlab-com/gl-infra/production/-/issues/7779 + end + + def down + # noop + end +end diff --git a/db/migrate/20220914080716_add_index_to_candidate_id_and_name_on_ml_candidate_params.rb b/db/migrate/20220914080716_add_index_to_candidate_id_and_name_on_ml_candidate_params.rb new file mode 100644 index 00000000000..caf30961ace --- /dev/null +++ b/db/migrate/20220914080716_add_index_to_candidate_id_and_name_on_ml_candidate_params.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToCandidateIdAndNameOnMlCandidateParams < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_ml_candidate_params_on_candidate_id_on_name' + + def up + add_concurrent_index :ml_candidate_params, [:candidate_id, :name], unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name(:ml_candidate_params, INDEX_NAME) + end +end diff --git a/db/migrate/20220914112457_add_reject_non_dco_commits_to_push_rules.rb b/db/migrate/20220914112457_add_reject_non_dco_commits_to_push_rules.rb new file mode 100644 index 00000000000..57b3c209660 --- /dev/null +++ b/db/migrate/20220914112457_add_reject_non_dco_commits_to_push_rules.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddRejectNonDcoCommitsToPushRules < Gitlab::Database::Migration[2.0] + def change + add_column :push_rules, :reject_non_dco_commits, :boolean + end +end diff --git a/db/migrate/20220914130800_add_jitsu_key_to_projects.rb b/db/migrate/20220914130800_add_jitsu_key_to_projects.rb new file mode 100644 index 00000000000..91c0695c4a6 --- /dev/null +++ b/db/migrate/20220914130800_add_jitsu_key_to_projects.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +# rubocop:disable Migration/AddLimitToTextColumns +# limit is added in 20220914131449_add_text_limit_to_projects_jitsu_key.rb +class AddJitsuKeyToProjects < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + with_lock_retries do + add_column :project_settings, :jitsu_key, :text + end + end + + def down + with_lock_retries do + remove_column :project_settings, :jitsu_key + end + end +end +# rubocop:enable Migration/AddLimitToTextColumns diff --git a/db/migrate/20220914131449_add_text_limit_to_projects_jitsu_key.rb b/db/migrate/20220914131449_add_text_limit_to_projects_jitsu_key.rb new file mode 100644 index 00000000000..93aa27ffaa2 --- /dev/null +++ b/db/migrate/20220914131449_add_text_limit_to_projects_jitsu_key.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddTextLimitToProjectsJitsuKey < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + add_text_limit :project_settings, :jitsu_key, 100 + end + + def down + remove_text_limit :project_settings, :jitsu_key + end +end diff --git a/db/migrate/20220914174705_remove_not_null_constraint_from_sbom_source_fingerprint.rb b/db/migrate/20220914174705_remove_not_null_constraint_from_sbom_source_fingerprint.rb new file mode 100644 index 00000000000..6e819b1cdef --- /dev/null +++ b/db/migrate/20220914174705_remove_not_null_constraint_from_sbom_source_fingerprint.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class RemoveNotNullConstraintFromSbomSourceFingerprint < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def change + change_column_null :sbom_sources, :fingerprint, true + end +end diff --git a/db/migrate/20220916094641_add_source_id_to_bulk_import_entities.rb b/db/migrate/20220916094641_add_source_id_to_bulk_import_entities.rb new file mode 100644 index 00000000000..b077fee9045 --- /dev/null +++ b/db/migrate/20220916094641_add_source_id_to_bulk_import_entities.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddSourceIdToBulkImportEntities < Gitlab::Database::Migration[2.0] + def change + add_column :bulk_import_entities, :source_xid, :integer + end +end diff --git a/db/migrate/20220916103311_add_index_on_jira_connect_installations_instance_url.rb b/db/migrate/20220916103311_add_index_on_jira_connect_installations_instance_url.rb new file mode 100644 index 00000000000..806c7d65f16 --- /dev/null +++ b/db/migrate/20220916103311_add_index_on_jira_connect_installations_instance_url.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnJiraConnectInstallationsInstanceUrl < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_jira_connect_installations_on_instance_url' + + def up + add_concurrent_index :jira_connect_installations, :instance_url, name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :jira_connect_installations, name: INDEX_NAME + end +end diff --git a/db/migrate/20220918124223_add_suggested_reviewers_enabled_to_project_settings.rb b/db/migrate/20220918124223_add_suggested_reviewers_enabled_to_project_settings.rb new file mode 100644 index 00000000000..1a762d68bdc --- /dev/null +++ b/db/migrate/20220918124223_add_suggested_reviewers_enabled_to_project_settings.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddSuggestedReviewersEnabledToProjectSettings < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def change + add_column :project_settings, :suggested_reviewers_enabled, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20220919225631_add_index_packages_packages_on_project_id_and_lower_version_to_packages.rb b/db/migrate/20220919225631_add_index_packages_packages_on_project_id_and_lower_version_to_packages.rb new file mode 100644 index 00000000000..23b58522639 --- /dev/null +++ b/db/migrate/20220919225631_add_index_packages_packages_on_project_id_and_lower_version_to_packages.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class AddIndexPackagesPackagesOnProjectIdAndLowerVersionToPackages < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_packages_packages_on_project_id_and_lower_version' + NUGET_PACKAGE_TYPE = 4 + + def up + add_concurrent_index( + :packages_packages, + 'project_id, LOWER(version)', + name: INDEX_NAME, + where: "package_type = #{NUGET_PACKAGE_TYPE}" + ) + end + + def down + remove_concurrent_index_by_name(:packages_packages, INDEX_NAME) + end +end diff --git a/db/migrate/20220920022404_remove_temp_index_null_project_namespace_id.rb b/db/migrate/20220920022404_remove_temp_index_null_project_namespace_id.rb new file mode 100644 index 00000000000..5541afcee40 --- /dev/null +++ b/db/migrate/20220920022404_remove_temp_index_null_project_namespace_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveTempIndexNullProjectNamespaceId < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'tmp_index_for_null_project_namespace_id' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :projects, INDEX_NAME + end + + def down + add_concurrent_index :projects, :id, name: INDEX_NAME, where: 'project_namespace_id IS NULL' + end +end diff --git a/db/migrate/20220921174815_add_secure_files_metadata.rb b/db/migrate/20220921174815_add_secure_files_metadata.rb new file mode 100644 index 00000000000..74cc1d95867 --- /dev/null +++ b/db/migrate/20220921174815_add_secure_files_metadata.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class AddSecureFilesMetadata < Gitlab::Database::Migration[2.0] + def change + add_column :ci_secure_files, :metadata, :jsonb + add_column :ci_secure_files, :expires_at, :datetime_with_timezone + end +end diff --git a/db/migrate/20220921201347_add_maven_package_requests_forwarding_to_namespace_package_settings.rb b/db/migrate/20220921201347_add_maven_package_requests_forwarding_to_namespace_package_settings.rb new file mode 100644 index 00000000000..8f858eb7960 --- /dev/null +++ b/db/migrate/20220921201347_add_maven_package_requests_forwarding_to_namespace_package_settings.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class AddMavenPackageRequestsForwardingToNamespacePackageSettings < Gitlab::Database::Migration[2.0] + def change + # adds columns to match the format used in + # Gitlab::Database::MigrationHelpers::CascadingNamespaceSettings#add_cascading_namespace_setting + add_column(:namespace_package_settings, + :maven_package_requests_forwarding, + :boolean, + null: true, + default: nil + ) + + add_column(:namespace_package_settings, + :lock_maven_package_requests_forwarding, + :boolean, + default: false, + null: false + ) + + add_column(:application_settings, + :lock_maven_package_requests_forwarding, + :boolean, + default: false, + null: false + ) + end +end diff --git a/db/migrate/20220922143612_add_inbound_ci_job_token_project_scope_links.rb b/db/migrate/20220922143612_add_inbound_ci_job_token_project_scope_links.rb new file mode 100644 index 00000000000..50b43ee4db8 --- /dev/null +++ b/db/migrate/20220922143612_add_inbound_ci_job_token_project_scope_links.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddInboundCiJobTokenProjectScopeLinks < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def up + add_column :ci_job_token_project_scope_links, :direction, :integer, limit: 2, default: 0, null: false + end + + def down + remove_column :ci_job_token_project_scope_links, :direction + end +end diff --git a/db/migrate/20220923103006_add_ci_pipeline_metadata_title.rb b/db/migrate/20220923103006_add_ci_pipeline_metadata_title.rb new file mode 100644 index 00000000000..3b2f02924a1 --- /dev/null +++ b/db/migrate/20220923103006_add_ci_pipeline_metadata_title.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class AddCiPipelineMetadataTitle < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def up + create_table :ci_pipeline_metadata, id: false do |t| + t.bigint :project_id, null: false + + t.references :pipeline, + null: false, + primary_key: true, + default: nil, + index: false, + foreign_key: { to_table: :ci_pipelines, on_delete: :cascade } + + t.text :title, null: false, limit: 255 + + t.index [:pipeline_id, :title], name: 'index_ci_pipeline_metadata_on_pipeline_id_title' + t.index [:project_id], name: 'index_ci_pipeline_metadata_on_project_id' + end + end + + def down + drop_table :ci_pipeline_metadata + end +end diff --git a/db/migrate/20220927155407_add_column_inbound_job_token_scope_enabled_to_ci_cd_setting.rb b/db/migrate/20220927155407_add_column_inbound_job_token_scope_enabled_to_ci_cd_setting.rb new file mode 100644 index 00000000000..811138cd2f2 --- /dev/null +++ b/db/migrate/20220927155407_add_column_inbound_job_token_scope_enabled_to_ci_cd_setting.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddColumnInboundJobTokenScopeEnabledToCiCdSetting < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def up + add_column :project_ci_cd_settings, :inbound_job_token_scope_enabled, :boolean, default: false, null: false + end + + def down + remove_column :project_ci_cd_settings, :inbound_job_token_scope_enabled + end +end diff --git a/db/migrate/20220928201920_create_project_wiki_repository_states.rb b/db/migrate/20220928201920_create_project_wiki_repository_states.rb new file mode 100644 index 00000000000..17ad5cf6b7a --- /dev/null +++ b/db/migrate/20220928201920_create_project_wiki_repository_states.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +class CreateProjectWikiRepositoryStates < Gitlab::Database::Migration[2.0] + VERIFICATION_STATE_INDEX_NAME = "index_project_wiki_repository_states_on_verification_state" + PENDING_VERIFICATION_INDEX_NAME = "index_project_wiki_repository_states_pending_verification" + FAILED_VERIFICATION_INDEX_NAME = "index_project_wiki_repository_states_failed_verification" + NEEDS_VERIFICATION_INDEX_NAME = "index_project_wiki_repository_states_needs_verification" + + enable_lock_retries! + + def up + create_table :project_wiki_repository_states, id: false do |t| + t.datetime_with_timezone :verification_started_at + t.datetime_with_timezone :verification_retry_at + t.datetime_with_timezone :verified_at + t.references :project, primary_key: true, default: nil, index: false, foreign_key: { on_delete: :cascade } + t.integer :verification_state, default: 0, limit: 2, null: false + t.integer :verification_retry_count, limit: 2 + t.binary :verification_checksum, using: 'verification_checksum::bytea' + t.text :verification_failure, limit: 255 + + t.index :verification_state, + name: VERIFICATION_STATE_INDEX_NAME + + t.index :verified_at, + where: "(verification_state = 0)", + order: { verified_at: 'ASC NULLS FIRST' }, + name: PENDING_VERIFICATION_INDEX_NAME + + t.index :verification_retry_at, + where: "(verification_state = 3)", + order: { verification_retry_at: 'ASC NULLS FIRST' }, + name: FAILED_VERIFICATION_INDEX_NAME + + t.index :verification_state, + where: "(verification_state = 0 OR verification_state = 3)", + name: NEEDS_VERIFICATION_INDEX_NAME + end + end + + def down + drop_table :project_wiki_repository_states + end +end diff --git a/db/migrate/20220929171925_add_pypi_package_requests_forwarding_to_namespace_package_settings.rb b/db/migrate/20220929171925_add_pypi_package_requests_forwarding_to_namespace_package_settings.rb new file mode 100644 index 00000000000..e99640d471f --- /dev/null +++ b/db/migrate/20220929171925_add_pypi_package_requests_forwarding_to_namespace_package_settings.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class AddPypiPackageRequestsForwardingToNamespacePackageSettings < Gitlab::Database::Migration[2.0] + def change + # adds columns to match the format used in + # Gitlab::Database::MigrationHelpers::CascadingNamespaceSettings#add_cascading_namespace_setting + add_column(:namespace_package_settings, + :pypi_package_requests_forwarding, + :boolean, + null: true, + default: nil + ) + + add_column(:namespace_package_settings, + :lock_pypi_package_requests_forwarding, + :boolean, + default: false, + null: false + ) + + add_column(:application_settings, + :lock_pypi_package_requests_forwarding, + :boolean, + default: false, + null: false + ) + end +end diff --git a/db/migrate/20220929172356_add_npm_package_requests_forwarding_to_namespace_package_settings.rb b/db/migrate/20220929172356_add_npm_package_requests_forwarding_to_namespace_package_settings.rb new file mode 100644 index 00000000000..61cc2c26ec7 --- /dev/null +++ b/db/migrate/20220929172356_add_npm_package_requests_forwarding_to_namespace_package_settings.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class AddNpmPackageRequestsForwardingToNamespacePackageSettings < Gitlab::Database::Migration[2.0] + def change + # adds columns to match the format used in + # Gitlab::Database::MigrationHelpers::CascadingNamespaceSettings#add_cascading_namespace_setting + add_column(:namespace_package_settings, + :npm_package_requests_forwarding, + :boolean, + null: true, + default: nil + ) + + add_column(:namespace_package_settings, + :lock_npm_package_requests_forwarding, + :boolean, + default: false, + null: false + ) + + add_column(:application_settings, + :lock_npm_package_requests_forwarding, + :boolean, + default: false, + null: false + ) + end +end diff --git a/db/migrate/20220930125609_add_migrated_to_state_transition_to_vulnerability_feedback.rb b/db/migrate/20220930125609_add_migrated_to_state_transition_to_vulnerability_feedback.rb new file mode 100644 index 00000000000..b6736a71761 --- /dev/null +++ b/db/migrate/20220930125609_add_migrated_to_state_transition_to_vulnerability_feedback.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddMigratedToStateTransitionToVulnerabilityFeedback < Gitlab::Database::Migration[2.0] + def change + add_column :vulnerability_feedback, :migrated_to_state_transition, :boolean, default: false + end +end diff --git a/db/migrate/20221005072353_create_incident_management_timeline_event_tags.rb b/db/migrate/20221005072353_create_incident_management_timeline_event_tags.rb new file mode 100644 index 00000000000..c046548af01 --- /dev/null +++ b/db/migrate/20221005072353_create_incident_management_timeline_event_tags.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class CreateIncidentManagementTimelineEventTags < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def up + create_table :incident_management_timeline_event_tags do |t| + t.timestamps_with_timezone null: false + t.references :project, null: false, index: false, foreign_key: { on_delete: :cascade } + t.text :name, limit: 255, null: false + + t.index [:project_id, :name], unique: true, name: 'index_im_timeline_event_tags_name_project_id' + end + end + + def down + drop_table :incident_management_timeline_event_tags + end +end diff --git a/db/migrate/20221005094926_create_incident_management_timeline_event_tag_links.rb b/db/migrate/20221005094926_create_incident_management_timeline_event_tag_links.rb new file mode 100644 index 00000000000..b3ec8f97738 --- /dev/null +++ b/db/migrate/20221005094926_create_incident_management_timeline_event_tag_links.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +class CreateIncidentManagementTimelineEventTagLinks < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def up + create_table :incident_management_timeline_event_tag_links do |t| + t.references :timeline_event, + null: false, + index: { name: 'index_im_timeline_event_id' }, + foreign_key: { to_table: :incident_management_timeline_events, column: :timeline_event_id, on_delete: :cascade } + + t.references :timeline_event_tag, + null: false, + index: false, + foreign_key: { + to_table: :incident_management_timeline_event_tags, + column: :timeline_event_tag_id, + on_delete: :cascade + } + + t.index [:timeline_event_tag_id, :timeline_event_id], + unique: true, + name: 'index_im_timeline_event_tags_on_tag_id_and_event_id' + + t.datetime_with_timezone :created_at, null: false + end + end + + def down + drop_table :incident_management_timeline_event_tag_links + end +end diff --git a/db/migrate/20221005103010_add_index_project_id_on_scan_finding_approval_project_rules.rb b/db/migrate/20221005103010_add_index_project_id_on_scan_finding_approval_project_rules.rb new file mode 100644 index 00000000000..990188aa418 --- /dev/null +++ b/db/migrate/20221005103010_add_index_project_id_on_scan_finding_approval_project_rules.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class AddIndexProjectIdOnScanFindingApprovalProjectRules < Gitlab::Database::Migration[2.0] + INDEX_NAME_ALL = 'scan_finding_approval_project_rule_index_project_id' + INDEX_NAME_28D = 'scan_finding_approval_project_rule_index_created_at_project_id' + SCAN_FINDING_REPORT_TYPE = 4 + + disable_ddl_transaction! + + def up + add_concurrent_index :approval_project_rules, %i[created_at project_id], + where: "report_type = #{SCAN_FINDING_REPORT_TYPE}", name: INDEX_NAME_28D + + add_concurrent_index :approval_project_rules, :project_id, + where: "report_type = #{SCAN_FINDING_REPORT_TYPE}", name: INDEX_NAME_ALL + end + + def down + remove_concurrent_index_by_name :approval_project_rules, INDEX_NAME_ALL + remove_concurrent_index_by_name :approval_project_rules, INDEX_NAME_28D + end +end diff --git a/db/migrate/20221006131506_add_free_user_cap_over_limit_notified_at_to_namespace_details.rb b/db/migrate/20221006131506_add_free_user_cap_over_limit_notified_at_to_namespace_details.rb new file mode 100644 index 00000000000..7237eee18f0 --- /dev/null +++ b/db/migrate/20221006131506_add_free_user_cap_over_limit_notified_at_to_namespace_details.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +class AddFreeUserCapOverLimitNotifiedAtToNamespaceDetails < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + TABLE_NAME = 'namespace_details' + COLUMN_NAME = 'free_user_cap_over_limit_notified_at' + + def up + with_lock_retries do + add_column(TABLE_NAME, COLUMN_NAME, :datetime_with_timezone) + end + end + + def down + with_lock_retries do + remove_column TABLE_NAME, COLUMN_NAME + end + end +end diff --git a/db/migrate/20221006141145_add_targets_to_elastic_reindexing_tasks.rb b/db/migrate/20221006141145_add_targets_to_elastic_reindexing_tasks.rb new file mode 100644 index 00000000000..1631f8ae57e --- /dev/null +++ b/db/migrate/20221006141145_add_targets_to_elastic_reindexing_tasks.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddTargetsToElasticReindexingTasks < Gitlab::Database::Migration[2.0] + def change + add_column :elastic_reindexing_tasks, :targets, :text, array: true + end +end diff --git a/db/migrate/20221008032350_add_password_expiration_migration.rb b/db/migrate/20221008032350_add_password_expiration_migration.rb new file mode 100644 index 00000000000..7dbc73294bb --- /dev/null +++ b/db/migrate/20221008032350_add_password_expiration_migration.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class AddPasswordExpirationMigration < Gitlab::Database::Migration[2.0] + def change + add_column :application_settings, :password_expiration_enabled, :boolean, default: false, null: false, + comment: 'JiHu-specific column' + add_column :application_settings, :password_expires_in_days, :integer, default: 90, null: false, + comment: 'JiHu-specific column' + add_column :application_settings, :password_expires_notice_before_days, :integer, default: 7, null: false, + comment: 'JiHu-specific column' + end +end diff --git a/db/migrate/20221009085130_add_mr_checks_columns_to_namespace_settings.rb b/db/migrate/20221009085130_add_mr_checks_columns_to_namespace_settings.rb new file mode 100644 index 00000000000..947a662575a --- /dev/null +++ b/db/migrate/20221009085130_add_mr_checks_columns_to_namespace_settings.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class AddMrChecksColumnsToNamespaceSettings < Gitlab::Database::Migration[2.0] + def change + add_column :namespace_settings, :only_allow_merge_if_pipeline_succeeds, :boolean, default: false, null: false + add_column :namespace_settings, :allow_merge_on_skipped_pipeline, :boolean, default: false, null: false + add_column :namespace_settings, :only_allow_merge_if_all_discussions_are_resolved, \ + :boolean, default: false, null: false + end +end diff --git a/db/migrate/20221011162637_add_partial_index_project_incident_management_settings_on_project_id_and_sla_timer.rb b/db/migrate/20221011162637_add_partial_index_project_incident_management_settings_on_project_id_and_sla_timer.rb new file mode 100644 index 00000000000..4238311005c --- /dev/null +++ b/db/migrate/20221011162637_add_partial_index_project_incident_management_settings_on_project_id_and_sla_timer.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddPartialIndexProjectIncidentManagementSettingsOnProjectIdAndSlaTimer < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_project_incident_management_settings_on_p_id_sla_timer' + + def up + add_concurrent_index :project_incident_management_settings, :project_id, + name: INDEX_NAME, + where: 'sla_timer = TRUE' + end + + def down + remove_concurrent_index_by_name :project_incident_management_settings, name: INDEX_NAME + end +end diff --git a/db/migrate/20221011210455_add_use_legacy_web_ide_to_user_preferences.rb b/db/migrate/20221011210455_add_use_legacy_web_ide_to_user_preferences.rb new file mode 100644 index 00000000000..1b434e10ab0 --- /dev/null +++ b/db/migrate/20221011210455_add_use_legacy_web_ide_to_user_preferences.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddUseLegacyWebIdeToUserPreferences < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def change + add_column :user_preferences, :use_legacy_web_ide, :boolean, default: false, null: false + end +end diff --git a/db/migrate/20221012033107_add_password_last_changed_at_to_user_details.rb b/db/migrate/20221012033107_add_password_last_changed_at_to_user_details.rb new file mode 100644 index 00000000000..db2f411ab92 --- /dev/null +++ b/db/migrate/20221012033107_add_password_last_changed_at_to_user_details.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class AddPasswordLastChangedAtToUserDetails < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def change + add_column :user_details, :password_last_changed_at, :datetime_with_timezone, comment: 'JiHu-specific column' + end +end diff --git a/db/migrate/20221012135524_add_scan_file_path_limit_for_dast_site_profile.rb b/db/migrate/20221012135524_add_scan_file_path_limit_for_dast_site_profile.rb new file mode 100644 index 00000000000..ab8846c8043 --- /dev/null +++ b/db/migrate/20221012135524_add_scan_file_path_limit_for_dast_site_profile.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class AddScanFilePathLimitForDastSiteProfile < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + add_text_limit :dast_site_profiles, :scan_file_path, 1024 + end + + def down + remove_text_limit :dast_site_profiles, :scan_file_path + end +end diff --git a/db/migrate/20221014031033_add_temp_index_to_project_features_where_releases_access_level_gt_repository.rb b/db/migrate/20221014031033_add_temp_index_to_project_features_where_releases_access_level_gt_repository.rb new file mode 100644 index 00000000000..14077e30780 --- /dev/null +++ b/db/migrate/20221014031033_add_temp_index_to_project_features_where_releases_access_level_gt_repository.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddTempIndexToProjectFeaturesWhereReleasesAccessLevelGtRepository < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'tmp_idx_project_features_on_releases_al_and_repo_al_partial' + + # Temporary index to be removed in 15.6 https://gitlab.com/gitlab-org/gitlab/-/issues/377915 + def up + add_concurrent_index :project_features, + [:releases_access_level, :repository_access_level], + name: INDEX_NAME, + where: 'releases_access_level > repository_access_level' + end + + def down + remove_concurrent_index_by_name :project_features, INDEX_NAME + end +end diff --git a/db/migrate/20221014034338_populate_releases_access_level_from_repository.rb b/db/migrate/20221014034338_populate_releases_access_level_from_repository.rb new file mode 100644 index 00000000000..6e61d972bf6 --- /dev/null +++ b/db/migrate/20221014034338_populate_releases_access_level_from_repository.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class PopulateReleasesAccessLevelFromRepository < Gitlab::Database::Migration[2.0] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + disable_ddl_transaction! + + def up + update_column_in_batches( + :project_features, + :releases_access_level, + Arel.sql('repository_access_level') + ) do |table, query| + query.where(table[:releases_access_level].gt(table[:repository_access_level])) + end + end + + def down + # no-op + end +end diff --git a/db/migrate/20221014190040_drop_notes_note_trigram_index.rb b/db/migrate/20221014190040_drop_notes_note_trigram_index.rb new file mode 100644 index 00000000000..efa35b24d98 --- /dev/null +++ b/db/migrate/20221014190040_drop_notes_note_trigram_index.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class DropNotesNoteTrigramIndex < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_notes_on_note_gin_trigram' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :notes, INDEX_NAME + end + + def down + # no-op + # we never want to add this index back since it doesn't exist in production + # we are only using this migration to cleanup other environments where this index does exist + end +end diff --git a/db/migrate/20221018081416_members_remove_member_namespace_id_not_null_constraint.rb b/db/migrate/20221018081416_members_remove_member_namespace_id_not_null_constraint.rb new file mode 100644 index 00000000000..e4cbcd24bc4 --- /dev/null +++ b/db/migrate/20221018081416_members_remove_member_namespace_id_not_null_constraint.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class MembersRemoveMemberNamespaceIdNotNullConstraint < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + CONSTRAINT_NAME = 'check_508774aac0' + + def up + remove_not_null_constraint :members, :member_namespace_id, constraint_name: CONSTRAINT_NAME + end + + def down + add_not_null_constraint :members, :member_namespace_id, validate: false, constraint_name: CONSTRAINT_NAME + end +end diff --git a/db/post_migrate/20220809002011_schedule_destroy_invalid_group_members.rb b/db/post_migrate/20220809002011_schedule_destroy_invalid_group_members.rb index 3db21c290b9..e5d97d890ab 100644 --- a/db/post_migrate/20220809002011_schedule_destroy_invalid_group_members.rb +++ b/db/post_migrate/20220809002011_schedule_destroy_invalid_group_members.rb @@ -12,19 +12,11 @@ class ScheduleDestroyInvalidGroupMembers < Gitlab::Database::Migration[2.0] disable_ddl_transaction! def up - queue_batched_background_migration( - MIGRATION, - :members, - :id, - job_interval: DELAY_INTERVAL, - batch_size: BATCH_SIZE, - max_batch_size: MAX_BATCH_SIZE, - sub_batch_size: SUB_BATCH_SIZE, - gitlab_schema: :gitlab_main - ) + # no-op + # We want to no-op this due to potential inconsistencies in SM upgrade path end def down - delete_batched_background_migration(MIGRATION, :members, :id, []) + # no-op end end diff --git a/db/post_migrate/20220831090454_cleanup_web_hooks_service_id.rb b/db/post_migrate/20220831090454_cleanup_web_hooks_service_id.rb new file mode 100644 index 00000000000..7beb89038e5 --- /dev/null +++ b/db/post_migrate/20220831090454_cleanup_web_hooks_service_id.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class CleanupWebHooksServiceId < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + cleanup_concurrent_column_rename :web_hooks, :service_id, :integration_id + end + + def down + undo_cleanup_concurrent_column_rename :web_hooks, :service_id, :integration_id + end +end diff --git a/db/post_migrate/20220901035725_schedule_destroy_invalid_project_members.rb b/db/post_migrate/20220901035725_schedule_destroy_invalid_project_members.rb index bc90232f855..9de3ac34669 100644 --- a/db/post_migrate/20220901035725_schedule_destroy_invalid_project_members.rb +++ b/db/post_migrate/20220901035725_schedule_destroy_invalid_project_members.rb @@ -10,19 +10,11 @@ class ScheduleDestroyInvalidProjectMembers < Gitlab::Database::Migration[2.0] restrict_gitlab_migration gitlab_schema: :gitlab_main def up - queue_batched_background_migration( - MIGRATION, - :members, - :id, - job_interval: DELAY_INTERVAL, - batch_size: BATCH_SIZE, - max_batch_size: MAX_BATCH_SIZE, - sub_batch_size: SUB_BATCH_SIZE, - gitlab_schema: :gitlab_main - ) + # no-op + # We want to no-op this due to potential inconsistencies in SM upgrade path end def down - delete_batched_background_migration(MIGRATION, :members, :id, []) + # no-op end end diff --git a/db/post_migrate/20220905120848_backfill_epic_cache_counts.rb b/db/post_migrate/20220905120848_backfill_epic_cache_counts.rb new file mode 100644 index 00000000000..32fe04eb99c --- /dev/null +++ b/db/post_migrate/20220905120848_backfill_epic_cache_counts.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class BackfillEpicCacheCounts < Gitlab::Database::Migration[2.0] + MIGRATION = 'BackfillEpicCacheCounts' + DELAY_INTERVAL = 2.minutes.to_i + BATCH_SIZE = 200 + MAX_BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 20 + + disable_ddl_transaction! + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :epics, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE, + gitlab_schema: :gitlab_main + ) + end + + def down + delete_batched_background_migration(MIGRATION, :epics, :id, []) + end +end diff --git a/db/post_migrate/20220907122648_populate_security_orchestration_policy_configuration_id.rb b/db/post_migrate/20220907122648_populate_security_orchestration_policy_configuration_id.rb new file mode 100644 index 00000000000..441113c0ba3 --- /dev/null +++ b/db/post_migrate/20220907122648_populate_security_orchestration_policy_configuration_id.rb @@ -0,0 +1,38 @@ +# frozen_string_literal: true + +class PopulateSecurityOrchestrationPolicyConfigurationId < Gitlab::Database::Migration[2.0] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + BATCH_SIZE = 1000 + SUB_BATCH_SIZE = 500 + MERGE_REQUEST_MIGRATION = 'PopulateApprovalMergeRequestRulesWithSecurityOrchestration' + PROJECT_MIGRATION = 'PopulateApprovalProjectRulesWithSecurityOrchestration' + INTERVAL = 2.minutes + + def up + return unless Gitlab.ee? + + queue_batched_background_migration( + PROJECT_MIGRATION, + :approval_project_rules, + :id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + + queue_batched_background_migration( + MERGE_REQUEST_MIGRATION, + :approval_merge_request_rules, + :id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + 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/20220915192521_prepare_async_trigram_index_for_vulnerability_reads_container_images.rb b/db/post_migrate/20220915192521_prepare_async_trigram_index_for_vulnerability_reads_container_images.rb new file mode 100644 index 00000000000..18ed1b2cd2b --- /dev/null +++ b/db/post_migrate/20220915192521_prepare_async_trigram_index_for_vulnerability_reads_container_images.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class PrepareAsyncTrigramIndexForVulnerabilityReadsContainerImages < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_vulnerability_reads_on_location_image_trigram' + REPORT_TYPES = { container_scanning: 2, cluster_image_scanning: 7 }.freeze + + def up + prepare_async_index :vulnerability_reads, :location_image, + name: INDEX_NAME, + using: :gin, opclass: { location_image: :gin_trgm_ops }, + where: "report_type = ANY (ARRAY[#{REPORT_TYPES.values.join(', ')}]) AND location_image IS NOT NULL" + end + + def down + unprepare_async_index :vulnerability_reads, :location_image, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220916054103_remove_experience_level_column.rb b/db/post_migrate/20220916054103_remove_experience_level_column.rb new file mode 100644 index 00000000000..dff5a9a6580 --- /dev/null +++ b/db/post_migrate/20220916054103_remove_experience_level_column.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +class RemoveExperienceLevelColumn < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def up + remove_column :user_preferences, :experience_level + end + + def down + add_column :user_preferences, :experience_level, :integer, limit: 2 + end +end diff --git a/db/post_migrate/20220916065418_add_index_id_partition_id_to_ci_builds_metadata.rb b/db/post_migrate/20220916065418_add_index_id_partition_id_to_ci_builds_metadata.rb new file mode 100644 index 00000000000..c781f2a9ef9 --- /dev/null +++ b/db/post_migrate/20220916065418_add_index_id_partition_id_to_ci_builds_metadata.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexIdPartitionIdToCiBuildsMetadata < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + TABLE_NAME = :ci_builds_metadata + INDEX_NAME = :index_ci_builds_metadata_on_id_partition_id_unique + + def up + add_concurrent_index(TABLE_NAME, %i[id partition_id], unique: true, name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/post_migrate/20220916070101_add_index_build_id_partition_id_to_ci_build_metadata.rb b/db/post_migrate/20220916070101_add_index_build_id_partition_id_to_ci_build_metadata.rb new file mode 100644 index 00000000000..18c24c47325 --- /dev/null +++ b/db/post_migrate/20220916070101_add_index_build_id_partition_id_to_ci_build_metadata.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddIndexBuildIdPartitionIdToCiBuildMetadata < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + TABLE_NAME = :ci_builds_metadata + INDEX_NAME = :index_ci_builds_metadata_on_build_id_partition_id_unique + + def up + add_concurrent_index(TABLE_NAME, %i[build_id partition_id], unique: true, name: INDEX_NAME) + end + + def down + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end +end diff --git a/db/post_migrate/20220919023208_drop_unused_fields_from_merge_request_assignees.rb b/db/post_migrate/20220919023208_drop_unused_fields_from_merge_request_assignees.rb new file mode 100644 index 00000000000..f1afbb41893 --- /dev/null +++ b/db/post_migrate/20220919023208_drop_unused_fields_from_merge_request_assignees.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +class DropUnusedFieldsFromMergeRequestAssignees < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + with_lock_retries do + if column_exists?(:merge_request_assignees, :state) # rubocop:disable Style/IfUnlessModifier + remove_column :merge_request_assignees, :state + end + + if column_exists?(:merge_request_assignees, :updated_state_by_user_id) + remove_column :merge_request_assignees, :updated_state_by_user_id + end + end + end + + def down + with_lock_retries do + unless column_exists?(:merge_request_assignees, :state) + add_column :merge_request_assignees, :state, :smallint, default: 0, null: false + end + + unless column_exists?(:merge_request_assignees, :updated_state_by_user_id) + add_column :merge_request_assignees, :updated_state_by_user_id, :bigint + end + end + + add_concurrent_index :merge_request_assignees, [:user_id, :state], + where: 'state = 2', + name: 'index_on_merge_request_assignees_user_id_and_state' + + add_concurrent_index :merge_request_assignees, :updated_state_by_user_id, + name: 'index_on_merge_request_assignees_updated_state_by_user_id' + + add_concurrent_foreign_key :merge_request_assignees, :users, + column: :updated_state_by_user_id, + on_delete: :nullify + end +end diff --git a/db/post_migrate/20220919041604_drop_unused_fields_from_merge_request_reviewers.rb b/db/post_migrate/20220919041604_drop_unused_fields_from_merge_request_reviewers.rb new file mode 100644 index 00000000000..d9f98557f75 --- /dev/null +++ b/db/post_migrate/20220919041604_drop_unused_fields_from_merge_request_reviewers.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class DropUnusedFieldsFromMergeRequestReviewers < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + with_lock_retries do + if column_exists?(:merge_request_reviewers, :updated_state_by_user_id) + remove_column :merge_request_reviewers, :updated_state_by_user_id + end + end + end + + def down + with_lock_retries do + unless column_exists?(:merge_request_reviewers, :updated_state_by_user_id) + add_column :merge_request_reviewers, :updated_state_by_user_id, :bigint + end + end + + add_concurrent_index :merge_request_reviewers, :updated_state_by_user_id, + name: 'index_on_merge_request_reviewers_updated_state_by_user_id' + + add_concurrent_foreign_key :merge_request_reviewers, :users, column: :updated_state_by_user_id, on_delete: :nullify + end +end diff --git a/db/post_migrate/20220919050555_drop_tmp_index_user_callouts_on_attention_request_feature_names.rb b/db/post_migrate/20220919050555_drop_tmp_index_user_callouts_on_attention_request_feature_names.rb new file mode 100644 index 00000000000..e456a91fe3f --- /dev/null +++ b/db/post_migrate/20220919050555_drop_tmp_index_user_callouts_on_attention_request_feature_names.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class DropTmpIndexUserCalloutsOnAttentionRequestFeatureNames < Gitlab::Database::Migration[2.0] + INDEX_NAME = "tmp_index_user_callouts_on_attention_request_feature_names" + ATTENTION_REQUEST_CALLOUTS = [47, 48] + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :user_callouts, INDEX_NAME + end + + def down + add_concurrent_index :user_callouts, [:id], + where: "feature_name IN (#{ATTENTION_REQUEST_CALLOUTS.join(',')})", + name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220920081631_prepare_ci_builds_metadata_for_partitioning_primary_key.rb b/db/post_migrate/20220920081631_prepare_ci_builds_metadata_for_partitioning_primary_key.rb new file mode 100644 index 00000000000..90727178624 --- /dev/null +++ b/db/post_migrate/20220920081631_prepare_ci_builds_metadata_for_partitioning_primary_key.rb @@ -0,0 +1,36 @@ +# frozen_string_literal: true + +class PrepareCiBuildsMetadataForPartitioningPrimaryKey < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + TABLE_NAME = 'ci_builds_metadata' + PRIMARY_KEY = 'ci_builds_metadata_pkey' + NEW_INDEX_NAME = 'index_ci_builds_metadata_on_id_partition_id_unique' + OLD_INDEX_NAME = 'index_ci_builds_metadata_on_id_unique' + + def up + with_lock_retries(raise_on_exhaustion: true) do + execute("ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT #{PRIMARY_KEY} CASCADE") + + rename_index(TABLE_NAME, NEW_INDEX_NAME, PRIMARY_KEY) + + execute("ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT #{PRIMARY_KEY} " \ + "PRIMARY KEY USING INDEX #{PRIMARY_KEY}") + end + end + + # rolling back this migration is time consuming with the creation of these two indexes + def down + add_concurrent_index(TABLE_NAME, :id, unique: true, name: OLD_INDEX_NAME) + add_concurrent_index(TABLE_NAME, [:id, :partition_id], unique: true, name: NEW_INDEX_NAME) + + with_lock_retries(raise_on_exhaustion: true) do + execute("ALTER TABLE #{TABLE_NAME} DROP CONSTRAINT #{PRIMARY_KEY} CASCADE") + + rename_index(TABLE_NAME, OLD_INDEX_NAME, PRIMARY_KEY) + + execute("ALTER TABLE #{TABLE_NAME} ADD CONSTRAINT #{PRIMARY_KEY} " \ + "PRIMARY KEY USING INDEX #{PRIMARY_KEY}") + end + end +end diff --git a/db/post_migrate/20220920122121_schedule_index_removal_for_ci_builds_metadata.rb b/db/post_migrate/20220920122121_schedule_index_removal_for_ci_builds_metadata.rb new file mode 100644 index 00000000000..57475a08c93 --- /dev/null +++ b/db/post_migrate/20220920122121_schedule_index_removal_for_ci_builds_metadata.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class ScheduleIndexRemovalForCiBuildsMetadata < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + TABLE_NAME = :ci_builds_metadata + INDEX_NAME = :index_ci_builds_metadata_on_build_id + + def up + prepare_async_index_removal(TABLE_NAME, :build_id, name: INDEX_NAME) + end + + def down + unprepare_async_index(TABLE_NAME, :build_id, name: INDEX_NAME) + end +end diff --git a/db/post_migrate/20220920124709_backfill_internal_on_notes.rb b/db/post_migrate/20220920124709_backfill_internal_on_notes.rb new file mode 100644 index 00000000000..0d737195907 --- /dev/null +++ b/db/post_migrate/20220920124709_backfill_internal_on_notes.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +class BackfillInternalOnNotes < Gitlab::Database::Migration[2.0] + MIGRATION = 'BackfillInternalOnNotes' + DELAY_INTERVAL = 2.minutes + TABLE = :notes + BATCH_SIZE = 2000 + SUB_BATCH_SIZE = 10 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + TABLE, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, TABLE, :id, []) + end +end diff --git a/db/post_migrate/20220920135356_tiebreak_user_type_index.rb b/db/post_migrate/20220920135356_tiebreak_user_type_index.rb new file mode 100644 index 00000000000..778a957086f --- /dev/null +++ b/db/post_migrate/20220920135356_tiebreak_user_type_index.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class TiebreakUserTypeIndex < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + NEW_INDEX_NAME = 'index_users_on_user_type_and_id' + OLD_INDEX_NAME = 'index_users_on_user_type' + + def up + add_concurrent_index :users, [:user_type, :id], name: NEW_INDEX_NAME + remove_concurrent_index_by_name :users, OLD_INDEX_NAME + end + + def down + add_concurrent_index :users, :user_type, name: OLD_INDEX_NAME + remove_concurrent_index_by_name :users, NEW_INDEX_NAME + end +end diff --git a/db/post_migrate/20220920141001_add_index_on_internal_notes.rb b/db/post_migrate/20220920141001_add_index_on_internal_notes.rb new file mode 100644 index 00000000000..466ad7b5a8d --- /dev/null +++ b/db/post_migrate/20220920141001_add_index_on_internal_notes.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexOnInternalNotes < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_notes_on_id_where_internal' + + disable_ddl_transaction! + + def up + add_concurrent_index :notes, :id, where: 'internal = true', name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :notes, INDEX_NAME + end +end diff --git a/db/post_migrate/20220920213504_finalize_task_system_note_renaming.rb b/db/post_migrate/20220920213504_finalize_task_system_note_renaming.rb new file mode 100644 index 00000000000..d9307c14ccb --- /dev/null +++ b/db/post_migrate/20220920213504_finalize_task_system_note_renaming.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class FinalizeTaskSystemNoteRenaming < Gitlab::Database::Migration[2.0] + def up + # no-op + end + + def down + # noop + end +end diff --git a/db/post_migrate/20220920214524_remove_task_system_note_rename_temp_index.rb b/db/post_migrate/20220920214524_remove_task_system_note_rename_temp_index.rb new file mode 100644 index 00000000000..d3671d24578 --- /dev/null +++ b/db/post_migrate/20220920214524_remove_task_system_note_rename_temp_index.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class RemoveTaskSystemNoteRenameTempIndex < Gitlab::Database::Migration[2.0] + def up + # no-op + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220921093355_schedule_backfill_namespace_details.rb b/db/post_migrate/20220921093355_schedule_backfill_namespace_details.rb new file mode 100644 index 00000000000..16ce9bd5c85 --- /dev/null +++ b/db/post_migrate/20220921093355_schedule_backfill_namespace_details.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class ScheduleBackfillNamespaceDetails < Gitlab::Database::Migration[2.0] + MIGRATION = 'BackfillNamespaceDetails' + INTERVAL = 2.minutes + BATCH_SIZE = 1_000 + MAX_BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 200 + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :namespaces, + :id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :namespaces, :id, []) + end +end diff --git a/db/post_migrate/20220921111823_remove_and_add_ci_pipeline_variables_raw_with_new_default.rb b/db/post_migrate/20220921111823_remove_and_add_ci_pipeline_variables_raw_with_new_default.rb new file mode 100644 index 00000000000..fd56a8f320a --- /dev/null +++ b/db/post_migrate/20220921111823_remove_and_add_ci_pipeline_variables_raw_with_new_default.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class RemoveAndAddCiPipelineVariablesRawWithNewDefault < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def change + remove_column :ci_pipeline_variables, :raw, :boolean, null: false, default: true + add_column :ci_pipeline_variables, :raw, :boolean, null: false, default: false + end +end diff --git a/db/post_migrate/20220921111831_remove_and_add_ci_group_variables_raw_with_new_default.rb b/db/post_migrate/20220921111831_remove_and_add_ci_group_variables_raw_with_new_default.rb new file mode 100644 index 00000000000..f4b7de3faf4 --- /dev/null +++ b/db/post_migrate/20220921111831_remove_and_add_ci_group_variables_raw_with_new_default.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class RemoveAndAddCiGroupVariablesRawWithNewDefault < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def change + remove_column :ci_group_variables, :raw, :boolean, null: false, default: true + add_column :ci_group_variables, :raw, :boolean, null: false, default: false + end +end diff --git a/db/post_migrate/20220921111840_remove_and_add_ci_instance_variables_raw_with_new_default.rb b/db/post_migrate/20220921111840_remove_and_add_ci_instance_variables_raw_with_new_default.rb new file mode 100644 index 00000000000..019db1bbaa3 --- /dev/null +++ b/db/post_migrate/20220921111840_remove_and_add_ci_instance_variables_raw_with_new_default.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class RemoveAndAddCiInstanceVariablesRawWithNewDefault < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def change + remove_column :ci_instance_variables, :raw, :boolean, null: false, default: true + add_column :ci_instance_variables, :raw, :boolean, null: false, default: false + end +end diff --git a/db/post_migrate/20220921111849_remove_and_add_ci_job_variables_raw_with_new_default.rb b/db/post_migrate/20220921111849_remove_and_add_ci_job_variables_raw_with_new_default.rb new file mode 100644 index 00000000000..736cd46382d --- /dev/null +++ b/db/post_migrate/20220921111849_remove_and_add_ci_job_variables_raw_with_new_default.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class RemoveAndAddCiJobVariablesRawWithNewDefault < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def change + remove_column :ci_job_variables, :raw, :boolean, null: false, default: true + add_column :ci_job_variables, :raw, :boolean, null: false, default: false + end +end diff --git a/db/post_migrate/20220921111857_remove_and_add_ci_pipeline_schedule_variables_raw_with_new_default.rb b/db/post_migrate/20220921111857_remove_and_add_ci_pipeline_schedule_variables_raw_with_new_default.rb new file mode 100644 index 00000000000..159b0303d71 --- /dev/null +++ b/db/post_migrate/20220921111857_remove_and_add_ci_pipeline_schedule_variables_raw_with_new_default.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class RemoveAndAddCiPipelineScheduleVariablesRawWithNewDefault < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def change + remove_column :ci_pipeline_schedule_variables, :raw, :boolean, null: false, default: true + add_column :ci_pipeline_schedule_variables, :raw, :boolean, null: false, default: false + end +end diff --git a/db/post_migrate/20220921111907_remove_and_add_ci_variables_raw_with_new_default.rb b/db/post_migrate/20220921111907_remove_and_add_ci_variables_raw_with_new_default.rb new file mode 100644 index 00000000000..129e5b1f020 --- /dev/null +++ b/db/post_migrate/20220921111907_remove_and_add_ci_variables_raw_with_new_default.rb @@ -0,0 +1,10 @@ +# frozen_string_literal: true + +class RemoveAndAddCiVariablesRawWithNewDefault < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def change + remove_column :ci_variables, :raw, :boolean, null: false, default: true + add_column :ci_variables, :raw, :boolean, null: false, default: false + end +end diff --git a/db/post_migrate/20220921144258_remove_orphan_group_token_users.rb b/db/post_migrate/20220921144258_remove_orphan_group_token_users.rb new file mode 100644 index 00000000000..a2483f611a3 --- /dev/null +++ b/db/post_migrate/20220921144258_remove_orphan_group_token_users.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +class RemoveOrphanGroupTokenUsers < Gitlab::Database::Migration[2.0] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + disable_ddl_transaction! + + class MigrationUser < MigrationRecord + include EachBatch + + self.table_name = 'users' + + scope :project_bots, -> { where(user_type: 6) } + scope :without_memberships, -> { where("NOT EXISTS (SELECT 1 FROM members where members.user_id = users.id)") } + end + + class MigrationPersonalAccessToken < MigrationRecord + self.table_name = 'personal_access_tokens' + end + + def up + delete_worker = 'DeleteUserWorker'.safe_constantize + + MigrationUser.project_bots.each_batch(of: 1000) do |batch| + bot_ids = batch.without_memberships.pluck(:id) + + MigrationPersonalAccessToken.where(user_id: bot_ids).delete_all + + next unless delete_worker && delete_worker.respond_to?(:perform_async) + + bot_ids.each do |bot_id| + delete_worker.perform_async(bot_id, bot_id, skip_authorization: true) + end + end + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220922090236_remove_trace_column_from_ci_builds.rb b/db/post_migrate/20220922090236_remove_trace_column_from_ci_builds.rb new file mode 100644 index 00000000000..e1871a9799f --- /dev/null +++ b/db/post_migrate/20220922090236_remove_trace_column_from_ci_builds.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +class RemoveTraceColumnFromCiBuilds < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def change + remove_column :ci_builds, :trace, :text + end +end diff --git a/db/post_migrate/20220922143143_schedule_reset_duplicate_ci_runners_token_values.rb b/db/post_migrate/20220922143143_schedule_reset_duplicate_ci_runners_token_values.rb new file mode 100644 index 00000000000..fd02bda8004 --- /dev/null +++ b/db/post_migrate/20220922143143_schedule_reset_duplicate_ci_runners_token_values.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class ScheduleResetDuplicateCiRunnersTokenValues < Gitlab::Database::Migration[2.0] + restrict_gitlab_migration gitlab_schema: :gitlab_ci + disable_ddl_transaction! + + MIGRATION = 'ResetDuplicateCiRunnersTokenValues' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 2_000 + MAX_BATCH_SIZE = 100_000 + SUB_BATCH_SIZE = 500 + + def up + queue_batched_background_migration( + MIGRATION, + :ci_runners, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :ci_runners, :id, []) + end +end diff --git a/db/post_migrate/20220922143634_schedule_reset_duplicate_ci_runners_token_encrypted_values.rb b/db/post_migrate/20220922143634_schedule_reset_duplicate_ci_runners_token_encrypted_values.rb new file mode 100644 index 00000000000..bbbf9a1db44 --- /dev/null +++ b/db/post_migrate/20220922143634_schedule_reset_duplicate_ci_runners_token_encrypted_values.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +class ScheduleResetDuplicateCiRunnersTokenEncryptedValues < Gitlab::Database::Migration[2.0] + restrict_gitlab_migration gitlab_schema: :gitlab_ci + disable_ddl_transaction! + + MIGRATION = 'ResetDuplicateCiRunnersTokenEncryptedValues' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 2_000 + MAX_BATCH_SIZE = 100_000 + SUB_BATCH_SIZE = 500 + + def up + queue_batched_background_migration( + MIGRATION, + :ci_runners, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :ci_runners, :id, []) + end +end diff --git a/db/post_migrate/20220922204106_remove_index_for_requested_non_invited_awaiting_members.rb b/db/post_migrate/20220922204106_remove_index_for_requested_non_invited_awaiting_members.rb new file mode 100644 index 00000000000..033b04a75f8 --- /dev/null +++ b/db/post_migrate/20220922204106_remove_index_for_requested_non_invited_awaiting_members.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveIndexForRequestedNonInvitedAwaitingMembers < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_members_on_non_requested_non_invited_and_state_awaiting' + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :members, INDEX_NAME + end + + def down + clause = '((requested_at IS NULL) AND (invite_token IS NULL) AND (access_level > 5) AND (state = 1))' + + add_concurrent_index :members, :source_id, where: clause, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220923052531_remove_tmp_index_merge_request_reviewers_on_attention_requested_state.rb b/db/post_migrate/20220923052531_remove_tmp_index_merge_request_reviewers_on_attention_requested_state.rb new file mode 100644 index 00000000000..27d9c1641bc --- /dev/null +++ b/db/post_migrate/20220923052531_remove_tmp_index_merge_request_reviewers_on_attention_requested_state.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class RemoveTmpIndexMergeRequestReviewersOnAttentionRequestedState < Gitlab::Database::Migration[2.0] + INDEX_NAME = "tmp_index_merge_request_reviewers_on_attention_requested_state" + ATTENTION_REQUESTED_STATE = 2 + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :merge_request_reviewers, INDEX_NAME + end + + def down + add_concurrent_index :merge_request_reviewers, [:id], + where: "state = #{ATTENTION_REQUESTED_STATE}", + name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220923060226_remove_tmp_index_system_note_metadata_on_attention_request_actions.rb b/db/post_migrate/20220923060226_remove_tmp_index_system_note_metadata_on_attention_request_actions.rb new file mode 100644 index 00000000000..40e8c1cfdb5 --- /dev/null +++ b/db/post_migrate/20220923060226_remove_tmp_index_system_note_metadata_on_attention_request_actions.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class RemoveTmpIndexSystemNoteMetadataOnAttentionRequestActions < Gitlab::Database::Migration[2.0] + INDEX_NAME = "tmp_index_system_note_metadata_on_attention_request_actions" + + disable_ddl_transaction! + + def up + remove_concurrent_index_by_name :system_note_metadata, INDEX_NAME + end + + def down + add_concurrent_index :system_note_metadata, [:id], + where: "action IN ('attention_requested', 'attention_request_removed')", + name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220928225711_schedule_update_ci_pipeline_artifacts_locked_status.rb b/db/post_migrate/20220928225711_schedule_update_ci_pipeline_artifacts_locked_status.rb new file mode 100644 index 00000000000..0d7a5dc4bec --- /dev/null +++ b/db/post_migrate/20220928225711_schedule_update_ci_pipeline_artifacts_locked_status.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +class ScheduleUpdateCiPipelineArtifactsLockedStatus < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + MIGRATION = 'UpdateCiPipelineArtifactsUnknownLockedStatus' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1_000 + SUB_BATCH_SIZE = 500 + + restrict_gitlab_migration gitlab_schema: :gitlab_ci + + def up + queue_batched_background_migration( + MIGRATION, + :ci_pipeline_artifacts, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :ci_pipeline_artifacts, :id, []) + end +end diff --git a/db/post_migrate/20220929081645_tmp_idx_null_member_namespace_id.rb b/db/post_migrate/20220929081645_tmp_idx_null_member_namespace_id.rb new file mode 100644 index 00000000000..58d6c653e6f --- /dev/null +++ b/db/post_migrate/20220929081645_tmp_idx_null_member_namespace_id.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class TmpIdxNullMemberNamespaceId < Gitlab::Database::Migration[2.0] + TMP_INDEX_FOR_NULL_MEMBER_NAMESPACE_ID = 'tmp_index_for_null_member_namespace_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :members, :member_namespace_id, + name: TMP_INDEX_FOR_NULL_MEMBER_NAMESPACE_ID, + where: 'member_namespace_id IS NULL' + end + + def down + remove_concurrent_index_by_name :members, name: TMP_INDEX_FOR_NULL_MEMBER_NAMESPACE_ID + end +end diff --git a/db/post_migrate/20220929091500_add_tmp_index_vulns_on_report_type.rb b/db/post_migrate/20220929091500_add_tmp_index_vulns_on_report_type.rb new file mode 100644 index 00000000000..19100e1d0cc --- /dev/null +++ b/db/post_migrate/20220929091500_add_tmp_index_vulns_on_report_type.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true +class AddTmpIndexVulnsOnReportType < Gitlab::Database::Migration[2.0] + # Temporary index to perform migration removing invalid vulnerabilities + INDEX_NAME = 'tmp_idx_vulnerabilities_on_id_where_report_type_7_99' + + REPORT_TYPES = { + cluster_image_scanning: 7, + custom: 99 + } + + disable_ddl_transaction! + + def up + add_concurrent_index :vulnerabilities, :id, + where: "report_type IN (#{REPORT_TYPES.values.join(', ')})", + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerabilities, INDEX_NAME + end +end diff --git a/db/post_migrate/20220929101947_delete_remove_invalid_member_migration.rb b/db/post_migrate/20220929101947_delete_remove_invalid_member_migration.rb new file mode 100644 index 00000000000..6fb358e57ab --- /dev/null +++ b/db/post_migrate/20220929101947_delete_remove_invalid_member_migration.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class DeleteRemoveInvalidMemberMigration < Gitlab::Database::Migration[2.0] + PROJECT_MEMBER_MIGRATION = 'ScheduleDestroyInvalidProjectMembers' + GROUP_MEMBER_MIGRATION = 'ScheduleDestroyInvalidGroupMembers' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + delete_batched_background_migration(PROJECT_MEMBER_MIGRATION, :members, :id, []) + delete_batched_background_migration(GROUP_MEMBER_MIGRATION, :members, :id, []) + end + + def down + # no-op + end +end diff --git a/db/post_migrate/20220929194453_add_index_releases_project_id_id.rb b/db/post_migrate/20220929194453_add_index_releases_project_id_id.rb new file mode 100644 index 00000000000..179b5a636f0 --- /dev/null +++ b/db/post_migrate/20220929194453_add_index_releases_project_id_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexReleasesProjectIdId < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_releases_on_project_id_id' + + disable_ddl_transaction! + + def up + add_concurrent_index :releases, %i[project_id id], name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :releases, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20220929213730_schedule_delete_orphaned_operational_vulnerabilities.rb b/db/post_migrate/20220929213730_schedule_delete_orphaned_operational_vulnerabilities.rb new file mode 100644 index 00000000000..c03358b1fda --- /dev/null +++ b/db/post_migrate/20220929213730_schedule_delete_orphaned_operational_vulnerabilities.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class ScheduleDeleteOrphanedOperationalVulnerabilities < Gitlab::Database::Migration[2.0] + MIGRATION = 'DeleteOrphanedOperationalVulnerabilities' + INTERVAL = 2.minutes + BATCH_SIZE = 10_000 + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :vulnerabilities, + :id, + job_interval: INTERVAL, + batch_size: BATCH_SIZE + ) + end + + def down + delete_batched_background_migration(MIGRATION, :vulnerabilities, :id, []) + end +end diff --git a/db/post_migrate/20220930110127_remove_unique_index_build_id_to_ci_builds_metadata.rb b/db/post_migrate/20220930110127_remove_unique_index_build_id_to_ci_builds_metadata.rb new file mode 100644 index 00000000000..4c23cdc5284 --- /dev/null +++ b/db/post_migrate/20220930110127_remove_unique_index_build_id_to_ci_builds_metadata.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class RemoveUniqueIndexBuildIdToCiBuildsMetadata < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + TABLE_NAME = :ci_builds_metadata + INDEX_NAME = :index_ci_builds_metadata_on_build_id + + def up + remove_concurrent_index_by_name(TABLE_NAME, INDEX_NAME) + end + + def down + add_concurrent_index(TABLE_NAME, :build_id, unique: true, name: INDEX_NAME) + end +end diff --git a/db/post_migrate/20221003192827_add_index_resolved_on_default_branch_to_vulnerabilities_read.rb b/db/post_migrate/20221003192827_add_index_resolved_on_default_branch_to_vulnerabilities_read.rb new file mode 100644 index 00000000000..e352e324187 --- /dev/null +++ b/db/post_migrate/20221003192827_add_index_resolved_on_default_branch_to_vulnerabilities_read.rb @@ -0,0 +1,18 @@ +# frozen_string_literal: true + +class AddIndexResolvedOnDefaultBranchToVulnerabilitiesRead < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'index_vuln_reads_on_resolved_on_default_branch' + COLUMNS = %i[project_id state id] + + def up + add_concurrent_index :vulnerability_reads, COLUMNS, + where: 'resolved_on_default_branch IS TRUE', + name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :vulnerability_reads, INDEX_NAME + end +end diff --git a/db/post_migrate/20221004092038_tmp_index_members_on_id_where_namespace_id_null.rb b/db/post_migrate/20221004092038_tmp_index_members_on_id_where_namespace_id_null.rb new file mode 100644 index 00000000000..68a707e99c2 --- /dev/null +++ b/db/post_migrate/20221004092038_tmp_index_members_on_id_where_namespace_id_null.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class TmpIndexMembersOnIdWhereNamespaceIdNull < Gitlab::Database::Migration[2.0] + TMP_INDEX = 'tmp_index_members_on_id_where_namespace_id_null' + + disable_ddl_transaction! + + def up + add_concurrent_index :members, :id, + name: TMP_INDEX, + where: 'member_namespace_id IS NULL' + end + + def down + remove_concurrent_index_by_name :members, name: TMP_INDEX + end +end diff --git a/db/post_migrate/20221004094814_schedule_destroy_invalid_members.rb b/db/post_migrate/20221004094814_schedule_destroy_invalid_members.rb new file mode 100644 index 00000000000..fa6a1fd5f72 --- /dev/null +++ b/db/post_migrate/20221004094814_schedule_destroy_invalid_members.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true +class ScheduleDestroyInvalidMembers < Gitlab::Database::Migration[2.0] + MIGRATION = 'DestroyInvalidMembers' + DELAY_INTERVAL = 2.minutes + BATCH_SIZE = 1_000 + MAX_BATCH_SIZE = 10_000 + SUB_BATCH_SIZE = 200 + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + queue_batched_background_migration( + MIGRATION, + :members, + :id, + job_interval: DELAY_INTERVAL, + batch_size: BATCH_SIZE, + max_batch_size: MAX_BATCH_SIZE, + sub_batch_size: SUB_BATCH_SIZE, + gitlab_schema: :gitlab_main + ) + end + + def down + delete_batched_background_migration(MIGRATION, :members, :id, []) + end +end diff --git a/db/post_migrate/20221005103000_add_index_merge_request_id_on_scan_finding_approval_merge_request_rules.rb b/db/post_migrate/20221005103000_add_index_merge_request_id_on_scan_finding_approval_merge_request_rules.rb new file mode 100644 index 00000000000..06bf21b894a --- /dev/null +++ b/db/post_migrate/20221005103000_add_index_merge_request_id_on_scan_finding_approval_merge_request_rules.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class AddIndexMergeRequestIdOnScanFindingApprovalMergeRequestRules < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'scan_finding_approval_mr_rule_index_merge_request_id' + SCAN_FINDING_REPORT_TYPE = 4 + + disable_ddl_transaction! + + def up + add_concurrent_index :approval_merge_request_rules, :merge_request_id, + where: "report_type = #{SCAN_FINDING_REPORT_TYPE}", name: INDEX_NAME + end + + def down + remove_concurrent_index_by_name :approval_merge_request_rules, INDEX_NAME + end +end diff --git a/db/post_migrate/20221006083240_prepare_partial_trigram_indexes_for_issues_attempt_2.rb b/db/post_migrate/20221006083240_prepare_partial_trigram_indexes_for_issues_attempt_2.rb new file mode 100644 index 00000000000..6ca2ba222ae --- /dev/null +++ b/db/post_migrate/20221006083240_prepare_partial_trigram_indexes_for_issues_attempt_2.rb @@ -0,0 +1,25 @@ +# frozen_string_literal: true + +class PreparePartialTrigramIndexesForIssuesAttempt2 < Gitlab::Database::Migration[2.0] + TITLE_INDEX_NAME = 'index_issues_on_title_trigram_non_latin' + DESCRIPTION_INDEX_NAME = 'index_issues_on_description_trigram_non_latin' + + def up + prepare_async_index :issues, :title, + name: TITLE_INDEX_NAME, + using: :gin, opclass: { description: :gin_trgm_ops }, + where: "title NOT SIMILAR TO '[\\u0000-\\u02FF\\u1E00-\\u1EFF\\u2070-\\u218F]*' " \ + "OR description NOT SIMILAR TO '[\\u0000-\\u02FF\\u1E00-\\u1EFF\\u2070-\\u218F]*'" + + prepare_async_index :issues, :description, + name: DESCRIPTION_INDEX_NAME, + using: :gin, opclass: { description: :gin_trgm_ops }, + where: "title NOT SIMILAR TO '[\\u0000-\\u02FF\\u1E00-\\u1EFF\\u2070-\\u218F]*' " \ + "OR description NOT SIMILAR TO '[\\u0000-\\u02FF\\u1E00-\\u1EFF\\u2070-\\u218F]*'" + end + + def down + unprepare_async_index_by_name :issues, DESCRIPTION_INDEX_NAME + unprepare_async_index_by_name :issues, TITLE_INDEX_NAME + end +end diff --git a/db/post_migrate/20221006172302_adjust_task_note_rename_background_migration_values.rb b/db/post_migrate/20221006172302_adjust_task_note_rename_background_migration_values.rb new file mode 100644 index 00000000000..2af16fb6d3c --- /dev/null +++ b/db/post_migrate/20221006172302_adjust_task_note_rename_background_migration_values.rb @@ -0,0 +1,72 @@ +# frozen_string_literal: true + +class AdjustTaskNoteRenameBackgroundMigrationValues < Gitlab::Database::Migration[2.0] + restrict_gitlab_migration gitlab_schema: :gitlab_main + + JOB_CLASS_NAME = 'RenameTaskSystemNoteToChecklistItem' + MIGRATION_FAILED_STATUS = 4 + MIGRATION_FINISHED_STATUS = 3 + MIGRATION_ACTIVE_STATUS = 1 + JOB_FAILED_STATUS = 2 + + OLD_BATCH_SIZE = 10_000 + NEW_BATCH_SIZE = 5_000 + + OLD_SUB_BATCH_SIZE = 100 + NEW_SUB_BATCH_SIZE = 10 + + class InlineBatchedMigration < MigrationRecord + self.table_name = :batched_background_migrations + + scope :for_configuration, ->(job_class_name, table_name, column_name, job_arguments) do + where(job_class_name: job_class_name, table_name: table_name, column_name: column_name) + .where("job_arguments = ?", job_arguments.to_json) # rubocop:disable Rails/WhereEquals + end + end + + class InlineBatchedJob < MigrationRecord + include EachBatch + self.table_name = :batched_background_migration_jobs + end + + def up + migration = InlineBatchedMigration.for_configuration( + JOB_CLASS_NAME, + :system_note_metadata, + :id, + [] + ).first + return if migration.blank? || migration.status == MIGRATION_FINISHED_STATUS + + InlineBatchedJob.where( + batched_background_migration_id: migration.id, + status: JOB_FAILED_STATUS + ).each_batch(of: 100) do |batch| + batch.update_all(attempts: 0, sub_batch_size: NEW_SUB_BATCH_SIZE) + end + + update_params = { batch_size: NEW_BATCH_SIZE, sub_batch_size: NEW_SUB_BATCH_SIZE } + + if migration.status == MIGRATION_FAILED_STATUS + update_params[:status] = MIGRATION_ACTIVE_STATUS + update_params[:started_at] = Time.zone.now if migration.respond_to?(:started_at) + end + + migration.update!(**update_params) + end + + def down + migration = InlineBatchedMigration.for_configuration( + JOB_CLASS_NAME, + :system_note_metadata, + :id, + [] + ).first + return if migration.blank? + + migration.update!( + batch_size: OLD_BATCH_SIZE, + sub_batch_size: OLD_SUB_BATCH_SIZE + ) + end +end diff --git a/db/post_migrate/20221010074914_migrate_security_findings_delete_queues.rb b/db/post_migrate/20221010074914_migrate_security_findings_delete_queues.rb new file mode 100644 index 00000000000..ce593e19859 --- /dev/null +++ b/db/post_migrate/20221010074914_migrate_security_findings_delete_queues.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class MigrateSecurityFindingsDeleteQueues < Gitlab::Database::Migration[2.0] + restrict_gitlab_migration gitlab_schema: :gitlab_main + disable_ddl_transaction! + + def up + sidekiq_queue_migrate 'security_findings_delete_by_job_id', to: 'security_scans_purge_by_job_id' + sidekiq_queue_migrate 'cronjob:security_findings_cleanup', to: 'cronjob:security_scans_purge' + end + + def down + sidekiq_queue_migrate 'security_scans_purge_by_job_id', to: 'security_findings_delete_by_job_id' + sidekiq_queue_migrate 'cronjob:security_scans_purge', to: 'cronjob:security_findings_cleanup' + end +end diff --git a/db/post_migrate/20221010121510_prepare_async_index_author_id_target_project_id_on_merge_requests.rb b/db/post_migrate/20221010121510_prepare_async_index_author_id_target_project_id_on_merge_requests.rb new file mode 100644 index 00000000000..cd9035dd9f9 --- /dev/null +++ b/db/post_migrate/20221010121510_prepare_async_index_author_id_target_project_id_on_merge_requests.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class PrepareAsyncIndexAuthorIdTargetProjectIdOnMergeRequests < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_merge_requests_on_author_id_and_target_project_id' + + disable_ddl_transaction! + + def up + prepare_async_index :merge_requests, %i[author_id target_project_id], name: INDEX_NAME + end + + def down + unprepare_async_index :merge_requests, %i[author_id target_project_id], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20221010121807_add_compliance_framework_id_to_namespace_settings.rb b/db/post_migrate/20221010121807_add_compliance_framework_id_to_namespace_settings.rb new file mode 100644 index 00000000000..e07f19242d5 --- /dev/null +++ b/db/post_migrate/20221010121807_add_compliance_framework_id_to_namespace_settings.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +class AddComplianceFrameworkIdToNamespaceSettings < Gitlab::Database::Migration[2.0] + def change + add_column :namespace_settings, :default_compliance_framework_id, :bigint + end +end diff --git a/db/post_migrate/20221010122138_add_async_index_author_id_target_project_id_on_merge_requests.rb b/db/post_migrate/20221010122138_add_async_index_author_id_target_project_id_on_merge_requests.rb new file mode 100644 index 00000000000..0689c090d09 --- /dev/null +++ b/db/post_migrate/20221010122138_add_async_index_author_id_target_project_id_on_merge_requests.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddAsyncIndexAuthorIdTargetProjectIdOnMergeRequests < Gitlab::Database::Migration[2.0] + INDEX_NAME = 'index_merge_requests_on_author_id_and_id' + + disable_ddl_transaction! + + def up + prepare_async_index :merge_requests, %i[author_id id], name: INDEX_NAME + end + + def down + unprepare_async_index :merge_requests, %i[author_id id], name: INDEX_NAME + end +end diff --git a/db/post_migrate/20221010122352_add_index_to_namespace_settings_on_default_compliance_framework_id.rb b/db/post_migrate/20221010122352_add_index_to_namespace_settings_on_default_compliance_framework_id.rb new file mode 100644 index 00000000000..63de7942208 --- /dev/null +++ b/db/post_migrate/20221010122352_add_index_to_namespace_settings_on_default_compliance_framework_id.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class AddIndexToNamespaceSettingsOnDefaultComplianceFrameworkId < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + INDEX_NAME = 'idx_namespace_settings_on_default_compliance_framework_id' + + def up + add_concurrent_index :namespace_settings, :default_compliance_framework_id, unique: true, name: INDEX_NAME + end + + def down + remove_concurrent_index :namespace_settings, :default_compliance_framework_id, name: INDEX_NAME + end +end diff --git a/db/post_migrate/20221010123040_add_compliance_framework_fk_to_namespace_settings.rb b/db/post_migrate/20221010123040_add_compliance_framework_fk_to_namespace_settings.rb new file mode 100644 index 00000000000..5d4966fd580 --- /dev/null +++ b/db/post_migrate/20221010123040_add_compliance_framework_fk_to_namespace_settings.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class AddComplianceFrameworkFkToNamespaceSettings < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + def up + add_concurrent_foreign_key :namespace_settings, :compliance_management_frameworks, + column: :default_compliance_framework_id, on_delete: :nullify, reverse_lock_order: true + end + + def down + with_lock_retries do + remove_foreign_key :namespace_settings, column: :default_compliance_framework_id + end + end +end diff --git a/db/post_migrate/20221011113928_redo_remove_and_add_ci_job_variables_raw_with_new_default.rb b/db/post_migrate/20221011113928_redo_remove_and_add_ci_job_variables_raw_with_new_default.rb new file mode 100644 index 00000000000..a377b78803e --- /dev/null +++ b/db/post_migrate/20221011113928_redo_remove_and_add_ci_job_variables_raw_with_new_default.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class RedoRemoveAndAddCiJobVariablesRawWithNewDefault < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + # We are removing and adding the same column with the same parameters to refresh the table + # because we have some wrong `ci_job_variables.raw` data (`TRUE`) in the database. + def change + remove_column :ci_job_variables, :raw, :boolean, null: false, default: false + add_column :ci_job_variables, :raw, :boolean, null: false, default: false + end +end diff --git a/db/post_migrate/20221012182701_remove_namespace_settings_cohort_free_user_cap_columns.rb b/db/post_migrate/20221012182701_remove_namespace_settings_cohort_free_user_cap_columns.rb new file mode 100644 index 00000000000..36408ad19ed --- /dev/null +++ b/db/post_migrate/20221012182701_remove_namespace_settings_cohort_free_user_cap_columns.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class RemoveNamespaceSettingsCohortFreeUserCapColumns < Gitlab::Database::Migration[2.0] + enable_lock_retries! + + def up + remove_column :namespace_settings, :exclude_from_free_user_cap + remove_column :namespace_settings, :include_for_free_user_cap_preview + end + + def down + add_column :namespace_settings, :exclude_from_free_user_cap, :boolean, null: false, default: false + add_column :namespace_settings, :include_for_free_user_cap_preview, :boolean, null: false, default: false + end +end diff --git a/db/post_migrate/20221013154159_update_invalid_dormant_user_setting.rb b/db/post_migrate/20221013154159_update_invalid_dormant_user_setting.rb new file mode 100644 index 00000000000..1f1e47fdac1 --- /dev/null +++ b/db/post_migrate/20221013154159_update_invalid_dormant_user_setting.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +class UpdateInvalidDormantUserSetting < Gitlab::Database::Migration[2.0] + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + # rubocop:disable Layout/LineLength + def up + execute("update application_settings set deactivate_dormant_users_period=90 where deactivate_dormant_users_period < 90") + end + # rubocop:enable Layout/LineLength + + def down + # no-op + end +end diff --git a/db/schema.rb b/db/schema.rb deleted file mode 100644 index 26ce2ed69c4..00000000000 --- a/db/schema.rb +++ /dev/null @@ -1,5 +0,0 @@ -# Disabled in favour of structure.sql -# Please refer to https://gitlab.com/gitlab-org/gitlab/-/issues/211487 for details - -raise 'schema.rb should not be used anymore, use structure.sql instead' - diff --git a/db/schema_migrations/20220126191624 b/db/schema_migrations/20220126191624 new file mode 100644 index 00000000000..f8cbab24379 --- /dev/null +++ b/db/schema_migrations/20220126191624 @@ -0,0 +1 @@ +33170856a78b469c63d4821692929a1df0c41e4b9d98093e771b122b462c9c03
\ No newline at end of file diff --git a/db/schema_migrations/20220615172230 b/db/schema_migrations/20220615172230 new file mode 100644 index 00000000000..43057debe67 --- /dev/null +++ b/db/schema_migrations/20220615172230 @@ -0,0 +1 @@ +364a2f729196e4bd4bde635f7550df3cf0c005fa002840fa12745d8919a99147
\ No newline at end of file diff --git a/db/schema_migrations/20220802200719 b/db/schema_migrations/20220802200719 new file mode 100644 index 00000000000..a4798a7e79e --- /dev/null +++ b/db/schema_migrations/20220802200719 @@ -0,0 +1 @@ +e27e9430a06f0586dd4ed9419c8f5747d64509e89f4f3481d8341261cfec82c5
\ No newline at end of file diff --git a/db/schema_migrations/20220802202505 b/db/schema_migrations/20220802202505 new file mode 100644 index 00000000000..f6a72f8c3c5 --- /dev/null +++ b/db/schema_migrations/20220802202505 @@ -0,0 +1 @@ +aacf5e416de30f594ea012c3dd3cb1a3bd10d2edd2d312aedf7147a8cde32928
\ No newline at end of file diff --git a/db/schema_migrations/20220805180311 b/db/schema_migrations/20220805180311 new file mode 100644 index 00000000000..dff18ebd3fc --- /dev/null +++ b/db/schema_migrations/20220805180311 @@ -0,0 +1 @@ +35335f40a192889c45f71a8a3b25dd0e7024919ff823b01c2086c0e6959869e0
\ No newline at end of file diff --git a/db/schema_migrations/20220805183952 b/db/schema_migrations/20220805183952 new file mode 100644 index 00000000000..c1a1c03dcef --- /dev/null +++ b/db/schema_migrations/20220805183952 @@ -0,0 +1 @@ +a90c4b56f6cf16ec62d4a37e03add702ce8d64640b1c61f6f0b18b2d9720f24e
\ No newline at end of file diff --git a/db/schema_migrations/20220805193117 b/db/schema_migrations/20220805193117 new file mode 100644 index 00000000000..36523ba0866 --- /dev/null +++ b/db/schema_migrations/20220805193117 @@ -0,0 +1 @@ +f64b85003dde31c4f0ba37cb0b550fb50b8d7753bbae3043f28ed51858349572
\ No newline at end of file diff --git a/db/schema_migrations/20220818125332 b/db/schema_migrations/20220818125332 new file mode 100644 index 00000000000..35c76c4318f --- /dev/null +++ b/db/schema_migrations/20220818125332 @@ -0,0 +1 @@ +ebcf446aa6579d93c57c2e96e8b670a43bcb6e20216f33a7f535e1bed50ace62
\ No newline at end of file diff --git a/db/schema_migrations/20220818125703 b/db/schema_migrations/20220818125703 new file mode 100644 index 00000000000..1bfebfc50ad --- /dev/null +++ b/db/schema_migrations/20220818125703 @@ -0,0 +1 @@ +b60f36cd83174ce257baba4a74f0fcba6cd462fa2af6530ff5a3341536058e12
\ No newline at end of file diff --git a/db/schema_migrations/20220818140553 b/db/schema_migrations/20220818140553 new file mode 100644 index 00000000000..deedcc9d4b8 --- /dev/null +++ b/db/schema_migrations/20220818140553 @@ -0,0 +1 @@ +f46a411a6519723cd2ee0a5b287f26f987195ba76e5753febe47502b1152a543
\ No newline at end of file diff --git a/db/schema_migrations/20220819184945 b/db/schema_migrations/20220819184945 new file mode 100644 index 00000000000..511b13fc6cd --- /dev/null +++ b/db/schema_migrations/20220819184945 @@ -0,0 +1 @@ +3655ee5c3c963d0e413bce86eb9c74cc7bc71c3ab5acb54c76daacff8ff07354
\ No newline at end of file diff --git a/db/schema_migrations/20220831090454 b/db/schema_migrations/20220831090454 new file mode 100644 index 00000000000..70f41257873 --- /dev/null +++ b/db/schema_migrations/20220831090454 @@ -0,0 +1 @@ +681514d675382385f77cbcb5ec22038555670f95a35f1ced42554452718bd193
\ No newline at end of file diff --git a/db/schema_migrations/20220901090004 b/db/schema_migrations/20220901090004 new file mode 100644 index 00000000000..a0302cfe1ed --- /dev/null +++ b/db/schema_migrations/20220901090004 @@ -0,0 +1 @@ +eab8630158a70df1246bf5c12c2d93d9fa855140c65bde4665d1d13f371b561c
\ No newline at end of file diff --git a/db/schema_migrations/20220901092853 b/db/schema_migrations/20220901092853 new file mode 100644 index 00000000000..2ebe0b9ffee --- /dev/null +++ b/db/schema_migrations/20220901092853 @@ -0,0 +1 @@ +0d134b0f3ba5adcc515072a2c1f995f3f3a89f298ee84f1f58c2f7afb0b85a0f
\ No newline at end of file diff --git a/db/schema_migrations/20220901114501 b/db/schema_migrations/20220901114501 new file mode 100644 index 00000000000..e3367fb7612 --- /dev/null +++ b/db/schema_migrations/20220901114501 @@ -0,0 +1 @@ +2c18be04f3b5800c84a50763e7650229a6ae02619a2913966af2c936d3d9aec1
\ No newline at end of file diff --git a/db/schema_migrations/20220905120848 b/db/schema_migrations/20220905120848 new file mode 100644 index 00000000000..ebfd3a0b59c --- /dev/null +++ b/db/schema_migrations/20220905120848 @@ -0,0 +1 @@ +f8196de8a4c8f6e8c6790c0d741b0deb455c533a35f665fffeb70c833d0ecd29
\ No newline at end of file diff --git a/db/schema_migrations/20220907115806 b/db/schema_migrations/20220907115806 new file mode 100644 index 00000000000..878ac923880 --- /dev/null +++ b/db/schema_migrations/20220907115806 @@ -0,0 +1 @@ +bfc9595c9e33afecd07721ab03548bdc5d9dda5be8fff180d84fc644f6c8c977
\ No newline at end of file diff --git a/db/schema_migrations/20220907122648 b/db/schema_migrations/20220907122648 new file mode 100644 index 00000000000..1f743d593c2 --- /dev/null +++ b/db/schema_migrations/20220907122648 @@ -0,0 +1 @@ +b576db8eb36b1d214788d301fd756d247c3fa33e13b7083e27c42735b48483e0
\ No newline at end of file diff --git a/db/schema_migrations/20220912153839 b/db/schema_migrations/20220912153839 new file mode 100644 index 00000000000..26666148feb --- /dev/null +++ b/db/schema_migrations/20220912153839 @@ -0,0 +1 @@ +9cb59a045dd09fc956683e976d127f8f2346b2b26c25eeeadc4b0ef838fa1d02
\ No newline at end of file diff --git a/db/schema_migrations/20220913043728 b/db/schema_migrations/20220913043728 new file mode 100644 index 00000000000..80dd2b0c9a4 --- /dev/null +++ b/db/schema_migrations/20220913043728 @@ -0,0 +1 @@ +ae25d97cf0f867578fd0308ac4b2dea82710973bb2b6d9df58531b1586462838
\ No newline at end of file diff --git a/db/schema_migrations/20220913082824 b/db/schema_migrations/20220913082824 new file mode 100644 index 00000000000..550ef78804b --- /dev/null +++ b/db/schema_migrations/20220913082824 @@ -0,0 +1 @@ +8776d132d5f95969003edf7f56213206f2321bc1963b80a50006d07f0c9f3bf4
\ No newline at end of file diff --git a/db/schema_migrations/20220913084123 b/db/schema_migrations/20220913084123 new file mode 100644 index 00000000000..1791350c1fc --- /dev/null +++ b/db/schema_migrations/20220913084123 @@ -0,0 +1 @@ +e43e754e52339fe333bb91c0b098a394cb211c1dcec36fad023cfa954ecfe5c0
\ No newline at end of file diff --git a/db/schema_migrations/20220914070927 b/db/schema_migrations/20220914070927 new file mode 100644 index 00000000000..7ff18f80def --- /dev/null +++ b/db/schema_migrations/20220914070927 @@ -0,0 +1 @@ +d8a610c72f2009f3beb89ef2da4d703d3d79e4abfc9c18579eecb03bde4e0683
\ No newline at end of file diff --git a/db/schema_migrations/20220914080716 b/db/schema_migrations/20220914080716 new file mode 100644 index 00000000000..7c807e61c26 --- /dev/null +++ b/db/schema_migrations/20220914080716 @@ -0,0 +1 @@ +ffa421a7ffc279cb2751ed9e74c212ab60a3b6f7722d15023d39f7ad97ff1e6c
\ No newline at end of file diff --git a/db/schema_migrations/20220914112457 b/db/schema_migrations/20220914112457 new file mode 100644 index 00000000000..ab67d0abb99 --- /dev/null +++ b/db/schema_migrations/20220914112457 @@ -0,0 +1 @@ +766866e84cdafce6506f18e574e1cfb760a581fa7464ce7e29c31d9778c687c0
\ No newline at end of file diff --git a/db/schema_migrations/20220914130800 b/db/schema_migrations/20220914130800 new file mode 100644 index 00000000000..2fab1dfd4b9 --- /dev/null +++ b/db/schema_migrations/20220914130800 @@ -0,0 +1 @@ +c0a3269fbd44428439932f3b12b154425eafaab0b0638f7f27a03e784d0f0e32
\ No newline at end of file diff --git a/db/schema_migrations/20220914131449 b/db/schema_migrations/20220914131449 new file mode 100644 index 00000000000..f735b7867d1 --- /dev/null +++ b/db/schema_migrations/20220914131449 @@ -0,0 +1 @@ +205f1fee1ed33a2b069e51a76b94c72702300c72c4705569be2368f8804f3bce
\ No newline at end of file diff --git a/db/schema_migrations/20220914174705 b/db/schema_migrations/20220914174705 new file mode 100644 index 00000000000..2ef8c90a31f --- /dev/null +++ b/db/schema_migrations/20220914174705 @@ -0,0 +1 @@ +f481a617b3fc4fa95daec75619029dc8ef3a02d55e86b940eda78d6a93e6e78b
\ No newline at end of file diff --git a/db/schema_migrations/20220915192521 b/db/schema_migrations/20220915192521 new file mode 100644 index 00000000000..ce848d0f186 --- /dev/null +++ b/db/schema_migrations/20220915192521 @@ -0,0 +1 @@ +9686a948e67f25d64f66187db27699b838b2caef11f27884dd6e868e4bcf7d47
\ No newline at end of file diff --git a/db/schema_migrations/20220916054103 b/db/schema_migrations/20220916054103 new file mode 100644 index 00000000000..ab7f027f7ce --- /dev/null +++ b/db/schema_migrations/20220916054103 @@ -0,0 +1 @@ +d410d105f8af6948dba3efc37469048435237c1e21faa10e66836c85acf33728
\ No newline at end of file diff --git a/db/schema_migrations/20220916065418 b/db/schema_migrations/20220916065418 new file mode 100644 index 00000000000..f78f7149e66 --- /dev/null +++ b/db/schema_migrations/20220916065418 @@ -0,0 +1 @@ +2950f1826c77539072f66fcc46fefb77dcbcafe4cc8e5d0bdc090b19fc1600c7
\ No newline at end of file diff --git a/db/schema_migrations/20220916070101 b/db/schema_migrations/20220916070101 new file mode 100644 index 00000000000..90afdffcddb --- /dev/null +++ b/db/schema_migrations/20220916070101 @@ -0,0 +1 @@ +e63bd78b80b7a5a475f0246fb8d2dcb1164f410705dfae44579dce5579655841
\ No newline at end of file diff --git a/db/schema_migrations/20220916094641 b/db/schema_migrations/20220916094641 new file mode 100644 index 00000000000..d3ab02d6c59 --- /dev/null +++ b/db/schema_migrations/20220916094641 @@ -0,0 +1 @@ +a5fc50591f5070766ae1d8b4dee195ec91df5fb1aa635c0d39d3d897e54393a5
\ No newline at end of file diff --git a/db/schema_migrations/20220916103311 b/db/schema_migrations/20220916103311 new file mode 100644 index 00000000000..cc265c0800e --- /dev/null +++ b/db/schema_migrations/20220916103311 @@ -0,0 +1 @@ +dbaeae67bb734a491dd40860159285b41d25a3336198f55a52f28190a8f6aeac
\ No newline at end of file diff --git a/db/schema_migrations/20220918124223 b/db/schema_migrations/20220918124223 new file mode 100644 index 00000000000..227bca2ab75 --- /dev/null +++ b/db/schema_migrations/20220918124223 @@ -0,0 +1 @@ +ff995d7a3c23959c4d4e6c6d0adfd338be36f6c07c98bacd26f282d84b2fa33d
\ No newline at end of file diff --git a/db/schema_migrations/20220919023208 b/db/schema_migrations/20220919023208 new file mode 100644 index 00000000000..30c305baaeb --- /dev/null +++ b/db/schema_migrations/20220919023208 @@ -0,0 +1 @@ +e4e86511961bf3618bd3683e1bc97a8382bfa1369bd76186f01cfac9e80e0593
\ No newline at end of file diff --git a/db/schema_migrations/20220919041604 b/db/schema_migrations/20220919041604 new file mode 100644 index 00000000000..e6943902bf3 --- /dev/null +++ b/db/schema_migrations/20220919041604 @@ -0,0 +1 @@ +a4115d5542d236a030db180363cf2c816ff68cd2c2a54e74a6b3ba916a40816e
\ No newline at end of file diff --git a/db/schema_migrations/20220919050555 b/db/schema_migrations/20220919050555 new file mode 100644 index 00000000000..29d8d150809 --- /dev/null +++ b/db/schema_migrations/20220919050555 @@ -0,0 +1 @@ +ac61a72c2c197735404e6bccf3f2ceb9c3f5ff79c7df58f83b6ab1b55b81e532
\ No newline at end of file diff --git a/db/schema_migrations/20220919225631 b/db/schema_migrations/20220919225631 new file mode 100644 index 00000000000..e30af0fd9f7 --- /dev/null +++ b/db/schema_migrations/20220919225631 @@ -0,0 +1 @@ +03accc241b8955f0ccfa3b40168e9f194360704d8937cd531683191b8fe4f8c8
\ No newline at end of file diff --git a/db/schema_migrations/20220920022404 b/db/schema_migrations/20220920022404 new file mode 100644 index 00000000000..cbf8fedc39d --- /dev/null +++ b/db/schema_migrations/20220920022404 @@ -0,0 +1 @@ +eec898c4b2ab4d0585d8259b9d0c1e644720c0ba665429434abea9a1062be367
\ No newline at end of file diff --git a/db/schema_migrations/20220920081631 b/db/schema_migrations/20220920081631 new file mode 100644 index 00000000000..071ef93fc7a --- /dev/null +++ b/db/schema_migrations/20220920081631 @@ -0,0 +1 @@ +081480492cbe6e631f0357b181a883a2bc7f34566f23f119c0ba4df59ee363d6
\ No newline at end of file diff --git a/db/schema_migrations/20220920122121 b/db/schema_migrations/20220920122121 new file mode 100644 index 00000000000..7da41e83a11 --- /dev/null +++ b/db/schema_migrations/20220920122121 @@ -0,0 +1 @@ +fb6b88494168ef86863f41570a2bad1141d6c6e2305522bf622413702e3b3493
\ No newline at end of file diff --git a/db/schema_migrations/20220920124709 b/db/schema_migrations/20220920124709 new file mode 100644 index 00000000000..e3b015d44a7 --- /dev/null +++ b/db/schema_migrations/20220920124709 @@ -0,0 +1 @@ +4a975867dc0539049902229521b4d94f940817ffd9196810856c8eb962c57e62
\ No newline at end of file diff --git a/db/schema_migrations/20220920135356 b/db/schema_migrations/20220920135356 new file mode 100644 index 00000000000..714228b2518 --- /dev/null +++ b/db/schema_migrations/20220920135356 @@ -0,0 +1 @@ +477f7b75c7d9b162add500924e5bbd9240ef76f3c56851748af8c6a59d912b7e
\ No newline at end of file diff --git a/db/schema_migrations/20220920141001 b/db/schema_migrations/20220920141001 new file mode 100644 index 00000000000..2e221e49afc --- /dev/null +++ b/db/schema_migrations/20220920141001 @@ -0,0 +1 @@ +368d6e417d6ac9c4ed3815b67f3247d55a6e4ec8a6e7ac255c7f9f24d3721f59
\ No newline at end of file diff --git a/db/schema_migrations/20220920213504 b/db/schema_migrations/20220920213504 new file mode 100644 index 00000000000..53d31de208d --- /dev/null +++ b/db/schema_migrations/20220920213504 @@ -0,0 +1 @@ +e683bd10619f9ceee2a5d330ca4d6b9d396ad8934095b707a0eec5d49cdaf2be
\ No newline at end of file diff --git a/db/schema_migrations/20220920214524 b/db/schema_migrations/20220920214524 new file mode 100644 index 00000000000..fc708e05214 --- /dev/null +++ b/db/schema_migrations/20220920214524 @@ -0,0 +1 @@ +6a4677165bca249c369214aee9fae331fde4dc716544bac93c06f0ee33222455
\ No newline at end of file diff --git a/db/schema_migrations/20220921093355 b/db/schema_migrations/20220921093355 new file mode 100644 index 00000000000..6083a370279 --- /dev/null +++ b/db/schema_migrations/20220921093355 @@ -0,0 +1 @@ +d7640b3756cf8cddf9f798362d6d8445a1d37092e4dff9ae263fe39a661b1e55
\ No newline at end of file diff --git a/db/schema_migrations/20220921111823 b/db/schema_migrations/20220921111823 new file mode 100644 index 00000000000..eeca2c10dad --- /dev/null +++ b/db/schema_migrations/20220921111823 @@ -0,0 +1 @@ +f06d7555d3541abbb9fd671df3718645203aef111674b91ad386dac434c4ede2
\ No newline at end of file diff --git a/db/schema_migrations/20220921111831 b/db/schema_migrations/20220921111831 new file mode 100644 index 00000000000..a03ad3f67dd --- /dev/null +++ b/db/schema_migrations/20220921111831 @@ -0,0 +1 @@ +a515d3e34f4b467c5e6fbd9b55135a676277ff6388eb1e3fc14df4b11d8eb3c0
\ No newline at end of file diff --git a/db/schema_migrations/20220921111840 b/db/schema_migrations/20220921111840 new file mode 100644 index 00000000000..7e84d96f124 --- /dev/null +++ b/db/schema_migrations/20220921111840 @@ -0,0 +1 @@ +0fdbb888bdbd4f68619466a8f4384e44062b0cf854790c648a6a060ab1e71806
\ No newline at end of file diff --git a/db/schema_migrations/20220921111849 b/db/schema_migrations/20220921111849 new file mode 100644 index 00000000000..3989dd78aeb --- /dev/null +++ b/db/schema_migrations/20220921111849 @@ -0,0 +1 @@ +2041cb81c534be0cc45b1cc77fa7fd2e31615129e1ba60a146cca88d58b77605
\ No newline at end of file diff --git a/db/schema_migrations/20220921111857 b/db/schema_migrations/20220921111857 new file mode 100644 index 00000000000..578b2c853f4 --- /dev/null +++ b/db/schema_migrations/20220921111857 @@ -0,0 +1 @@ +cbef1d036abb0035d710cf912e554e32fa88df3abaed17cb938e0b18032c7448
\ No newline at end of file diff --git a/db/schema_migrations/20220921111907 b/db/schema_migrations/20220921111907 new file mode 100644 index 00000000000..013f79024c9 --- /dev/null +++ b/db/schema_migrations/20220921111907 @@ -0,0 +1 @@ +fbc4c12aedd9d0f183e9444f2cb42c11a2b894c11684e80a5dbe847c7bccb21f
\ No newline at end of file diff --git a/db/schema_migrations/20220921144258 b/db/schema_migrations/20220921144258 new file mode 100644 index 00000000000..e3d9ad6a4de --- /dev/null +++ b/db/schema_migrations/20220921144258 @@ -0,0 +1 @@ +531758adf94d39b646e47601989f5f969eda8e9cbc2b2d6285826f9704575d3d
\ No newline at end of file diff --git a/db/schema_migrations/20220921174815 b/db/schema_migrations/20220921174815 new file mode 100644 index 00000000000..d67929e2029 --- /dev/null +++ b/db/schema_migrations/20220921174815 @@ -0,0 +1 @@ +2e20cfa3c1ebe77968ba923b381e0c95cb427613f2bfbed212ced4023bd4334e
\ No newline at end of file diff --git a/db/schema_migrations/20220921201347 b/db/schema_migrations/20220921201347 new file mode 100644 index 00000000000..d58f316fd02 --- /dev/null +++ b/db/schema_migrations/20220921201347 @@ -0,0 +1 @@ +f7c4b6a31434a0f6487fef89ba0c60fd38169e901437667bb6ccf60ba1a3bd4d
\ No newline at end of file diff --git a/db/schema_migrations/20220922090236 b/db/schema_migrations/20220922090236 new file mode 100644 index 00000000000..9f873bd86c2 --- /dev/null +++ b/db/schema_migrations/20220922090236 @@ -0,0 +1 @@ +6ce159118651ec93989e8f111528ad2134e46f359c483b60239290d677f9f4f4
\ No newline at end of file diff --git a/db/schema_migrations/20220922143143 b/db/schema_migrations/20220922143143 new file mode 100644 index 00000000000..72074c1efb3 --- /dev/null +++ b/db/schema_migrations/20220922143143 @@ -0,0 +1 @@ +79aa2360fdf84d7bee402cf51e29813b9c25acfe809123ac5a3218644a63c71f
\ No newline at end of file diff --git a/db/schema_migrations/20220922143612 b/db/schema_migrations/20220922143612 new file mode 100644 index 00000000000..4f93a218c74 --- /dev/null +++ b/db/schema_migrations/20220922143612 @@ -0,0 +1 @@ +4685b471f00f8ef5e8d8e521c50dc276c757c9f9caa50b1aa20c1f98b8b008c5
\ No newline at end of file diff --git a/db/schema_migrations/20220922143634 b/db/schema_migrations/20220922143634 new file mode 100644 index 00000000000..50d07dcf9de --- /dev/null +++ b/db/schema_migrations/20220922143634 @@ -0,0 +1 @@ +f48217567db22e6a4d3a32c607911da9f9a39a37d75be158a893ce840f718f02
\ No newline at end of file diff --git a/db/schema_migrations/20220922204106 b/db/schema_migrations/20220922204106 new file mode 100644 index 00000000000..0eabc077b58 --- /dev/null +++ b/db/schema_migrations/20220922204106 @@ -0,0 +1 @@ +e1106d4b77704a1ac4c185e0a6b500966dc61f46569de55650875aa6a89b7f9d
\ No newline at end of file diff --git a/db/schema_migrations/20220923052531 b/db/schema_migrations/20220923052531 new file mode 100644 index 00000000000..db7d24075f1 --- /dev/null +++ b/db/schema_migrations/20220923052531 @@ -0,0 +1 @@ +198d1447a8a857ea18409fe99e5a5a616d966b480bb6fc8f05613a651fdcd8a9
\ No newline at end of file diff --git a/db/schema_migrations/20220923060226 b/db/schema_migrations/20220923060226 new file mode 100644 index 00000000000..daaf2407607 --- /dev/null +++ b/db/schema_migrations/20220923060226 @@ -0,0 +1 @@ +19799d51a2b9acc7b1642edebea85ca8a19d2dd8368c4f0814c6c7a4c529ef98
\ No newline at end of file diff --git a/db/schema_migrations/20220923103006 b/db/schema_migrations/20220923103006 new file mode 100644 index 00000000000..8a11ebc8f8f --- /dev/null +++ b/db/schema_migrations/20220923103006 @@ -0,0 +1 @@ +184e634f62549f3fa2f183003957a2f5a5c53b34394ec3430eb0293076ae177a
\ No newline at end of file diff --git a/db/schema_migrations/20220927155407 b/db/schema_migrations/20220927155407 new file mode 100644 index 00000000000..a704ba7cb41 --- /dev/null +++ b/db/schema_migrations/20220927155407 @@ -0,0 +1 @@ +97bdc9d31ed93897f3133459779207b3b750530b615e243a625681d433090e94
\ No newline at end of file diff --git a/db/schema_migrations/20220928201920 b/db/schema_migrations/20220928201920 new file mode 100644 index 00000000000..e77f9abf6a0 --- /dev/null +++ b/db/schema_migrations/20220928201920 @@ -0,0 +1 @@ +b2492ebefc3738dfe706379ef664d3f28315102acc1c0681ba67e6aae62861d7
\ No newline at end of file diff --git a/db/schema_migrations/20220928225711 b/db/schema_migrations/20220928225711 new file mode 100644 index 00000000000..fd7a8b303d1 --- /dev/null +++ b/db/schema_migrations/20220928225711 @@ -0,0 +1 @@ +5ec9b3f36a986cbb86c8005a4425307f0f4399a4a4030460e715370630cb9490
\ No newline at end of file diff --git a/db/schema_migrations/20220929081645 b/db/schema_migrations/20220929081645 new file mode 100644 index 00000000000..a6fb1a6a74d --- /dev/null +++ b/db/schema_migrations/20220929081645 @@ -0,0 +1 @@ +ac34f2215272e69efc486affa8ad06347221d63ddadafe995f6e98f355a49936
\ No newline at end of file diff --git a/db/schema_migrations/20220929091500 b/db/schema_migrations/20220929091500 new file mode 100644 index 00000000000..66997dd37d9 --- /dev/null +++ b/db/schema_migrations/20220929091500 @@ -0,0 +1 @@ +c636f10079d7b718b777b78c22b66ca8828518d9dc8a3f6abe47e25af14ae20b
\ No newline at end of file diff --git a/db/schema_migrations/20220929101947 b/db/schema_migrations/20220929101947 new file mode 100644 index 00000000000..4969db4f283 --- /dev/null +++ b/db/schema_migrations/20220929101947 @@ -0,0 +1 @@ +946e773d09863fe029507ac44b41a61ed0b6b766f7296759743cf09addfacfcd
\ No newline at end of file diff --git a/db/schema_migrations/20220929171925 b/db/schema_migrations/20220929171925 new file mode 100644 index 00000000000..b2e471bb32c --- /dev/null +++ b/db/schema_migrations/20220929171925 @@ -0,0 +1 @@ +352e1b200a7e5074c58fdcfd0c9ae9b3535054a0b3d9852caabde635d9a1ad94
\ No newline at end of file diff --git a/db/schema_migrations/20220929172356 b/db/schema_migrations/20220929172356 new file mode 100644 index 00000000000..3200898ddb5 --- /dev/null +++ b/db/schema_migrations/20220929172356 @@ -0,0 +1 @@ +9cdc6169dc4925f43aabb2f4bcf597333a4112135001a5d1a6961853a78c90da
\ No newline at end of file diff --git a/db/schema_migrations/20220929194453 b/db/schema_migrations/20220929194453 new file mode 100644 index 00000000000..25d512b792b --- /dev/null +++ b/db/schema_migrations/20220929194453 @@ -0,0 +1 @@ +0f625bd9df16d035dd8cd73d5097e5b5f4d1b900183bd6ccf4b1489319535df6
\ No newline at end of file diff --git a/db/schema_migrations/20220929213730 b/db/schema_migrations/20220929213730 new file mode 100644 index 00000000000..469e84f8217 --- /dev/null +++ b/db/schema_migrations/20220929213730 @@ -0,0 +1 @@ +f74b8524fcdabd1646bbb47a32f8e3a29a848eb457f465d33a9e81bf4462e2ea
\ No newline at end of file diff --git a/db/schema_migrations/20220930110127 b/db/schema_migrations/20220930110127 new file mode 100644 index 00000000000..b88603e17d9 --- /dev/null +++ b/db/schema_migrations/20220930110127 @@ -0,0 +1 @@ +6a37ea8ea1ae2b90d12db67b2fa6adac2ed5b936f6c45d2142dc8390883f764a
\ No newline at end of file diff --git a/db/schema_migrations/20220930125609 b/db/schema_migrations/20220930125609 new file mode 100644 index 00000000000..65e00dbd945 --- /dev/null +++ b/db/schema_migrations/20220930125609 @@ -0,0 +1 @@ +cba5fad6379efe681dfc19a02522de7c904705790de588d07ed12f032fab760e
\ No newline at end of file diff --git a/db/schema_migrations/20221003192827 b/db/schema_migrations/20221003192827 new file mode 100644 index 00000000000..803c269b6e0 --- /dev/null +++ b/db/schema_migrations/20221003192827 @@ -0,0 +1 @@ +7fe33b22601469d1f15ee67241775e7a14d96841a49129fe98bfd2f44cf6666f
\ No newline at end of file diff --git a/db/schema_migrations/20221004092038 b/db/schema_migrations/20221004092038 new file mode 100644 index 00000000000..c7305a46cfd --- /dev/null +++ b/db/schema_migrations/20221004092038 @@ -0,0 +1 @@ +584d43304f92cc638783ffc5c8ab2dc8e511169c76da7661cb4c5ddded6c02d1
\ No newline at end of file diff --git a/db/schema_migrations/20221004094814 b/db/schema_migrations/20221004094814 new file mode 100644 index 00000000000..f3ac2ccb0d3 --- /dev/null +++ b/db/schema_migrations/20221004094814 @@ -0,0 +1 @@ +b274eaa3ef886e5de6fe5dacb11ab72a724a07a5022da6c01b94309fdaebfd0b
\ No newline at end of file diff --git a/db/schema_migrations/20221005072353 b/db/schema_migrations/20221005072353 new file mode 100644 index 00000000000..3249a062aa7 --- /dev/null +++ b/db/schema_migrations/20221005072353 @@ -0,0 +1 @@ +6b90dfb738c597a45ecaae792e97e1ae0decb93779ecc35fbc2fbaedafb5b9d1
\ No newline at end of file diff --git a/db/schema_migrations/20221005094926 b/db/schema_migrations/20221005094926 new file mode 100644 index 00000000000..7606c06170f --- /dev/null +++ b/db/schema_migrations/20221005094926 @@ -0,0 +1 @@ +ab93968543b6aec0bc304a2c0dc051f63a29b4765df11432fba45325e5e75e55
\ No newline at end of file diff --git a/db/schema_migrations/20221005103000 b/db/schema_migrations/20221005103000 new file mode 100644 index 00000000000..6403e3106a2 --- /dev/null +++ b/db/schema_migrations/20221005103000 @@ -0,0 +1 @@ +ac1aa3697f6e4230bfdc41f34e2e87ef49f697cfa46139fe3ac91a42b7bf4b91
\ No newline at end of file diff --git a/db/schema_migrations/20221005103010 b/db/schema_migrations/20221005103010 new file mode 100644 index 00000000000..9bf2bba87ca --- /dev/null +++ b/db/schema_migrations/20221005103010 @@ -0,0 +1 @@ +85deb0dcce9b1d43b3c978f2615afabe1f29304f65cf01a82d9b116d3276337f
\ No newline at end of file diff --git a/db/schema_migrations/20221006083240 b/db/schema_migrations/20221006083240 new file mode 100644 index 00000000000..51c509f471c --- /dev/null +++ b/db/schema_migrations/20221006083240 @@ -0,0 +1 @@ +0ad92f76e14b2e9286b2f77f32c00dba8ae29b64035f79641451edfdc725c92a
\ No newline at end of file diff --git a/db/schema_migrations/20221006131506 b/db/schema_migrations/20221006131506 new file mode 100644 index 00000000000..cafb6518fdd --- /dev/null +++ b/db/schema_migrations/20221006131506 @@ -0,0 +1 @@ +2652f733d5998b4dacc89a7c43af45e6d411235efcdc120be02bbf04eb1c55d6
\ No newline at end of file diff --git a/db/schema_migrations/20221006141145 b/db/schema_migrations/20221006141145 new file mode 100644 index 00000000000..269913ca389 --- /dev/null +++ b/db/schema_migrations/20221006141145 @@ -0,0 +1 @@ +ae45bc7d67354b64e359ac7fadefec6a0d81cd529f5ae2517a6a6a5d250f9024
\ No newline at end of file diff --git a/db/schema_migrations/20221006172302 b/db/schema_migrations/20221006172302 new file mode 100644 index 00000000000..361fdd78086 --- /dev/null +++ b/db/schema_migrations/20221006172302 @@ -0,0 +1 @@ +19e5ca6f9716fd41bfe8a103dab8a1dc37107f99503abedbdcb8175b699283f2
\ No newline at end of file diff --git a/db/schema_migrations/20221008032350 b/db/schema_migrations/20221008032350 new file mode 100644 index 00000000000..8b76b056a77 --- /dev/null +++ b/db/schema_migrations/20221008032350 @@ -0,0 +1 @@ +c5e373b1b416455b67b7bc0affe244295e1f1a2f105fe8ef6efddf8b07da2a86
\ No newline at end of file diff --git a/db/schema_migrations/20221009085130 b/db/schema_migrations/20221009085130 new file mode 100644 index 00000000000..cbdfb3014cd --- /dev/null +++ b/db/schema_migrations/20221009085130 @@ -0,0 +1 @@ +125ce9bf81966840774eb69be7995c1a8e2abd901fe5f19b73df43a577a9dc44
\ No newline at end of file diff --git a/db/schema_migrations/20221010074914 b/db/schema_migrations/20221010074914 new file mode 100644 index 00000000000..272a8d038cc --- /dev/null +++ b/db/schema_migrations/20221010074914 @@ -0,0 +1 @@ +c5ef65edf6e87495bc4dc16c636b2f2d8cbd63f3903cf5ed1364206b83411ba9
\ No newline at end of file diff --git a/db/schema_migrations/20221010121510 b/db/schema_migrations/20221010121510 new file mode 100644 index 00000000000..4c73958df10 --- /dev/null +++ b/db/schema_migrations/20221010121510 @@ -0,0 +1 @@ +ab9ab20d1a220e715a758f6175fcaf5c62cb240f49a2ad4227f7cd11f030fa1d
\ No newline at end of file diff --git a/db/schema_migrations/20221010121807 b/db/schema_migrations/20221010121807 new file mode 100644 index 00000000000..e5ca8007519 --- /dev/null +++ b/db/schema_migrations/20221010121807 @@ -0,0 +1 @@ +44e6b2519ef285366d1a2b4ea6efe18a9c22bfdb545c11502eae9383123b6001
\ No newline at end of file diff --git a/db/schema_migrations/20221010122138 b/db/schema_migrations/20221010122138 new file mode 100644 index 00000000000..9a9898a37b0 --- /dev/null +++ b/db/schema_migrations/20221010122138 @@ -0,0 +1 @@ +1275aff394d75cc254e664a81f52880bc248343dad7a07162973cafe268d40e6
\ No newline at end of file diff --git a/db/schema_migrations/20221010122352 b/db/schema_migrations/20221010122352 new file mode 100644 index 00000000000..a785dc22539 --- /dev/null +++ b/db/schema_migrations/20221010122352 @@ -0,0 +1 @@ +a982eed3131805db693882a8da7c5c5d1572f7825eb51a45c468bd5dfbded58b
\ No newline at end of file diff --git a/db/schema_migrations/20221010123040 b/db/schema_migrations/20221010123040 new file mode 100644 index 00000000000..85ad72c702b --- /dev/null +++ b/db/schema_migrations/20221010123040 @@ -0,0 +1 @@ +a3c66e57959f3e183a5b933138c9deedb5575e0b90b3a862b7b8e20331ffa31e
\ No newline at end of file diff --git a/db/schema_migrations/20221011113928 b/db/schema_migrations/20221011113928 new file mode 100644 index 00000000000..1552b7193f3 --- /dev/null +++ b/db/schema_migrations/20221011113928 @@ -0,0 +1 @@ +70f78c3af8d43ea71a795d0cd28bf74aa8a5232ea5e5b9dcb59699b5f8cccfaa
\ No newline at end of file diff --git a/db/schema_migrations/20221011162637 b/db/schema_migrations/20221011162637 new file mode 100644 index 00000000000..c16e511e516 --- /dev/null +++ b/db/schema_migrations/20221011162637 @@ -0,0 +1 @@ +b39261356f0ca89d543f680e1b28f3e3bdf468b02d6f8ea21c6ea1a1af91420c
\ No newline at end of file diff --git a/db/schema_migrations/20221011210455 b/db/schema_migrations/20221011210455 new file mode 100644 index 00000000000..2a6a7349f5d --- /dev/null +++ b/db/schema_migrations/20221011210455 @@ -0,0 +1 @@ +3c2445871613743560b2dd0a111fafab30f503b1c462e7ba7aee03f85e25f775
\ No newline at end of file diff --git a/db/schema_migrations/20221012033107 b/db/schema_migrations/20221012033107 new file mode 100644 index 00000000000..ba1df6370d3 --- /dev/null +++ b/db/schema_migrations/20221012033107 @@ -0,0 +1 @@ +23252a63b8aab6a062cf22db563f8518213d40110449732866e6d8d5092d369e
\ No newline at end of file diff --git a/db/schema_migrations/20221012135524 b/db/schema_migrations/20221012135524 new file mode 100644 index 00000000000..7a4503dde08 --- /dev/null +++ b/db/schema_migrations/20221012135524 @@ -0,0 +1 @@ +e5fc4ce0fdba01b55de0a1d5a968ab9b1ad3bc930ab61c6187a223e62252c8bc
\ No newline at end of file diff --git a/db/schema_migrations/20221012182701 b/db/schema_migrations/20221012182701 new file mode 100644 index 00000000000..5a6b47c4026 --- /dev/null +++ b/db/schema_migrations/20221012182701 @@ -0,0 +1 @@ +82f67746e79bcc63e5674f2e009eb9a827e019409c9277f6cd1ce2e41c50c296
\ No newline at end of file diff --git a/db/schema_migrations/20221013154159 b/db/schema_migrations/20221013154159 new file mode 100644 index 00000000000..2e147bb199d --- /dev/null +++ b/db/schema_migrations/20221013154159 @@ -0,0 +1 @@ +dbf241baf6d3deb1ef29a7cdca012050cab51c5f86762a0363d9dc4dc14fd804
\ No newline at end of file diff --git a/db/schema_migrations/20221014031033 b/db/schema_migrations/20221014031033 new file mode 100644 index 00000000000..6a24a2027c7 --- /dev/null +++ b/db/schema_migrations/20221014031033 @@ -0,0 +1 @@ +bc05939dc672c078161cd9b7dbd7f92601edb6888a77c62adb014964e30c6ae8
\ No newline at end of file diff --git a/db/schema_migrations/20221014034338 b/db/schema_migrations/20221014034338 new file mode 100644 index 00000000000..c90dfebb72b --- /dev/null +++ b/db/schema_migrations/20221014034338 @@ -0,0 +1 @@ +58ee7f51a0da4ee4ec471d4492106d1fc3124419ba83591913967d6bd38105e5
\ No newline at end of file diff --git a/db/schema_migrations/20221014190040 b/db/schema_migrations/20221014190040 new file mode 100644 index 00000000000..ce6387c3e43 --- /dev/null +++ b/db/schema_migrations/20221014190040 @@ -0,0 +1 @@ +2ac315a49a5026938abc21a98974fd42b39b7535d86530085a01fc7f5687bb0e
\ No newline at end of file diff --git a/db/schema_migrations/20221018081416 b/db/schema_migrations/20221018081416 new file mode 100644 index 00000000000..4b92b46709a --- /dev/null +++ b/db/schema_migrations/20221018081416 @@ -0,0 +1 @@ +25030e3ba7c6632fa86100c2db320d1e0c431f992e2b3e333a98e7e03bd31a49
\ No newline at end of file diff --git a/db/structure.sql b/db/structure.sql index bfdb4e508f2..2dab5e7abc9 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -22,40 +22,6 @@ RETURN NULL; END $$; -CREATE FUNCTION function_for_trigger_a645cee67576() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."service_id" := NEW."integration_id"; - RETURN NEW; -END -$$; - -CREATE FUNCTION function_for_trigger_a87bcfdf0f0b() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - IF NEW."service_id" IS NULL AND NEW."integration_id" IS NOT NULL THEN - NEW."service_id" = NEW."integration_id"; - END IF; - - IF NEW."integration_id" IS NULL AND NEW."service_id" IS NOT NULL THEN - NEW."integration_id" = NEW."service_id"; - END IF; - - RETURN NEW; -END -$$; - -CREATE FUNCTION function_for_trigger_aca5c963d732() RETURNS trigger - LANGUAGE plpgsql - AS $$ -BEGIN - NEW."integration_id" := NEW."service_id"; - RETURN NEW; -END -$$; - CREATE FUNCTION gitlab_schema_prevent_write() RETURNS trigger LANGUAGE plpgsql AS $$ @@ -11507,6 +11473,24 @@ 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, + clickhouse_connection_string 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, + dashboard_notification_limit integer DEFAULT 0 NOT NULL, + dashboard_enforcement_limit integer DEFAULT 0 NOT NULL, + dashboard_limit_new_namespace_creation_enforcement_date date, + can_create_group boolean DEFAULT true NOT NULL, + lock_maven_package_requests_forwarding boolean DEFAULT false NOT NULL, + lock_pypi_package_requests_forwarding boolean DEFAULT false NOT NULL, + lock_npm_package_requests_forwarding boolean DEFAULT false NOT NULL, + password_expiration_enabled boolean DEFAULT false NOT NULL, + password_expires_in_days integer DEFAULT 90 NOT NULL, + password_expires_notice_before_days integer DEFAULT 7 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)), @@ -11543,12 +11527,16 @@ CREATE TABLE application_settings ( CONSTRAINT check_9c6c447a13 CHECK ((char_length(maintenance_mode_message) <= 255)), CONSTRAINT check_a5704163cc CHECK ((char_length(secret_detection_revocation_token_types_url) <= 255)), CONSTRAINT check_d03919528d CHECK ((char_length(container_registry_vendor) <= 255)), + CONSTRAINT check_d4865d70f3 CHECK ((char_length(clickhouse_connection_string) <= 1024)), CONSTRAINT check_d820146492 CHECK ((char_length(spam_check_endpoint_url) <= 255)), + CONSTRAINT check_dea8792229 CHECK ((char_length(jitsu_host) <= 255)), 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_f6563bc000 CHECK ((char_length(arkose_labs_verify_api_url) <= 255)), + CONSTRAINT check_fc732c181e CHECK ((char_length(jitsu_project_xid) <= 255)) ); COMMENT ON COLUMN application_settings.content_validation_endpoint_url IS 'JiHu-specific column'; @@ -11585,6 +11573,12 @@ COMMENT ON COLUMN application_settings.encrypted_feishu_app_secret IS 'JiHu-spec COMMENT ON COLUMN application_settings.encrypted_feishu_app_secret_iv IS 'JiHu-specific column'; +COMMENT ON COLUMN application_settings.password_expiration_enabled IS 'JiHu-specific column'; + +COMMENT ON COLUMN application_settings.password_expires_in_days IS 'JiHu-specific column'; + +COMMENT ON COLUMN application_settings.password_expires_notice_before_days IS 'JiHu-specific column'; + CREATE SEQUENCE application_settings_id_seq START WITH 1 INCREMENT BY 1 @@ -11625,6 +11619,7 @@ CREATE TABLE approval_merge_request_rules ( scanners text[] DEFAULT '{}'::text[] NOT NULL, severity_levels text[] DEFAULT '{}'::text[] NOT NULL, vulnerability_states text[] DEFAULT '{newly_detected}'::text[] NOT NULL, + security_orchestration_policy_configuration_id bigint, CONSTRAINT check_6fca5928b2 CHECK ((char_length(section) <= 255)) ); @@ -11696,7 +11691,8 @@ CREATE TABLE approval_project_rules ( report_type smallint, vulnerability_states text[] DEFAULT '{newly_detected}'::text[] NOT NULL, orchestration_policy_idx smallint, - applies_to_all_protected_branches boolean DEFAULT false NOT NULL + applies_to_all_protected_branches boolean DEFAULT false NOT NULL, + security_orchestration_policy_configuration_id bigint ); CREATE TABLE approval_project_rules_groups ( @@ -12354,6 +12350,7 @@ CREATE TABLE bulk_import_entities ( jid text, created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, + source_xid integer, CONSTRAINT check_13f279f7da CHECK ((char_length(source_full_path) <= 255)), CONSTRAINT check_715d725ea2 CHECK ((char_length(destination_name) <= 255)), CONSTRAINT check_796a4d9cc6 CHECK ((char_length(jid) <= 255)), @@ -12595,7 +12592,6 @@ CREATE TABLE ci_build_trace_metadata ( CREATE TABLE ci_builds ( status character varying, finished_at timestamp without time zone, - trace text, created_at timestamp without time zone, updated_at timestamp without time zone, started_at timestamp without time zone, @@ -12766,7 +12762,7 @@ CREATE TABLE ci_group_variables ( masked boolean DEFAULT false NOT NULL, variable_type smallint DEFAULT 1 NOT NULL, environment_scope text DEFAULT '*'::text NOT NULL, - raw boolean DEFAULT true NOT NULL, + raw boolean DEFAULT false NOT NULL, CONSTRAINT check_dfe009485a CHECK ((char_length(environment_scope) <= 255)) ); @@ -12787,7 +12783,7 @@ CREATE TABLE ci_instance_variables ( key text NOT NULL, encrypted_value text, encrypted_value_iv text, - raw boolean DEFAULT true NOT NULL, + raw boolean DEFAULT false NOT NULL, CONSTRAINT check_07a45a5bcb CHECK ((char_length(encrypted_value_iv) <= 255)), CONSTRAINT check_5aede12208 CHECK ((char_length(key) <= 255)), CONSTRAINT check_956afd70f1 CHECK ((char_length(encrypted_value) <= 13579)) @@ -12849,7 +12845,8 @@ CREATE TABLE ci_job_token_project_scope_links ( source_project_id bigint NOT NULL, target_project_id bigint NOT NULL, added_by_id bigint, - created_at timestamp with time zone NOT NULL + created_at timestamp with time zone NOT NULL, + direction smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE ci_job_token_project_scope_links_id_seq @@ -12869,7 +12866,7 @@ CREATE TABLE ci_job_variables ( job_id bigint NOT NULL, variable_type smallint DEFAULT 1 NOT NULL, source smallint DEFAULT 0 NOT NULL, - raw boolean DEFAULT true NOT NULL + raw boolean DEFAULT false NOT NULL ); CREATE SEQUENCE ci_job_variables_id_seq @@ -13040,6 +13037,13 @@ CREATE SEQUENCE ci_pipeline_messages_id_seq ALTER SEQUENCE ci_pipeline_messages_id_seq OWNED BY ci_pipeline_messages.id; +CREATE TABLE ci_pipeline_metadata ( + project_id bigint NOT NULL, + pipeline_id bigint NOT NULL, + title text NOT NULL, + CONSTRAINT check_e6a636a3f3 CHECK ((char_length(title) <= 255)) +); + CREATE TABLE ci_pipeline_schedule_variables ( id integer NOT NULL, key character varying NOT NULL, @@ -13051,7 +13055,7 @@ CREATE TABLE ci_pipeline_schedule_variables ( created_at timestamp with time zone, updated_at timestamp with time zone, variable_type smallint DEFAULT 1 NOT NULL, - raw boolean DEFAULT true NOT NULL + raw boolean DEFAULT false NOT NULL ); CREATE SEQUENCE ci_pipeline_schedule_variables_id_seq @@ -13095,8 +13099,8 @@ CREATE TABLE ci_pipeline_variables ( encrypted_value_iv character varying, pipeline_id integer NOT NULL, variable_type smallint DEFAULT 1 NOT NULL, - raw boolean DEFAULT true NOT NULL, - partition_id bigint DEFAULT 100 NOT NULL + partition_id bigint DEFAULT 100 NOT NULL, + raw boolean DEFAULT false NOT NULL ); CREATE SEQUENCE ci_pipeline_variables_id_seq @@ -13386,6 +13390,8 @@ CREATE TABLE ci_secure_files ( file text NOT NULL, checksum bytea NOT NULL, key_data text, + metadata jsonb, + expires_at timestamp with time zone, CONSTRAINT check_320790634d CHECK ((char_length(file) <= 255)), CONSTRAINT check_402c7b4a56 CHECK ((char_length(name) <= 255)), CONSTRAINT check_7279b4e293 CHECK ((char_length(key_data) <= 128)) @@ -13558,7 +13564,7 @@ CREATE TABLE ci_variables ( environment_scope character varying DEFAULT '*'::character varying NOT NULL, masked boolean DEFAULT false NOT NULL, variable_type smallint DEFAULT 1 NOT NULL, - raw boolean DEFAULT true NOT NULL + raw boolean DEFAULT false NOT NULL ); CREATE SEQUENCE ci_variables_id_seq @@ -14400,8 +14406,10 @@ CREATE TABLE dast_site_profiles ( target_type smallint DEFAULT 0 NOT NULL, scan_method smallint DEFAULT 0 NOT NULL, auth_submit_field text, + scan_file_path text, CONSTRAINT check_5203110fee CHECK ((char_length(auth_username_field) <= 255)), CONSTRAINT check_6cfab17b48 CHECK ((char_length(name) <= 255)), + CONSTRAINT check_8d2aa0f66d CHECK ((char_length(scan_file_path) <= 1024)), CONSTRAINT check_af44f54c96 CHECK ((char_length(auth_submit_field) <= 255)), CONSTRAINT check_c329dffdba CHECK ((char_length(auth_password_field) <= 255)), CONSTRAINT check_d446f7047b CHECK ((char_length(auth_url) <= 1024)), @@ -14973,6 +14981,7 @@ CREATE TABLE elastic_reindexing_tasks ( delete_original_index_at timestamp with time zone, max_slices_running smallint DEFAULT 60 NOT NULL, slice_multiplier smallint DEFAULT 2 NOT NULL, + targets text[], CONSTRAINT check_7f64acda8e CHECK ((char_length(error_message) <= 255)) ); @@ -16403,6 +16412,40 @@ CREATE SEQUENCE incident_management_pending_issue_escalations_id_seq ALTER SEQUENCE incident_management_pending_issue_escalations_id_seq OWNED BY incident_management_pending_issue_escalations.id; +CREATE TABLE incident_management_timeline_event_tag_links ( + id bigint NOT NULL, + timeline_event_id bigint NOT NULL, + timeline_event_tag_id bigint NOT NULL, + created_at timestamp with time zone NOT NULL +); + +CREATE SEQUENCE incident_management_timeline_event_tag_links_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE incident_management_timeline_event_tag_links_id_seq OWNED BY incident_management_timeline_event_tag_links.id; + +CREATE TABLE incident_management_timeline_event_tags ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id bigint NOT NULL, + name text NOT NULL, + CONSTRAINT check_8717184e2c CHECK ((char_length(name) <= 255)) +); + +CREATE SEQUENCE incident_management_timeline_event_tags_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE incident_management_timeline_event_tags_id_seq OWNED BY incident_management_timeline_event_tags.id; + CREATE TABLE incident_management_timeline_events ( id bigint NOT NULL, created_at timestamp with time zone NOT NULL, @@ -17269,9 +17312,7 @@ CREATE TABLE merge_request_assignees ( id bigint NOT NULL, user_id integer NOT NULL, merge_request_id integer NOT NULL, - created_at timestamp with time zone, - state smallint DEFAULT 0 NOT NULL, - updated_state_by_user_id bigint + created_at timestamp with time zone ); CREATE SEQUENCE merge_request_assignees_id_seq @@ -17513,8 +17554,7 @@ CREATE TABLE merge_request_reviewers ( user_id bigint NOT NULL, merge_request_id bigint NOT NULL, created_at timestamp with time zone NOT NULL, - state smallint DEFAULT 0 NOT NULL, - updated_state_by_user_id bigint + state smallint DEFAULT 0 NOT NULL ); CREATE SEQUENCE merge_request_reviewers_id_seq @@ -17735,6 +17775,7 @@ CREATE TABLE ml_candidate_metrics ( step integer, is_nan bytea, name text NOT NULL, + tracked_at bigint, CONSTRAINT check_3bb4a3fbd9 CHECK ((char_length(name) <= 250)) ); @@ -17860,7 +17901,8 @@ CREATE TABLE namespace_details ( cached_markdown_version integer, description text, description_html text, - free_user_cap_over_limt_notified_at timestamp with time zone + free_user_cap_over_limt_notified_at timestamp with time zone, + free_user_cap_over_limit_notified_at timestamp with time zone ); CREATE TABLE namespace_limits ( @@ -17876,6 +17918,12 @@ CREATE TABLE namespace_package_settings ( maven_duplicate_exception_regex text DEFAULT ''::text NOT NULL, generic_duplicates_allowed boolean DEFAULT true NOT NULL, generic_duplicate_exception_regex text DEFAULT ''::text NOT NULL, + maven_package_requests_forwarding boolean, + lock_maven_package_requests_forwarding boolean DEFAULT false NOT NULL, + pypi_package_requests_forwarding boolean, + lock_pypi_package_requests_forwarding boolean DEFAULT false NOT NULL, + npm_package_requests_forwarding boolean, + lock_npm_package_requests_forwarding boolean DEFAULT false NOT NULL, CONSTRAINT check_31340211b1 CHECK ((char_length(generic_duplicate_exception_regex) <= 255)), CONSTRAINT check_d63274b2b6 CHECK ((char_length(maven_duplicate_exception_regex) <= 255)) ); @@ -17915,15 +17963,17 @@ CREATE TABLE namespace_settings ( runner_token_expiration_interval integer, subgroup_runner_token_expiration_interval integer, project_runner_token_expiration_interval integer, - exclude_from_free_user_cap boolean DEFAULT false NOT NULL, show_diff_preview_in_email boolean DEFAULT true NOT NULL, enabled_git_access_protocol smallint DEFAULT 0 NOT NULL, unique_project_download_limit smallint DEFAULT 0 NOT NULL, unique_project_download_limit_interval_in_seconds integer DEFAULT 0 NOT NULL, project_import_level smallint DEFAULT 50 NOT NULL, - include_for_free_user_cap_preview boolean DEFAULT false NOT NULL, unique_project_download_limit_allowlist text[] DEFAULT '{}'::text[] NOT NULL, auto_ban_user_on_excessive_projects_download boolean DEFAULT false NOT NULL, + only_allow_merge_if_pipeline_succeeds boolean DEFAULT false NOT NULL, + allow_merge_on_skipped_pipeline boolean DEFAULT false NOT NULL, + only_allow_merge_if_all_discussions_are_resolved boolean DEFAULT false NOT NULL, + default_compliance_framework_id bigint, CONSTRAINT check_0ba93c78c7 CHECK ((char_length(default_branch_name) <= 255)), CONSTRAINT namespace_settings_unique_project_download_limit_allowlist_size CHECK ((cardinality(unique_project_download_limit_allowlist) <= 100)) ); @@ -18946,6 +18996,32 @@ CREATE TABLE packages_rpm_metadata ( CONSTRAINT check_c3e2fc2e89 CHECK ((char_length(release) <= 128)) ); +CREATE TABLE packages_rpm_repository_files ( + id bigint NOT NULL, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + project_id bigint NOT NULL, + file_store integer DEFAULT 1, + status smallint DEFAULT 0 NOT NULL, + size integer, + file_md5 bytea, + file_sha1 bytea, + file_sha256 bytea, + file text NOT NULL, + file_name text NOT NULL, + CONSTRAINT check_a9fef187f5 CHECK ((char_length(file) <= 255)), + CONSTRAINT check_b6b721b275 CHECK ((char_length(file_name) <= 255)) +); + +CREATE SEQUENCE packages_rpm_repository_files_id_seq + START WITH 1 + INCREMENT BY 1 + NO MINVALUE + NO MAXVALUE + CACHE 1; + +ALTER SEQUENCE packages_rpm_repository_files_id_seq OWNED BY packages_rpm_repository_files.id; + CREATE TABLE packages_rubygems_metadata ( created_at timestamp with time zone NOT NULL, updated_at timestamp with time zone NOT NULL, @@ -19662,7 +19738,8 @@ CREATE TABLE project_ci_cd_settings ( runner_token_expiration_interval integer, separated_caches boolean DEFAULT true NOT NULL, opt_in_jwt boolean DEFAULT false NOT NULL, - allow_fork_pipelines_to_run_in_parent_project boolean DEFAULT true NOT NULL + allow_fork_pipelines_to_run_in_parent_project boolean DEFAULT true NOT NULL, + inbound_job_token_scope_enabled boolean DEFAULT false NOT NULL ); CREATE SEQUENCE project_ci_cd_settings_id_seq @@ -20071,6 +20148,10 @@ CREATE TABLE project_settings ( enforce_auth_checks_on_uploads boolean DEFAULT true NOT NULL, selective_code_owner_removals boolean DEFAULT false NOT NULL, show_diff_preview_in_email boolean DEFAULT true NOT NULL, + jitsu_key text, + suggested_reviewers_enabled boolean DEFAULT false NOT NULL, + only_allow_merge_if_all_status_checks_passed boolean DEFAULT false NOT NULL, + CONSTRAINT check_2981f15877 CHECK ((char_length(jitsu_key) <= 100)), CONSTRAINT check_3a03e7557a CHECK ((char_length(previous_default_branch) <= 4096)), CONSTRAINT check_b09644994b CHECK ((char_length(squash_commit_template) <= 500)), CONSTRAINT check_bde223416c CHECK ((show_default_award_emojis IS NOT NULL)), @@ -20124,6 +20205,18 @@ CREATE SEQUENCE project_topics_id_seq ALTER SEQUENCE project_topics_id_seq OWNED BY project_topics.id; +CREATE TABLE project_wiki_repository_states ( + verification_started_at timestamp with time zone, + verification_retry_at timestamp with time zone, + verified_at timestamp with time zone, + project_id bigint NOT NULL, + verification_state smallint DEFAULT 0 NOT NULL, + verification_retry_count smallint, + verification_checksum bytea, + verification_failure text, + CONSTRAINT check_119f134b68 CHECK ((char_length(verification_failure) <= 255)) +); + CREATE TABLE projects ( id integer NOT NULL, name character varying, @@ -20505,7 +20598,8 @@ CREATE TABLE push_rules ( reject_unsigned_commits boolean, commit_committer_check boolean, regexp_uses_re2 boolean DEFAULT true, - commit_message_negative_regex character varying + commit_message_negative_regex character varying, + reject_non_dco_commits boolean ); CREATE SEQUENCE push_rules_id_seq @@ -20979,7 +21073,7 @@ CREATE TABLE sbom_sources ( updated_at timestamp with time zone NOT NULL, source_type smallint NOT NULL, source jsonb DEFAULT '{}'::jsonb NOT NULL, - fingerprint bytea NOT NULL + fingerprint bytea ); CREATE SEQUENCE sbom_sources_id_seq @@ -22032,7 +22126,20 @@ CREATE TABLE user_details ( registration_objective smallint, phone text, requires_credit_card_verification boolean DEFAULT false NOT NULL, + password_last_changed_at timestamp with time zone, + linkedin text DEFAULT ''::text NOT NULL, + twitter text DEFAULT ''::text NOT NULL, + skype text DEFAULT ''::text NOT NULL, + website_url text DEFAULT ''::text NOT NULL, + location text DEFAULT ''::text NOT NULL, + organization text DEFAULT ''::text NOT NULL, CONSTRAINT check_245664af82 CHECK ((char_length(webauthn_xid) <= 100)), + CONSTRAINT check_444573ee52 CHECK ((char_length(skype) <= 500)), + CONSTRAINT check_466a25be35 CHECK ((char_length(twitter) <= 500)), + CONSTRAINT check_7b246dad73 CHECK ((char_length(organization) <= 500)), + CONSTRAINT check_7d6489f8f3 CHECK ((char_length(linkedin) <= 500)), + CONSTRAINT check_7fe2044093 CHECK ((char_length(website_url) <= 500)), + CONSTRAINT check_8a7fcf8a60 CHECK ((char_length(location) <= 500)), CONSTRAINT check_a73b398c60 CHECK ((char_length(phone) <= 50)), CONSTRAINT check_eeeaf8d4f0 CHECK ((char_length(pronouns) <= 50)), CONSTRAINT check_f932ed37db CHECK ((char_length(pronunciation) <= 255)) @@ -22040,6 +22147,8 @@ CREATE TABLE user_details ( COMMENT ON COLUMN user_details.phone IS 'JiHu-specific column'; +COMMENT ON COLUMN user_details.password_last_changed_at IS 'JiHu-specific column'; + CREATE SEQUENCE user_details_user_id_seq START WITH 1 INCREMENT BY 1 @@ -22119,6 +22228,22 @@ CREATE SEQUENCE user_permission_export_uploads_id_seq ALTER SEQUENCE user_permission_export_uploads_id_seq OWNED BY user_permission_export_uploads.id; +CREATE TABLE user_phone_number_validations ( + user_id bigint NOT NULL, + validated_at timestamp with time zone, + created_at timestamp with time zone NOT NULL, + updated_at timestamp with time zone NOT NULL, + international_dial_code smallint NOT NULL, + verification_attempts smallint DEFAULT 0 NOT NULL, + risk_score smallint DEFAULT 0 NOT NULL, + country text NOT NULL, + phone_number text NOT NULL, + telesign_reference_xid text, + CONSTRAINT check_193736da9f CHECK ((char_length(country) <= 3)), + CONSTRAINT check_d2f31fc815 CHECK ((char_length(phone_number) <= 12)), + CONSTRAINT check_d7af4d3eb5 CHECK ((char_length(telesign_reference_xid) <= 255)) +); + CREATE TABLE user_preferences ( id integer NOT NULL, user_id integer NOT NULL, @@ -22142,12 +22267,13 @@ CREATE TABLE user_preferences ( setup_for_company boolean, render_whitespace_in_code boolean, tab_width smallint, - experience_level smallint, view_diffs_file_by_file boolean DEFAULT false NOT NULL, gitpod_enabled boolean DEFAULT false NOT NULL, markdown_surround_selection boolean DEFAULT true NOT NULL, diffs_deletion_color text, diffs_addition_color text, + markdown_automatic_lists boolean DEFAULT true NOT NULL, + use_legacy_web_ide boolean DEFAULT false NOT NULL, CONSTRAINT check_89bf269f41 CHECK ((char_length(diffs_deletion_color) <= 7)), CONSTRAINT check_d07ccd35f7 CHECK ((char_length(diffs_addition_color) <= 7)) ); @@ -22522,7 +22648,8 @@ CREATE TABLE vulnerability_feedback ( comment text, comment_timestamp timestamp with time zone, finding_uuid uuid, - dismissal_reason smallint + dismissal_reason smallint, + migrated_to_state_transition boolean DEFAULT false ); CREATE SEQUENCE vulnerability_feedback_id_seq @@ -22932,7 +23059,6 @@ CREATE TABLE web_hooks ( created_at timestamp without time zone, updated_at timestamp without time zone, type character varying DEFAULT 'ProjectHook'::character varying, - service_id integer, push_events boolean DEFAULT true NOT NULL, issues_events boolean DEFAULT false NOT NULL, merge_requests_events boolean DEFAULT false NOT NULL, @@ -23653,6 +23779,10 @@ ALTER TABLE ONLY incident_management_pending_alert_escalations ALTER COLUMN id S ALTER TABLE ONLY incident_management_pending_issue_escalations ALTER COLUMN id SET DEFAULT nextval('incident_management_pending_issue_escalations_id_seq'::regclass); +ALTER TABLE ONLY incident_management_timeline_event_tag_links ALTER COLUMN id SET DEFAULT nextval('incident_management_timeline_event_tag_links_id_seq'::regclass); + +ALTER TABLE ONLY incident_management_timeline_event_tags ALTER COLUMN id SET DEFAULT nextval('incident_management_timeline_event_tags_id_seq'::regclass); + ALTER TABLE ONLY incident_management_timeline_events ALTER COLUMN id SET DEFAULT nextval('incident_management_timeline_events_id_seq'::regclass); ALTER TABLE ONLY index_statuses ALTER COLUMN id SET DEFAULT nextval('index_statuses_id_seq'::regclass); @@ -23861,6 +23991,8 @@ ALTER TABLE ONLY packages_package_files ALTER COLUMN id SET DEFAULT nextval('pac ALTER TABLE ONLY packages_packages ALTER COLUMN id SET DEFAULT nextval('packages_packages_id_seq'::regclass); +ALTER TABLE ONLY packages_rpm_repository_files ALTER COLUMN id SET DEFAULT nextval('packages_rpm_repository_files_id_seq'::regclass); + ALTER TABLE ONLY packages_tags ALTER COLUMN id SET DEFAULT nextval('packages_tags_id_seq'::regclass); ALTER TABLE ONLY pages_deployment_states ALTER COLUMN pages_deployment_id SET DEFAULT nextval('pages_deployment_states_pages_deployment_id_seq'::regclass); @@ -25010,9 +25142,6 @@ ALTER TABLE ONLY chat_teams ALTER TABLE vulnerability_scanners ADD CONSTRAINT check_37608c9db5 CHECK ((char_length(vendor) <= 255)) NOT VALID; -ALTER TABLE members - ADD CONSTRAINT check_508774aac0 CHECK ((member_namespace_id IS NOT NULL)) NOT VALID; - ALTER TABLE sprints ADD CONSTRAINT check_ccd8a1eae0 CHECK ((start_date IS NOT NULL)) NOT VALID; @@ -25041,7 +25170,7 @@ ALTER TABLE ONLY ci_build_trace_metadata ADD CONSTRAINT ci_build_trace_metadata_pkey PRIMARY KEY (build_id); ALTER TABLE ONLY ci_builds_metadata - ADD CONSTRAINT ci_builds_metadata_pkey PRIMARY KEY (id); + ADD CONSTRAINT ci_builds_metadata_pkey PRIMARY KEY (id, partition_id); ALTER TABLE ONLY ci_builds ADD CONSTRAINT ci_builds_pkey PRIMARY KEY (id); @@ -25100,6 +25229,9 @@ ALTER TABLE ONLY ci_pipeline_chat_data ALTER TABLE ONLY ci_pipeline_messages ADD CONSTRAINT ci_pipeline_messages_pkey PRIMARY KEY (id); +ALTER TABLE ONLY ci_pipeline_metadata + ADD CONSTRAINT ci_pipeline_metadata_pkey PRIMARY KEY (pipeline_id); + ALTER TABLE ONLY ci_pipeline_schedule_variables ADD CONSTRAINT ci_pipeline_schedule_variables_pkey PRIMARY KEY (id); @@ -25607,6 +25739,12 @@ ALTER TABLE ONLY incident_management_pending_alert_escalations ALTER TABLE ONLY incident_management_pending_issue_escalations ADD CONSTRAINT incident_management_pending_issue_escalations_pkey PRIMARY KEY (id, process_at); +ALTER TABLE ONLY incident_management_timeline_event_tag_links + ADD CONSTRAINT incident_management_timeline_event_tag_links_pkey PRIMARY KEY (id); + +ALTER TABLE ONLY incident_management_timeline_event_tags + ADD CONSTRAINT incident_management_timeline_event_tags_pkey PRIMARY KEY (id); + ALTER TABLE ONLY incident_management_timeline_events ADD CONSTRAINT incident_management_timeline_events_pkey PRIMARY KEY (id); @@ -25994,6 +26132,9 @@ ALTER TABLE ONLY packages_pypi_metadata ALTER TABLE ONLY packages_rpm_metadata ADD CONSTRAINT packages_rpm_metadata_pkey PRIMARY KEY (package_id); +ALTER TABLE ONLY packages_rpm_repository_files + ADD CONSTRAINT packages_rpm_repository_files_pkey PRIMARY KEY (id); + ALTER TABLE ONLY packages_rubygems_metadata ADD CONSTRAINT packages_rubygems_metadata_pkey PRIMARY KEY (package_id); @@ -26132,6 +26273,9 @@ ALTER TABLE ONLY project_statistics ALTER TABLE ONLY project_topics ADD CONSTRAINT project_topics_pkey PRIMARY KEY (id); +ALTER TABLE ONLY project_wiki_repository_states + ADD CONSTRAINT project_wiki_repository_states_pkey PRIMARY KEY (project_id); + ALTER TABLE ONLY projects ADD CONSTRAINT projects_pkey PRIMARY KEY (id); @@ -26441,6 +26585,9 @@ ALTER TABLE ONLY user_namespace_callouts ALTER TABLE ONLY user_permission_export_uploads ADD CONSTRAINT user_permission_export_uploads_pkey PRIMARY KEY (id); +ALTER TABLE ONLY user_phone_number_validations + ADD CONSTRAINT user_phone_number_validations_pkey PRIMARY KEY (user_id); + ALTER TABLE ONLY user_preferences ADD CONSTRAINT user_preferences_pkey PRIMARY KEY (id); @@ -27556,6 +27703,10 @@ CREATE INDEX idx_analytics_devops_adoption_segments_on_namespace_id ON analytics CREATE INDEX idx_analytics_devops_adoption_snapshots_finalized ON analytics_devops_adoption_snapshots USING btree (namespace_id, end_time) WHERE (recorded_at >= end_time); +CREATE INDEX idx_approval_merge_request_rules_on_sec_orchestration_config_id ON approval_merge_request_rules USING btree (security_orchestration_policy_configuration_id); + +CREATE INDEX idx_approval_project_rules_on_sec_orchestration_config_id ON approval_project_rules USING btree (security_orchestration_policy_configuration_id); + CREATE INDEX idx_audit_events_part_on_entity_id_desc_author_id_created_at ON ONLY audit_events USING btree (entity_id, entity_type, id DESC, author_id, created_at); CREATE INDEX idx_award_emoji_on_user_emoji_name_awardable_type_awardable_id ON award_emoji USING btree (user_id, name, awardable_type, awardable_id); @@ -27642,6 +27793,8 @@ CREATE INDEX idx_mr_cc_diff_files_on_mr_cc_id_and_sha ON merge_request_context_c CREATE INDEX idx_mrs_on_target_id_and_created_at_and_state_id ON merge_requests USING btree (target_project_id, state_id, created_at, id); +CREATE UNIQUE INDEX idx_namespace_settings_on_default_compliance_framework_id ON namespace_settings USING btree (default_compliance_framework_id); + CREATE UNIQUE INDEX idx_on_compliance_management_frameworks_namespace_id_name ON compliance_management_frameworks USING btree (namespace_id, name); CREATE UNIQUE INDEX idx_on_external_approval_rules_project_id_external_url ON external_approval_rules USING btree (project_id, external_url); @@ -28028,12 +28181,14 @@ CREATE UNIQUE INDEX index_ci_build_trace_chunks_on_build_id_and_chunk_index ON c CREATE INDEX index_ci_build_trace_metadata_on_trace_artifact_id ON ci_build_trace_metadata USING btree (trace_artifact_id); -CREATE UNIQUE INDEX index_ci_builds_metadata_on_build_id ON ci_builds_metadata USING btree (build_id); - CREATE INDEX index_ci_builds_metadata_on_build_id_and_has_exposed_artifacts ON ci_builds_metadata USING btree (build_id) WHERE (has_exposed_artifacts IS TRUE); CREATE INDEX index_ci_builds_metadata_on_build_id_and_id_and_interruptible ON ci_builds_metadata USING btree (build_id) INCLUDE (id) WHERE (interruptible = true); +CREATE UNIQUE INDEX index_ci_builds_metadata_on_build_id_partition_id_unique ON ci_builds_metadata USING btree (build_id, partition_id); + +CREATE UNIQUE INDEX index_ci_builds_metadata_on_id_partition_id_unique ON ci_builds_metadata USING btree (id, partition_id); + CREATE INDEX index_ci_builds_metadata_on_project_id ON ci_builds_metadata USING btree (project_id); CREATE INDEX index_ci_builds_on_auto_canceled_by_id ON ci_builds USING btree (auto_canceled_by_id); @@ -28164,6 +28319,10 @@ CREATE UNIQUE INDEX index_ci_pipeline_chat_data_on_pipeline_id ON ci_pipeline_ch CREATE INDEX index_ci_pipeline_messages_on_pipeline_id ON ci_pipeline_messages USING btree (pipeline_id); +CREATE INDEX index_ci_pipeline_metadata_on_pipeline_id_title ON ci_pipeline_metadata USING btree (pipeline_id, title); + +CREATE INDEX index_ci_pipeline_metadata_on_project_id ON ci_pipeline_metadata USING btree (project_id); + CREATE UNIQUE INDEX index_ci_pipeline_schedule_variables_on_schedule_id_and_key ON ci_pipeline_schedule_variables USING btree (pipeline_schedule_id, key); CREATE INDEX index_ci_pipeline_schedules_on_next_run_at_and_active ON ci_pipeline_schedules USING btree (next_run_at, active); @@ -28938,6 +29097,12 @@ CREATE INDEX index_im_issuable_escalation_statuses_on_policy_id ON incident_mana CREATE UNIQUE INDEX index_im_oncall_schedules_on_project_id_and_iid ON incident_management_oncall_schedules USING btree (project_id, iid); +CREATE INDEX index_im_timeline_event_id ON incident_management_timeline_event_tag_links USING btree (timeline_event_id); + +CREATE UNIQUE INDEX index_im_timeline_event_tags_name_project_id ON incident_management_timeline_event_tags USING btree (project_id, name); + +CREATE UNIQUE INDEX index_im_timeline_event_tags_on_tag_id_and_event_id ON incident_management_timeline_event_tag_links USING btree (timeline_event_tag_id, timeline_event_id); + CREATE INDEX index_im_timeline_events_author_id ON incident_management_timeline_events USING btree (author_id); CREATE INDEX index_im_timeline_events_issue_id ON incident_management_timeline_events USING btree (issue_id); @@ -29116,6 +29281,8 @@ CREATE INDEX index_iterations_cadences_on_group_id ON iterations_cadences USING CREATE UNIQUE INDEX index_jira_connect_installations_on_client_key ON jira_connect_installations USING btree (client_key); +CREATE INDEX index_jira_connect_installations_on_instance_url ON jira_connect_installations USING btree (instance_url); + CREATE INDEX index_jira_connect_subscriptions_on_namespace_id ON jira_connect_subscriptions USING btree (namespace_id); CREATE INDEX index_jira_imports_on_label_id ON jira_imports USING btree (label_id); @@ -29236,8 +29403,6 @@ CREATE INDEX index_members_on_member_namespace_id ON members USING btree (member CREATE INDEX index_members_on_member_role_id ON members USING btree (member_role_id); -CREATE INDEX index_members_on_non_requested_non_invited_and_state_awaiting ON members USING btree (source_id) WHERE ((requested_at IS NULL) AND (invite_token IS NULL) AND (access_level > 5) AND (state = 1)); - CREATE INDEX index_members_on_requested_at ON members USING btree (requested_at); CREATE INDEX index_members_on_source_id_and_source_type ON members USING btree (source_id, source_type); @@ -29398,6 +29563,8 @@ CREATE INDEX index_ml_candidate_metrics_on_candidate_id ON ml_candidate_metrics CREATE INDEX index_ml_candidate_params_on_candidate_id ON ml_candidate_params USING btree (candidate_id); +CREATE UNIQUE INDEX index_ml_candidate_params_on_candidate_id_on_name ON ml_candidate_params USING btree (candidate_id, name); + CREATE UNIQUE INDEX index_ml_candidates_on_experiment_id_and_iid ON ml_candidates USING btree (experiment_id, iid); CREATE INDEX index_ml_candidates_on_user_id ON ml_candidates USING btree (user_id); @@ -29490,6 +29657,8 @@ CREATE INDEX index_notes_on_discussion_id ON notes USING btree (discussion_id); CREATE INDEX index_notes_on_id_where_confidential ON notes USING btree (id) WHERE (confidential = true); +CREATE INDEX index_notes_on_id_where_internal ON notes USING btree (id) WHERE (internal = true); + CREATE INDEX index_notes_on_line_code ON notes USING btree (line_code); CREATE INDEX index_notes_on_noteable_id_and_noteable_type_and_system ON notes USING btree (noteable_id, noteable_type, system); @@ -29540,12 +29709,6 @@ CREATE INDEX index_on_issues_closed_incidents_by_project_id_and_closed_at ON iss CREATE INDEX index_on_label_links_all_columns ON label_links USING btree (target_id, label_id, target_type); -CREATE INDEX index_on_merge_request_assignees_updated_state_by_user_id ON merge_request_assignees USING btree (updated_state_by_user_id); - -CREATE INDEX index_on_merge_request_assignees_user_id_and_state ON merge_request_assignees USING btree (user_id, state) WHERE (state = 2); - -CREATE INDEX index_on_merge_request_reviewers_updated_state_by_user_id ON merge_request_reviewers USING btree (updated_state_by_user_id); - CREATE INDEX index_on_merge_request_reviewers_user_id_and_state ON merge_request_reviewers USING btree (user_id, state) WHERE (state = 2); CREATE INDEX index_on_merge_requests_for_latest_diffs ON merge_requests USING btree (target_project_id) INCLUDE (id, latest_merge_request_diff_id); @@ -29682,6 +29845,8 @@ CREATE INDEX index_packages_packages_on_name_trigram ON packages_packages USING CREATE INDEX index_packages_packages_on_project_id_and_created_at ON packages_packages USING btree (project_id, created_at); +CREATE INDEX index_packages_packages_on_project_id_and_lower_version ON packages_packages USING btree (project_id, lower((version)::text)) WHERE (package_type = 4); + CREATE INDEX index_packages_packages_on_project_id_and_package_type ON packages_packages USING btree (project_id, package_type); CREATE INDEX index_packages_packages_on_project_id_and_status_and_id ON packages_packages USING btree (project_id, status, id); @@ -29692,6 +29857,8 @@ CREATE INDEX index_packages_project_id_name_partial_for_nuget ON packages_packag CREATE INDEX index_packages_rpm_metadata_on_package_id ON packages_rpm_metadata USING btree (package_id); +CREATE INDEX index_packages_rpm_repository_files_on_project_id ON packages_rpm_repository_files USING btree (project_id); + CREATE INDEX index_packages_tags_on_package_id ON packages_tags USING btree (package_id); CREATE INDEX index_packages_tags_on_package_id_and_updated_at ON packages_tags USING btree (package_id, updated_at DESC); @@ -29832,6 +29999,8 @@ CREATE INDEX index_project_group_links_on_project_id ON project_group_links USIN CREATE INDEX index_project_import_data_on_project_id ON project_import_data USING btree (project_id); +CREATE INDEX index_project_incident_management_settings_on_p_id_sla_timer ON project_incident_management_settings USING btree (project_id) WHERE (sla_timer = true); + CREATE INDEX index_project_members_on_id_temp ON members USING btree (id) WHERE ((source_type)::text = 'Project'::text); CREATE INDEX index_project_mirror_data_on_last_successful_update_at ON project_mirror_data USING btree (last_successful_update_at); @@ -29890,6 +30059,14 @@ CREATE INDEX index_project_topics_on_topic_id ON project_topics USING btree (top CREATE UNIQUE INDEX index_project_user_callouts_feature ON user_project_callouts USING btree (user_id, feature_name, project_id); +CREATE INDEX index_project_wiki_repository_states_failed_verification ON project_wiki_repository_states USING btree (verification_retry_at NULLS FIRST) WHERE (verification_state = 3); + +CREATE INDEX index_project_wiki_repository_states_needs_verification ON project_wiki_repository_states USING btree (verification_state) WHERE ((verification_state = 0) OR (verification_state = 3)); + +CREATE INDEX index_project_wiki_repository_states_on_verification_state ON project_wiki_repository_states USING btree (verification_state); + +CREATE INDEX index_project_wiki_repository_states_pending_verification ON project_wiki_repository_states USING btree (verified_at NULLS FIRST) WHERE (verification_state = 0); + CREATE INDEX index_projects_aimed_for_deletion ON projects USING btree (marked_for_deletion_at) WHERE ((marked_for_deletion_at IS NOT NULL) AND (pending_delete = false)); CREATE INDEX index_projects_api_created_at_id_desc ON projects USING btree (created_at, id DESC); @@ -30068,6 +30245,8 @@ CREATE INDEX index_releases_on_author_id_id_created_at ON releases USING btree ( CREATE INDEX index_releases_on_project_id_and_released_at_and_id ON releases USING btree (project_id, released_at, id); +CREATE INDEX index_releases_on_project_id_id ON releases USING btree (project_id, id); + CREATE UNIQUE INDEX index_releases_on_project_tag_unique ON releases USING btree (project_id, tag); CREATE INDEX index_releases_on_released_at ON releases USING btree (released_at); @@ -30178,16 +30357,24 @@ CREATE UNIQUE INDEX index_saved_replies_on_name_text_pattern_ops ON saved_replie CREATE INDEX index_sbom_component_versions_on_component_id ON sbom_component_versions USING btree (component_id); +CREATE UNIQUE INDEX index_sbom_component_versions_on_component_id_and_version ON sbom_component_versions USING btree (component_id, version); + +CREATE UNIQUE INDEX index_sbom_components_on_component_type_and_name ON sbom_components USING btree (component_type, name); + CREATE INDEX index_sbom_occurrences_on_component_id ON sbom_occurrences USING btree (component_id); CREATE INDEX index_sbom_occurrences_on_component_version_id ON sbom_occurrences USING btree (component_version_id); +CREATE UNIQUE INDEX index_sbom_occurrences_on_ingestion_attributes ON sbom_occurrences USING btree (project_id, component_id, component_version_id, source_id, commit_sha); + CREATE INDEX index_sbom_occurrences_on_pipeline_id ON sbom_occurrences USING btree (pipeline_id); CREATE INDEX index_sbom_occurrences_on_project_id ON sbom_occurrences USING btree (project_id); CREATE INDEX index_sbom_occurrences_on_source_id ON sbom_occurrences USING btree (source_id); +CREATE UNIQUE INDEX index_sbom_sources_on_source_type_and_source ON sbom_sources USING btree (source_type, source); + CREATE INDEX index_scim_identities_on_group_id ON scim_identities USING btree (group_id); CREATE UNIQUE INDEX index_scim_identities_on_lower_extern_uid_and_group_id ON scim_identities USING btree (lower((extern_uid)::text), group_id); @@ -30510,6 +30697,8 @@ CREATE INDEX index_user_namespace_callouts_on_namespace_id ON user_namespace_cal CREATE INDEX index_user_permission_export_uploads_on_user_id_and_status ON user_permission_export_uploads USING btree (user_id, status); +CREATE INDEX index_user_phone_validations_on_dial_code_phone_number ON user_phone_number_validations USING btree (international_dial_code, phone_number); + CREATE INDEX index_user_preferences_on_gitpod_enabled ON user_preferences USING btree (gitpod_enabled); CREATE UNIQUE INDEX index_user_preferences_on_user_id ON user_preferences USING btree (user_id); @@ -30564,7 +30753,7 @@ CREATE INDEX index_users_on_unconfirmed_email ON users USING btree (unconfirmed_ CREATE UNIQUE INDEX index_users_on_unlock_token ON users USING btree (unlock_token); -CREATE INDEX index_users_on_user_type ON users USING btree (user_type); +CREATE INDEX index_users_on_user_type_and_id ON users USING btree (user_type, id); CREATE INDEX index_users_on_username ON users USING btree (username); @@ -30596,6 +30785,8 @@ CREATE INDEX index_vuln_reads_on_namespace_id_state_severity_and_vuln_id ON vuln CREATE INDEX index_vuln_reads_on_project_id_state_severity_and_vuln_id ON vulnerability_reads USING btree (project_id, state, severity, vulnerability_id DESC); +CREATE INDEX index_vuln_reads_on_resolved_on_default_branch ON vulnerability_reads USING btree (project_id, state, id) WHERE (resolved_on_default_branch IS TRUE); + CREATE INDEX index_vulnerabilities_common_finder_query_on_default_branch ON vulnerabilities USING btree (project_id, state, report_type, present_on_default_branch, severity, id); CREATE INDEX index_vulnerabilities_on_author_id ON vulnerabilities USING btree (author_id); @@ -30752,8 +30943,6 @@ CREATE INDEX index_web_hooks_on_project_id ON web_hooks USING btree (project_id) CREATE INDEX index_web_hooks_on_project_id_recent_failures ON web_hooks USING btree (project_id, recent_failures); -CREATE INDEX index_web_hooks_on_service_id ON web_hooks USING btree (service_id); - CREATE INDEX index_web_hooks_on_type ON web_hooks USING btree (type); CREATE UNIQUE INDEX index_webauthn_registrations_on_credential_xid ON webauthn_registrations USING btree (credential_xid); @@ -30842,6 +31031,12 @@ CREATE UNIQUE INDEX partial_index_sop_configs_on_project_id ON security_orchestr CREATE INDEX partial_index_user_id_app_id_created_at_token_not_revoked ON oauth_access_tokens USING btree (resource_owner_id, application_id, created_at) WHERE (revoked_at IS NULL); +CREATE INDEX scan_finding_approval_mr_rule_index_merge_request_id ON approval_merge_request_rules USING btree (merge_request_id) WHERE (report_type = 4); + +CREATE INDEX scan_finding_approval_project_rule_index_created_at_project_id ON approval_project_rules USING btree (created_at, project_id) WHERE (report_type = 4); + +CREATE INDEX scan_finding_approval_project_rule_index_project_id ON approval_project_rules USING btree (project_id) WHERE (report_type = 4); + CREATE INDEX security_findings_confidence_idx ON ONLY security_findings USING btree (confidence); CREATE INDEX security_findings_project_fingerprint_idx ON ONLY security_findings USING btree (project_fingerprint); @@ -30864,6 +31059,10 @@ CREATE UNIQUE INDEX taggings_idx ON taggings USING btree (tag_id, taggable_id, t CREATE UNIQUE INDEX term_agreements_unique_index ON term_agreements USING btree (user_id, term_id); +CREATE INDEX tmp_idx_project_features_on_releases_al_and_repo_al_partial ON project_features USING btree (releases_access_level, repository_access_level) WHERE (releases_access_level > repository_access_level); + +CREATE INDEX tmp_idx_vulnerabilities_on_id_where_report_type_7_99 ON vulnerabilities USING btree (id) WHERE (report_type = ANY (ARRAY[7, 99])); + CREATE INDEX tmp_index_approval_merge_request_rules_on_report_type_equal_one ON approval_merge_request_rules USING btree (id, report_type) WHERE (report_type = 1); 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)); @@ -30876,15 +31075,15 @@ CREATE INDEX tmp_index_container_repos_on_non_migrated ON container_repositories CREATE INDEX tmp_index_container_repositories_on_id_migration_state ON container_repositories USING btree (id, migration_state); -CREATE INDEX tmp_index_for_null_project_namespace_id ON projects USING btree (id) WHERE (project_namespace_id IS NULL); +CREATE INDEX tmp_index_for_null_member_namespace_id ON members USING btree (member_namespace_id) WHERE (member_namespace_id IS NULL); CREATE INDEX tmp_index_for_project_namespace_id_migration_on_routes ON routes USING btree (id) WHERE ((namespace_id IS NULL) AND ((source_type)::text = 'Project'::text)); CREATE INDEX tmp_index_issues_on_issue_type_and_id ON issues USING btree (issue_type, id); -CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (state = 2); +CREATE INDEX tmp_index_members_on_id_where_namespace_id_null ON members USING btree (id) WHERE (member_namespace_id IS NULL); -CREATE INDEX tmp_index_merge_request_reviewers_on_attention_requested_state ON merge_request_reviewers USING btree (id) WHERE (state = 2); +CREATE INDEX tmp_index_members_on_state ON members USING btree (state) WHERE (state = 2); CREATE INDEX tmp_index_migrated_container_registries ON container_repositories USING btree (project_id) WHERE ((migration_state = 'import_done'::text) OR (created_at >= '2022-01-23 00:00:00'::timestamp without time zone)); @@ -30894,12 +31093,8 @@ 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_system_note_metadata_on_attention_request_actions ON system_note_metadata USING btree (id) WHERE ((action)::text = ANY ((ARRAY['attention_requested'::character varying, 'attention_request_removed'::character varying])::text[])); - CREATE INDEX tmp_index_system_note_metadata_on_id_where_task ON system_note_metadata USING btree (id, action) WHERE ((action)::text = 'task'::text); -CREATE INDEX tmp_index_user_callouts_on_attention_request_feature_names ON user_callouts USING btree (id) WHERE (feature_name = ANY (ARRAY[47, 48])); - CREATE INDEX tmp_index_vulnerability_occurrences_on_id_and_scanner_id ON vulnerability_occurrences USING btree (id, scanner_id) WHERE (report_type = ANY (ARRAY[7, 99])); CREATE UNIQUE INDEX uniq_pkgs_deb_grp_architectures_on_distribution_id_and_name ON packages_debian_group_architectures USING btree (distribution_id, name); @@ -32232,12 +32427,6 @@ CREATE TRIGGER nullify_merge_request_metrics_build_data_on_update BEFORE UPDATE CREATE TRIGGER projects_loose_fk_trigger AFTER DELETE ON projects REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records(); -CREATE TRIGGER trigger_a645cee67576 BEFORE UPDATE OF integration_id ON web_hooks FOR EACH ROW EXECUTE FUNCTION function_for_trigger_a645cee67576(); - -CREATE TRIGGER trigger_a87bcfdf0f0b BEFORE INSERT ON web_hooks FOR EACH ROW EXECUTE FUNCTION function_for_trigger_a87bcfdf0f0b(); - -CREATE TRIGGER trigger_aca5c963d732 BEFORE UPDATE OF service_id ON web_hooks FOR EACH ROW EXECUTE FUNCTION function_for_trigger_aca5c963d732(); - CREATE TRIGGER trigger_delete_project_namespace_on_project_delete AFTER DELETE ON projects FOR EACH ROW WHEN ((old.project_namespace_id IS NOT NULL)) EXECUTE FUNCTION delete_associated_project_namespace(); CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON integrations FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker(); @@ -32393,6 +32582,9 @@ ALTER TABLE ONLY ghost_user_migrations ALTER TABLE ONLY coverage_fuzzing_corpuses ADD CONSTRAINT fk_204d40056a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY namespace_settings + ADD CONSTRAINT fk_20cf0eb2f9 FOREIGN KEY (default_compliance_framework_id) REFERENCES compliance_management_frameworks(id) ON DELETE SET NULL; + ALTER TABLE ONLY geo_container_repository_updated_events ADD CONSTRAINT fk_212c89c706 FOREIGN KEY (container_repository_id) REFERENCES container_repositories(id) ON DELETE CASCADE; @@ -32513,9 +32705,6 @@ ALTER TABLE ONLY epics ALTER TABLE ONLY ci_pipelines ADD CONSTRAINT fk_3d34ab2e06 FOREIGN KEY (pipeline_schedule_id) REFERENCES ci_pipeline_schedules(id) ON DELETE SET NULL; -ALTER TABLE ONLY merge_request_reviewers - ADD CONSTRAINT fk_3d674b9f23 FOREIGN KEY (updated_state_by_user_id) REFERENCES users(id) ON DELETE SET NULL; - ALTER TABLE ONLY protected_environment_approval_rules ADD CONSTRAINT fk_405568b491 FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -32579,6 +32768,9 @@ ALTER TABLE ONLY vulnerability_feedback ALTER TABLE ONLY ml_candidates ADD CONSTRAINT fk_56d6ed4d3d FOREIGN KEY (experiment_id) REFERENCES ml_experiments(id) ON DELETE CASCADE; +ALTER TABLE ONLY approval_merge_request_rules + ADD CONSTRAINT fk_5822f009ea FOREIGN KEY (security_orchestration_policy_configuration_id) REFERENCES security_orchestration_policy_configurations(id) ON DELETE CASCADE; + ALTER TABLE ONLY deploy_keys_projects ADD CONSTRAINT fk_58a901ca7e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -32894,9 +33086,6 @@ ALTER TABLE ONLY vulnerability_reads ALTER TABLE ONLY dast_profile_schedules ADD CONSTRAINT fk_aef03d62e5 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL; -ALTER TABLE ONLY merge_request_assignees - ADD CONSTRAINT fk_af036e3261 FOREIGN KEY (updated_state_by_user_id) REFERENCES users(id) ON DELETE SET NULL; - ALTER TABLE ONLY analytics_cycle_analytics_group_stages ADD CONSTRAINT fk_analytics_cycle_analytics_group_stages_group_value_stream_id FOREIGN KEY (group_value_stream_id) REFERENCES analytics_cycle_analytics_group_value_streams(id) ON DELETE CASCADE; @@ -33047,9 +33236,6 @@ ALTER TABLE ONLY environments ALTER TABLE ONLY ci_builds ADD CONSTRAINT fk_d3130c9a7f FOREIGN KEY (commit_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; -ALTER TABLE ONLY web_hooks - ADD CONSTRAINT fk_d47999a98a FOREIGN KEY (service_id) REFERENCES integrations(id) ON DELETE CASCADE; - ALTER TABLE ONLY ci_sources_pipelines ADD CONSTRAINT fk_d4e29af7d7 FOREIGN KEY (source_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; @@ -33158,6 +33344,9 @@ ALTER TABLE ONLY events ALTER TABLE ONLY coverage_fuzzing_corpuses ADD CONSTRAINT fk_ef5ebf339f FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY approval_project_rules + ADD CONSTRAINT fk_efa5a1e3fb FOREIGN KEY (security_orchestration_policy_configuration_id) REFERENCES security_orchestration_policy_configurations(id) ON DELETE CASCADE; + ALTER TABLE ONLY vulnerabilities ADD CONSTRAINT fk_efb96ab1e2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33749,6 +33938,9 @@ ALTER TABLE ONLY resource_iteration_events ALTER TABLE ONLY status_page_settings ADD CONSTRAINT fk_rails_506e5ba391 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; +ALTER TABLE ONLY ci_pipeline_metadata + ADD CONSTRAINT fk_rails_50c1e9ea10 FOREIGN KEY (pipeline_id) REFERENCES ci_pipelines(id) ON DELETE CASCADE; + ALTER TABLE ONLY project_repository_storage_moves ADD CONSTRAINT fk_rails_5106dbd44a FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; @@ -33782,6 +33974,9 @@ ALTER TABLE ONLY issue_user_mentions ALTER TABLE ONLY merge_request_assignees ADD CONSTRAINT fk_rails_579d375628 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; +ALTER TABLE ONLY incident_management_timeline_event_tag_links + ADD CONSTRAINT fk_rails_57baccd7f9 FOREIGN KEY (timeline_event_id) REFERENCES incident_management_timeline_events(id) ON DELETE CASCADE; + ALTER TABLE ONLY packages_debian_project_architectures ADD CONSTRAINT fk_rails_5808663adf FOREIGN KEY (distribution_id) REFERENCES packages_debian_project_distributions(id) ON DELETE CASCADE; @@ -33986,6 +34181,9 @@ ALTER TABLE ONLY group_crm_settings ALTER TABLE ONLY clusters_applications_ingress ADD CONSTRAINT fk_rails_753a7b41c1 FOREIGN KEY (cluster_id) REFERENCES clusters(id) ON DELETE CASCADE; +ALTER TABLE ONLY incident_management_timeline_event_tag_links + ADD CONSTRAINT fk_rails_753b8b6ee3 FOREIGN KEY (timeline_event_tag_id) REFERENCES incident_management_timeline_event_tags(id) ON DELETE CASCADE; + ALTER TABLE ONLY release_links ADD CONSTRAINT fk_rails_753be7ae29 FOREIGN KEY (release_id) REFERENCES releases(id) ON DELETE CASCADE; @@ -34175,6 +34373,9 @@ ALTER TABLE ONLY packages_debian_project_distributions ALTER TABLE ONLY packages_rubygems_metadata ADD CONSTRAINT fk_rails_95a3f5ce78 FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY project_wiki_repository_states + ADD CONSTRAINT fk_rails_9647227ce1 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY packages_pypi_metadata ADD CONSTRAINT fk_rails_9698717cdd FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; @@ -34325,6 +34526,9 @@ ALTER TABLE ONLY clusters ALTER TABLE ONLY packages_composer_metadata ADD CONSTRAINT fk_rails_ad48c2e5bb FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; +ALTER TABLE ONLY user_phone_number_validations + ADD CONSTRAINT fk_rails_ad6686f3d8 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; + ALTER TABLE ONLY analytics_cycle_analytics_group_stages ADD CONSTRAINT fk_rails_ae5da3409b FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE; @@ -34574,6 +34778,9 @@ ALTER TABLE ONLY geo_hashed_storage_attachments_events ALTER TABLE ONLY ml_candidate_params ADD CONSTRAINT fk_rails_d4a51d1185 FOREIGN KEY (candidate_id) REFERENCES ml_candidates(id); +ALTER TABLE ONLY packages_rpm_repository_files + ADD CONSTRAINT fk_rails_d545cfaed2 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY packages_rpm_metadata ADD CONSTRAINT fk_rails_d79f02264b FOREIGN KEY (package_id) REFERENCES packages_packages(id) ON DELETE CASCADE; @@ -34604,6 +34811,9 @@ ALTER TABLE ONLY deployment_merge_requests ALTER TABLE ONLY packages_debian_group_component_files ADD CONSTRAINT fk_rails_dd262386e9 FOREIGN KEY (component_id) REFERENCES packages_debian_group_components(id) ON DELETE RESTRICT; +ALTER TABLE ONLY incident_management_timeline_event_tags + ADD CONSTRAINT fk_rails_dd5c91484e FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE; + ALTER TABLE ONLY user_callouts ADD CONSTRAINT fk_rails_ddfdd80f3d FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE; |