diff options
author | Douwe Maan <douwe@selenight.nl> | 2016-08-20 01:22:59 +0300 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2016-08-20 02:24:12 +0300 |
commit | d741303a5992b0d259a125baa62b66ca4df209da (patch) | |
tree | 4540c93a9b208b4e617f88f499e3843db3699069 /db/migrate/20160819221833_reset_diff_note_discussion_id_because_it_was_calculated_wrongly.rb | |
parent | c711fe15dd2409161702f20a1ccffd861ae798ab (diff) |
Call `set_discussion_id` again in DiffNote `before_validation` because the order is important
Diffstat (limited to 'db/migrate/20160819221833_reset_diff_note_discussion_id_because_it_was_calculated_wrongly.rb')
-rw-r--r-- | db/migrate/20160819221833_reset_diff_note_discussion_id_because_it_was_calculated_wrongly.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/db/migrate/20160819221833_reset_diff_note_discussion_id_because_it_was_calculated_wrongly.rb b/db/migrate/20160819221833_reset_diff_note_discussion_id_because_it_was_calculated_wrongly.rb new file mode 100644 index 00000000000..0c68cf01900 --- /dev/null +++ b/db/migrate/20160819221833_reset_diff_note_discussion_id_because_it_was_calculated_wrongly.rb @@ -0,0 +1,12 @@ +# See http://doc.gitlab.com/ce/development/migration_style_guide.html +# for more information on how to write migrations for GitLab. + +class ResetDiffNoteDiscussionIdBecauseItWasCalculatedWrongly < ActiveRecord::Migration + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + execute "UPDATE notes SET discussion_id = NULL WHERE discussion_id IS NOT NULL AND type = 'DiffNote'" + end +end |