Skip to content
Snippets Groups Projects
Commit 216436c1 authored by Zeger-Jan van de Weg's avatar Zeger-Jan van de Weg
Browse files

Fix migration when converting award notes

parent 3d72cb89
No related branches found
No related tags found
No related merge requests found
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment