summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Croitor <acroitor@gitlab.com>2019-07-16 17:30:04 +0300
committerAlexandru Croitor <acroitor@gitlab.com>2019-07-16 21:06:35 +0300
commit5a56f9e9a12d55ba846a4ad465487759a5e1096e (patch)
treeda83f2a54376686113775777a64298747e9ed7a4
parent872eae04c826f1cf61b7e04ed17808a05fdd25a1 (diff)
downloadgitlab-ce-migrate_promoted_epics_discussion_ids_ce.tar.gz
Change discussion_ids on promoted epics notesmigrate_promoted_epics_discussion_ids_ce
Notes on epics promoted from an issue used to get same discussion_id as the notes from the issue the epic was promoted from, which would cause problems when trying to reply to the epic discussion.
-rw-r--r--db/post_migrate/20190715193142_migrate_discussion_id_on_promoted_epics.rb16
-rw-r--r--db/schema.rb2
2 files changed, 17 insertions, 1 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
new file mode 100644
index 00000000000..df3a06fd141
--- /dev/null
+++ b/db/post_migrate/20190715193142_migrate_discussion_id_on_promoted_epics.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+# See http://doc.gitlab.com/ce/development/migration_style_guide.html
+# for more information on how to write migrations for GitLab.
+
+class MigrateDiscussionIdOnPromotedEpics < ActiveRecord::Migration[5.2]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ BATCH_SIZE = 100
+ disable_ddl_transaction!
+
+ def up
+ Gitlab::BackgroundMigration::MigratePromotedEpicsDiscussionIds.new.perform_all_sync(batch_size: BATCH_SIZE)
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index 644ca1fe970..03dec40a444 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2019_07_03_130053) do
+ActiveRecord::Schema.define(version: 2019_07_15_193142) do
# These are extensions that must be enabled in order to support this database
enable_extension "pg_trgm"