diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-09 20:30:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-09 20:30:09 +0300 |
commit | 858d175c1527d650ea5d83e201777d0cf8ae84c9 (patch) | |
tree | 147344d5699ea84eda6f980867e4d2045e0f22b9 /db/post_migrate/20221102231130_finalize_backfill_user_details_fields.rb | |
parent | f6262510e6642bb91d112f1bf2ea70db8b7b772c (diff) |
Add latest changes from gitlab-org/gitlab@15-9-stable-ee
Diffstat (limited to 'db/post_migrate/20221102231130_finalize_backfill_user_details_fields.rb')
-rw-r--r-- | db/post_migrate/20221102231130_finalize_backfill_user_details_fields.rb | 24 |
1 files changed, 24 insertions, 0 deletions
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 |