summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Croitor <acroitor@gitlab.com>2019-09-10 10:58:13 +0300
committerAlexandru Croitor <acroitor@gitlab.com>2019-09-10 11:00:38 +0300
commitdd838d4c601849d7fe14c4b8d98799c0f6952098 (patch)
tree4e84318cb0749015f328bd475abc3cdf60bf0977
parent1c38fb80482b096aa4a9927d8f169736f03fa699 (diff)
downloadgitlab-ce-migrate_promoted_epics_discussion_ids-ce.tar.gz
Specify temporary indexes to be created and removed by namemigrate_promoted_epics_discussion_ids-ce
-rw-r--r--db/post_migrate/20190715193142_migrate_discussion_id_on_promoted_epics.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/db/post_migrate/20190715193142_migrate_discussion_id_on_promoted_epics.rb b/db/post_migrate/20190715193142_migrate_discussion_id_on_promoted_epics.rb
index 8b78be09ab0..13f8477f3ea 100644
--- a/db/post_migrate/20190715193142_migrate_discussion_id_on_promoted_epics.rb
+++ b/db/post_migrate/20190715193142_migrate_discussion_id_on_promoted_epics.rb
@@ -43,8 +43,8 @@ class MigrateDiscussionIdOnPromotedEpics < ActiveRecord::Migration[5.2]
end
def up
- add_concurrent_index(:system_note_metadata, :note_id, where: "action='moved'")
- add_concurrent_index(:notes, [:id, :noteable_id], where: "noteable_type='Epic' AND system")
+ add_concurrent_index(:system_note_metadata, :note_id, where: "action='moved'", name: 'temp_index_system_note_metadata_on_moved_note_id')
+ add_concurrent_index(:notes, [:id, :noteable_id], where: "noteable_type='Epic' AND system", name: 'temp_index_notes_on_id_and_noteable_id' )
all_discussion_ids = Note.fetch_discussion_ids_query
all_discussion_ids.in_groups_of(BATCH_SIZE, false).each_with_index do |ids, index|
@@ -52,8 +52,8 @@ class MigrateDiscussionIdOnPromotedEpics < ActiveRecord::Migration[5.2]
BackgroundMigrationWorker.perform_in(delay, MIGRATION, [ids])
end
- remove_concurrent_index(:system_note_metadata, :note_id)
- remove_concurrent_index(:notes, [:id, :noteable_id])
+ remove_concurrent_index(:system_note_metadata, :note_id, where: "action='moved'", name: 'temp_index_system_note_metadata_on_moved_note_id')
+ remove_concurrent_index(:notes, [:id, :noteable_id], where: "noteable_type='Epic' AND system", name: 'temp_index_notes_on_id_and_noteable_id')
end
def down