From 216436c1d48c4bafd2124fc656a06a6d1b430631 Mon Sep 17 00:00:00 2001 From: "Z.J. van de Weg" Date: Thu, 9 Jun 2016 12:30:21 +0200 Subject: [PATCH] Fix migration when converting award notes --- .../20160416182152_convert_award_note_to_emoji_award.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb b/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb index 073bbc0fc2a6..316f6f7dcfc6 100644 --- a/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb +++ b/db/migrate/20160416182152_convert_award_note_to_emoji_award.rb @@ -1,9 +1,7 @@ class ConvertAwardNoteToEmojiAward < ActiveRecord::Migration - def change - def up - execute "INSERT INTO award_emoji (awardable_type, awardable_id, user_id, name, created_at, updated_at) (SELECT noteable_type, noteable_id, author_id, note, created_at, updated_at FROM notes WHERE is_award = true)" + def up + execute "INSERT INTO award_emoji (awardable_type, awardable_id, user_id, name, created_at, updated_at) (SELECT noteable_type, noteable_id, author_id, note, created_at, updated_at FROM notes WHERE is_award = true)" - execute "DELETE FROM notes WHERE is_award = true" - end + execute "DELETE FROM notes WHERE is_award = true" end end -- GitLab