Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValery Sizov <vsv2711@gmail.com>2015-12-24 12:28:51 +0300
committerValery Sizov <vsv2711@gmail.com>2015-12-24 12:28:55 +0300
commitb6de0d28303a12c76847f1137e672aa60ae174ac (patch)
tree11ff97f14046b8d6445a6695fea00ab7c3e158e2 /db/migrate
parent2803b6e84e94bb3a8d85ea9e29aeade450c842a7 (diff)
Emoji picker: better alias handling
Diffstat (limited to 'db/migrate')
-rw-r--r--db/migrate/20151224123230_rename_emojis.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/db/migrate/20151224123230_rename_emojis.rb b/db/migrate/20151224123230_rename_emojis.rb
new file mode 100644
index 00000000000..62d921dfdcc
--- /dev/null
+++ b/db/migrate/20151224123230_rename_emojis.rb
@@ -0,0 +1,15 @@
+# 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