diff options
Diffstat (limited to 'db')
4 files changed, 26 insertions, 3 deletions
diff --git a/db/fixtures/development/24_forks.rb b/db/fixtures/development/24_forks.rb index a3db84ab1b7..1476681f4d7 100644 --- a/db/fixtures/development/24_forks.rb +++ b/db/fixtures/development/24_forks.rb @@ -2,7 +2,7 @@ require './spec/support/sidekiq_middleware' Sidekiq::Testing.inline! do Gitlab::Seeder.quiet do - User.not_mass_generated.sample(10).each do |user| + User.humans.not_mass_generated.sample(10).each do |user| source_project = Project.not_mass_generated.public_only.sample ## diff --git a/db/post_migrate/20221102231130_finalize_backfill_user_details_fields.rb b/db/post_migrate/20221102231130_finalize_backfill_user_details_fields.rb new file mode 100644 index 00000000000..a6b5bdd307e --- /dev/null +++ b/db/post_migrate/20221102231130_finalize_backfill_user_details_fields.rb @@ -0,0 +1,24 @@ +# frozen_string_literal: true + +class FinalizeBackfillUserDetailsFields < Gitlab::Database::Migration[2.0] + BACKFILL_MIGRATION = 'BackfillUserDetailsFields' + + disable_ddl_transaction! + + restrict_gitlab_migration gitlab_schema: :gitlab_main + + def up + # If the 20230116160904_remove_user_details_fields_from_user.rb migration already ran, + # finalizing this background migration will fail. + return unless column_exists?(:users, :linkedin) + + ensure_batched_background_migration_is_finished( + job_class_name: BACKFILL_MIGRATION, + table_name: :users, + column_name: :id, + job_arguments: [], + finalize: true) + end + + def down; end +end diff --git a/db/post_migrate/20221102231131_remove_temp_index_for_user_details_fields.rb b/db/post_migrate/20221102231131_remove_temp_index_for_user_details_fields.rb index 340d1205ef7..c31513e00fc 100644 --- a/db/post_migrate/20221102231131_remove_temp_index_for_user_details_fields.rb +++ b/db/post_migrate/20221102231131_remove_temp_index_for_user_details_fields.rb @@ -1,13 +1,11 @@ # frozen_string_literal: true class RemoveTempIndexForUserDetailsFields < Gitlab::Database::Migration[2.0] - BACKFILL_MIGRATION = 'BackfillUserDetailsFields' INDEX_NAME = 'tmp_idx_where_user_details_fields_filled' disable_ddl_transaction! def up - finalize_background_migration BACKFILL_MIGRATION remove_concurrent_index_by_name :users, INDEX_NAME end diff --git a/db/schema_migrations/20221102231130 b/db/schema_migrations/20221102231130 new file mode 100644 index 00000000000..ee01f627eef --- /dev/null +++ b/db/schema_migrations/20221102231130 @@ -0,0 +1 @@ +8678040a9fa8da1d455489db89e00084943d1dced6dd01cbf3517afd1a47bac5
\ No newline at end of file |