98bb435f42
Migrations shouldn't fail RuboCop checks - especially lint checks, such as the nested method check. To avoid changing code in existing migrations, add the magic comment to the top of each of them to skip that file.
16 lines
742 B
Ruby
16 lines
742 B
Ruby
# rubocop:disable all
|
|
# Migration type: online without errors (works on previous version and new one)
|
|
class RenameEmojis < ActiveRecord::Migration
|
|
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
|