Fix MySQL migration of CI emails [ci skip]

This commit is contained in:
Kamil Trzcinski 2015-12-14 12:03:28 +01:00
parent 45593d574c
commit 208f99ff6c

View file

@ -25,7 +25,11 @@ class MigrateCiEmails < ActiveRecord::Migration
# This function escapes double-quotes and slash
def escape_text(name)
"REPLACE(REPLACE(#{name}, '\\', '\\\\'), '\"', '\\\"')"
if Gitlab::Database.postgresql?
"REPLACE(REPLACE(#{name}, '\\', '\\\\'), '\"', '\\\"')"
else
"REPLACE(REPLACE(#{name}, '\\\\', '\\\\\\\\'), '\\\"', '\\\\\\\"')"
end
end
# This function returns 0 or 1 for column