Commit 3510ef5b authored by Patrick Bair's avatar Patrick Bair

Merge branch '355573-make-load-balancing-multiple-databases-work-with-db-specs' into 'master'

Make db:migrate:reset work with GITLAB_USE_MODEL_LOAD_BALANCING=true

See merge request gitlab-org/gitlab!82872
parents 289ed8d6 bb05a727
......@@ -377,8 +377,6 @@ db:migrate:reset decomposed:
- db:migrate:reset
- .decomposed-database
- .rails:rules:decomposed-databases
variables:
GITLAB_USE_MODEL_LOAD_BALANCING: "false"
db:migrate-from-previous-major-version:
extends: .db-job-base
......
......@@ -8,8 +8,12 @@ class DeleteIssueMergeRequestTaggingsRecords < Gitlab::Database::Migration[1.0]
BATCH_SIZE = 3_000
TAGGABLE_TYPES = %w(Issue MergeRequest)
class Tagging < ActiveRecord::Base
self.table_name = "taggings"
end
def up
sleep 2 while ActsAsTaggableOn::Tagging.where(taggable_type: TAGGABLE_TYPES).limit(BATCH_SIZE).delete_all > 0
sleep 2 while Tagging.where(taggable_type: TAGGABLE_TYPES).limit(BATCH_SIZE).delete_all > 0
remove_concurrent_index_by_name :taggings, INDEX_NAME
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment