Skip to content
Snippets Groups Projects
Verified Commit 8af4455f authored by Kev Kloss's avatar Kev Kloss :m: Committed by GitLab
Browse files

Update tff mapping tests

The used migration was removed, so we need to use an existing one here.
parent f4923fdb
No related branches found
No related tags found
2 merge requests!170053Security patch upgrade alert: Only expose to admins 17-4,!167772Squash database migrations up to 16-4-stable-ee
Showing
with 826 additions and 445 deletions
......@@ -36,7 +36,7 @@ db:rollback:
- .db-job-base
- .rails:rules:db-rollback
script:
- bundle exec rake db:migrate VERSION=20230718020825 # 16.3 First migration
- bundle exec rake db:migrate VERSION=20230728020644 # 16.4 First migration
- bundle exec rake db:migrate
db:rollback single-db:
......
......@@ -104,7 +104,6 @@ Lint/RedundantCopDisableDirective:
- 'config/routes/api.rb'
- 'db/migrate/20240701145111_add_namespace_import_users_table.rb'
- 'db/migrate/20240829163210_create_instance_integrations_table.rb'
- 'db/post_migrate/20230724123547_cleanup_conversion_big_int_ci_build_needs_self_managed.rb'
- 'db/post_migrate/20231017064317_swap_columns_for_ci_pipeline_variables_pipeline_id_bigint.rb'
- 'db/post_migrate/20231019003052_swap_columns_for_ci_pipelines_pipeline_id_bigint_v2.rb'
- 'db/post_migrate/20231019084731_swap_columns_for_ci_stages_pipeline_id_bigint_v2.rb'
......@@ -218,7 +217,6 @@ Lint/RedundantCopDisableDirective:
- 'ee/spec/helpers/ee/releases_helper_spec.rb'
- 'ee/spec/lib/banzai/filter/references/iterations_cadence_reference_filter_spec.rb'
- 'ee/spec/lib/code_suggestions/instructions_extractor_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/backfill_dismissal_reason_in_vulnerability_reads_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/backfill_missing_vulnerability_dismissal_details_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/delete_orphaned_transferred_project_approval_rules_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/fix_namespace_ids_of_vulnerability_reads_spec.rb'
......
---
Migration/EnsureFactoryForTable:
Exclude:
- 'db/migrate/20230626211305_create_catalog_resource_versions.rb'
- 'db/migrate/20230704233431_create_table_batched_git_ref_updates_deletions.rb'
- 'db/migrate/20230717142737_create_group_ssh_certificate.rb'
- 'db/migrate/20230727084849_create_catalog_resource_components.rb'
- 'db/migrate/20230821133549_create_packages_nuget_symbols.rb'
- 'db/migrate/20230823132142_create_instance_google_cloud_logging_configurations.rb'
- 'db/migrate/20230903170000_create_packages_protection_rules.rb'
......
......@@ -279,7 +279,6 @@ RSpec/NamedSubject:
- 'ee/spec/lib/ee/gitlab/auth/auth_finders_spec.rb'
- 'ee/spec/lib/ee/gitlab/auth/current_user_mode_spec.rb'
- 'ee/spec/lib/ee/gitlab/auth/request_authenticator_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/backfill_dismissal_reason_in_vulnerability_reads_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/backfill_iteration_cadence_id_for_boards_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/delete_invalid_epic_issues_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/delete_orphaned_transferred_project_approval_rules_spec.rb'
......@@ -2398,7 +2397,6 @@ RSpec/NamedSubject:
- 'spec/mailers/emails/merge_requests_spec.rb'
- 'spec/mailers/notify_spec.rb'
- 'spec/metrics_server/metrics_server_spec.rb'
- 'spec/migrations/20230714015909_add_index_for_member_expiring_query_spec.rb'
- 'spec/models/ability_spec.rb'
- 'spec/models/abuse_report_spec.rb'
- 'spec/models/active_session_spec.rb'
......
......@@ -1066,10 +1066,6 @@ Style/InlineDisableAnnotation:
- 'config/routes/project.rb'
- 'danger/ce_ee_vue_templates/Dangerfile'
- 'danger/roulette/Dangerfile'
- 'db/migrate/20230601090722_add_status_message_to_packages.rb'
- 'db/migrate/20230718145747_create_target_branch_rules.rb'
- 'db/migrate/20230726104022_add_name_to_google_cloud_logging_configuration.rb'
- 'db/migrate/20230809165212_add_path_prefix_and_build_ref_to_pages_deployments.rb'
- 'db/migrate/20230822064649_add_organization_id_to_project.rb'
- 'db/migrate/20230906185552_add_markdown_fields_to_review_llm_summary.rb'
- 'db/migrate/20230906204935_restart_self_hosted_sent_notifications_backfill.rb'
......@@ -1079,9 +1075,6 @@ Style/InlineDisableAnnotation:
- 'db/migrate/20231017135207_add_fields_to_ml_model.rb'
- 'db/migrate/20231019180421_add_name_description_to_catalog_resources.rb'
- 'db/migrate/20231024142236_add_fields_to_bulk_import_failures.rb'
- 'db/post_migrate/20230724123547_cleanup_conversion_big_int_ci_build_needs_self_managed.rb'
- 'db/post_migrate/20230724150939_index_projects_on_namespace_id_and_repository_size_limit.rb'
- 'db/post_migrate/20230728151058_add_auditor_index_to_users_table.rb'
- 'db/post_migrate/20230823145126_swap_notes_id_to_bigint_for_self_managed.rb'
- 'db/post_migrate/20230908033511_swap_columns_for_ci_pipeline_chat_data_pipeline_id_bigint.rb'
- 'db/post_migrate/20230913130629_index_org_id_on_projects.rb'
......@@ -1746,7 +1739,6 @@ Style/InlineDisableAnnotation:
- 'ee/spec/lib/audit/push_rules/group_push_rules_changes_auditor_spec.rb'
- 'ee/spec/lib/audit/push_rules/project_push_rules_changes_auditor_spec.rb'
- 'ee/spec/lib/code_suggestions/instructions_extractor_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/backfill_dismissal_reason_in_vulnerability_reads_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/backfill_iteration_cadence_id_for_boards_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/backfill_missing_vulnerability_dismissal_details_spec.rb'
- 'ee/spec/lib/ee/gitlab/background_migration/delete_invalid_epic_issues_spec.rb'
......@@ -2617,26 +2609,16 @@ Style/InlineDisableAnnotation:
- 'spec/lib/omni_auth/strategies/jwt_spec.rb'
- 'spec/mailers/notify_spec.rb'
- 'spec/migrations/20230726144458_swap_notes_id_to_bigint_for_self_managed_spec.rb'
- 'spec/migrations/20230803125434_add_has_merge_request_on_vulnerability_reads_trigger_spec.rb'
- 'spec/migrations/20230809104753_swap_epic_user_mentions_note_id_to_bigint_for_self_hosts_spec.rb'
- 'spec/migrations/20230809174702_swap_system_note_metadata_note_id_to_bigint_for_self_managed_spec.rb'
- 'spec/migrations/20230809210550_swap_issue_user_mentions_note_id_to_bigint_for_self_managed_spec.rb'
- 'spec/migrations/20230810103534_swap_suggestions_note_id_to_bigint_for_self_hosts_spec.rb'
- 'spec/migrations/20230810113227_swap_note_diff_files_note_id_to_bigint_for_self_hosts_spec.rb'
- 'spec/migrations/20230810123044_swap_snippet_user_mentions_note_id_to_bigint_for_self_hosts_spec.rb'
- 'spec/migrations/20230811103941_swap_vulnerability_user_mentions_note_id_to_bigint_for_self_hosts_spec.rb'
- 'spec/migrations/20230814144045_swap_timelogs_note_id_to_bigint_for_self_hosts_spec.rb'
- 'spec/migrations/20230816152639_swap_design_user_mentions_note_id_to_big_int_for_self_managed_spec.rb'
- 'spec/migrations/20230817111938_swap_events_target_id_to_bigint_for_self_hosts_spec.rb'
- 'spec/migrations/20230817143637_swap_award_emoji_note_id_to_bigint_for_self_hosts_spec.rb'
- 'spec/migrations/20230906204934_restart_self_hosted_sent_notifications_bigint_conversion_spec.rb'
- 'spec/migrations/20230906204935_restart_self_hosted_sent_notifications_backfill_spec.rb'
- 'spec/migrations/20231016001000_fix_design_user_mentions_design_id_note_id_index_for_self_managed_spec.rb'
- 'spec/migrations/cleanup_conversion_big_int_ci_build_needs_self_managed_spec.rb'
- 'spec/migrations/swap_commit_user_mentions_note_id_to_bigint_for_self_managed_spec.rb'
- 'spec/migrations/swap_events_target_id_to_bigint_for_gitlab_dot_com_spec.rb'
- 'spec/migrations/swap_merge_request_user_mentions_note_id_to_bigint_for_self_managed_spec.rb'
- 'spec/migrations/swap_todos_note_id_to_bigint_for_self_managed_spec.rb'
- 'spec/models/board_spec.rb'
- 'spec/models/ci/build_trace_chunk_spec.rb'
- 'spec/models/ci/job_token/project_scope_link_spec.rb'
......
---
migration_job_name: BackfillDismissalReasonInVulnerabilityReads
description: Backfill `dismissal_reason` for rows with `state` of `dismissed` in `vulnerability_reads`
table
feature_category: vulnerability_management
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/123518
queued_migration_version: 20230612232000
milestone: '16.1'
finalized_by: '20231207163648'
This diff is collapsed.
# frozen_string_literal: true
class AddStatusMessageToPackages < Gitlab::Database::Migration[2.1]
# rubocop:disable Migration/AddLimitToTextColumns
# limit is added in 20230601153401_add_text_limit_to_packages_status_message
def change
add_column :packages_packages, :status_message, :text
end
# rubocop:enable Migration/AddLimitToTextColumns
end
# frozen_string_literal: true
class AddTextLimitToPackagesStatusMessage < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
def up
add_text_limit :packages_packages, :status_message, 255, validate: false
end
def down
remove_text_limit :packages_packages, :status_message
end
end
# frozen_string_literal: true
class AddRuleIdxToScanResultPolicies < Gitlab::Database::Migration[2.1]
enable_lock_retries!
CONSTRAINT_NAME = "check_scan_result_policies_rule_idx_positive"
def up
add_column :scan_result_policies, :rule_idx, :smallint
end
def down
remove_column :scan_result_policies, :rule_idx
end
end
# frozen_string_literal: true
class AddRuleIdxConstraintToScanResultPolicies < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
CONSTRAINT_NAME = "check_scan_result_policies_rule_idx_positive"
def up
add_check_constraint :scan_result_policies, "rule_idx IS NULL OR rule_idx >= 0", CONSTRAINT_NAME
end
def down
remove_check_constraint :scan_result_policies, CONSTRAINT_NAME
end
end
# frozen_string_literal: true
class AddUniqueIndexToScanResultPoliciesOnPositionInConfiguration < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
INDEX_NAME = 'index_scan_result_policies_on_position_in_configuration'
COLUMNS = %i[security_orchestration_policy_configuration_id project_id orchestration_policy_idx rule_idx]
def up
add_concurrent_index :scan_result_policies, COLUMNS, unique: true, name: INDEX_NAME
end
def down
remove_concurrent_index_by_name :scan_result_policies, INDEX_NAME
end
end
# frozen_string_literal: true
class CreateCatalogResourceVersions < Gitlab::Database::Migration[2.1]
def change
create_table :catalog_resource_versions do |t|
t.bigint :release_id, null: false, index: { unique: true }
t.bigint :catalog_resource_id, null: false, index: true
t.bigint :project_id, null: false, index: true
t.datetime_with_timezone :created_at, null: false
end
end
end
# frozen_string_literal: true
class AddReleaseFkToCatalogResourceVersions < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
def up
add_concurrent_foreign_key :catalog_resource_versions, :releases, column: :release_id, on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :catalog_resource_versions, column: :release_id
end
end
end
# frozen_string_literal: true
class AddProjectFkToCatalogResourceVersions < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
def up
add_concurrent_foreign_key :catalog_resource_versions, :projects, column: :project_id, on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :catalog_resource_versions, column: :project_id
end
end
end
# frozen_string_literal: true
class AddCatalogResourceFkToCatalogResourceVersions < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
def up
add_concurrent_foreign_key :catalog_resource_versions, :catalog_resources,
column: :catalog_resource_id, on_delete: :cascade
end
def down
with_lock_retries do
remove_foreign_key :catalog_resource_versions, column: :catalog_resource_id
end
end
end
# frozen_string_literal: true
class CreateTableBatchedGitRefUpdatesDeletions < Gitlab::Database::Migration[2.1]
enable_lock_retries!
def up
options = {
primary_key: [:id, :partition_id],
options: 'PARTITION BY LIST (partition_id)',
if_not_exists: true
}
create_table(:p_batched_git_ref_updates_deletions, **options) do |t|
t.bigserial :id, null: false
# Do not bother with foreign key as it provides not benefit and has a performance cost. These get cleaned up over
# time anyway.
t.bigint :project_id, null: false
t.bigint :partition_id, null: false, default: 1
t.timestamps_with_timezone null: false
t.integer :status, null: false, default: 1, limit: 2
t.text :ref, null: false, limit: 1024
t.index [:project_id, :id], where: 'status = 1',
name: :idx_deletions_on_project_id_and_id_where_pending
end
connection.execute(<<~SQL)
CREATE TABLE IF NOT EXISTS gitlab_partitions_dynamic.p_batched_git_ref_updates_deletions_1
PARTITION OF p_batched_git_ref_updates_deletions
FOR VALUES IN (1);
SQL
end
def down
drop_table :p_batched_git_ref_updates_deletions
end
end
# frozen_string_literal: true
class AddExpiryNotifiedAtToMember < Gitlab::Database::Migration[2.1]
disable_ddl_transaction!
TABLE_NAME = 'members'
COLUMN_NAME = 'expiry_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
# frozen_string_literal: true
class AddEmailsToX509Certificates < Gitlab::Database::Migration[2.1]
def change
add_column :x509_certificates, :emails, :string, array: true, default: [], null: false
end
end
# frozen_string_literal: true
class AddProtectedPathsForGetRequestToApplicationSettings < Gitlab::Database::Migration[2.1]
CONSTRAINT_NAME = 'app_settings_protected_paths_max_length'
disable_ddl_transaction!
def up
with_lock_retries do
add_column :application_settings, :protected_paths_for_get_request,
:text,
array: true,
default: [],
null: false,
if_not_exists: true
end
add_check_constraint :application_settings, 'CARDINALITY(protected_paths_for_get_request) <= 100', CONSTRAINT_NAME
end
def down
with_lock_retries do
remove_column :application_settings, :protected_paths_for_get_request, if_exists: true
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment