summaryrefslogtreecommitdiff
path: root/db/migrate
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2015-12-24 11:24:03 +0000
committerValery Sizov <valery@gitlab.com>2015-12-24 11:24:03 +0000
commite622259d5be95ede9b4f52b0e654cdf0a7a4323f (patch)
tree5e9138018dbc3518749af62c729a8da8ea1a6733 /db/migrate
parent75c3a2f89b52c7981326693b73b0ad8055a551e8 (diff)
parent09c5968fa3f94152b5f2767fded6adbd7ddc7032 (diff)
downloadgitlab-ce-e622259d5be95ede9b4f52b0e654cdf0a7a4323f.tar.gz
Merge branch 'emoji-picker-fix' into 'master'
Emoji picker: better alias handling related to https://gitlab.com/gitlab-org/gitlab-ce/issues/3576 See merge request !2198
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