summaryrefslogtreecommitdiff
path: root/db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb
diff options
context:
space:
mode:
authorLin Jen-Shin (godfat) <godfat@godfat.org>2017-09-29 11:18:58 +0000
committerRémy Coutable <remy@rymai.me>2017-09-29 11:18:58 +0000
commit8bac6e41ef1568b5b46a92a2279b4fb488ae73bc (patch)
treeea391b8653994435f0f8ce4b103a6da2c5e5c11d /db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb
parentccfe6860079c6c75ab5a1f831cd62af0e355331e (diff)
downloadgitlab-ce-8bac6e41ef1568b5b46a92a2279b4fb488ae73bc.tar.gz
Fix notes type created from import
Diffstat (limited to 'db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb')
-rw-r--r--db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb b/db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb
new file mode 100644
index 00000000000..a238216253b
--- /dev/null
+++ b/db/post_migrate/20170927112318_update_legacy_diff_notes_type_for_import.rb
@@ -0,0 +1,16 @@
+class UpdateLegacyDiffNotesTypeForImport < ActiveRecord::Migration
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ update_column_in_batches(:notes, :type, 'LegacyDiffNote') do |table, query|
+ query.where(table[:type].eq('Github::Import::LegacyDiffNote'))
+ end
+ end
+
+ def down
+ end
+end