debian-mirror-gitlab/db/migrate/20151224123230_rename_emojis.rb

16 lines
725 B
Ruby
Raw Normal View History

# Migration type: online without errors (works on previous version and new one)
2018-12-23 12:14:25 +05:30
class RenameEmojis < ActiveRecord::Migration[4.2]
def up
# Renames aliases to main names
execute("UPDATE notes SET note ='thumbsup' WHERE is_award = true AND note = '+1'")
execute("UPDATE notes SET note ='thumbsdown' WHERE is_award = true AND note = '-1'")
execute("UPDATE notes SET note ='poop' WHERE is_award = true AND note = 'shit'")
end
def down
execute("UPDATE notes SET note ='+1' WHERE is_award = true AND note = 'thumbsup'")
execute("UPDATE notes SET note ='-1' WHERE is_award = true AND note = 'thumbsdown'")
execute("UPDATE notes SET note ='shit' WHERE is_award = true AND note = 'poop'")
end
end