Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-03-09 20:30:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-03-09 20:30:09 +0300
commit858d175c1527d650ea5d83e201777d0cf8ae84c9 (patch)
tree147344d5699ea84eda6f980867e4d2045e0f22b9 /db
parentf6262510e6642bb91d112f1bf2ea70db8b7b772c (diff)
Add latest changes from gitlab-org/gitlab@15-9-stable-ee
Diffstat (limited to 'db')
-rw-r--r--db/fixtures/development/24_forks.rb2
-rw-r--r--db/post_migrate/20221102231130_finalize_backfill_user_details_fields.rb24
-rw-r--r--db/post_migrate/20221102231131_remove_temp_index_for_user_details_fields.rb2
-rw-r--r--db/schema_migrations/202211022311301
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