summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-12-14 12:03:28 +0100
committerKamil Trzcinski <ayufan@ayufan.eu>2015-12-14 12:04:26 +0100
commit208f99ff6c24a2dd5a69ed5666a1fd224d78c59b (patch)
tree02ed72e97ef7ab5949227e4807e4cf64a5800812 /db
parent45593d574ce0d851711ea776c9f9fd673eec689c (diff)
downloadgitlab-ce-208f99ff6c24a2dd5a69ed5666a1fd224d78c59b.tar.gz
Fix MySQL migration of CI emails [ci skip]
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20151209145909_migrate_ci_emails.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/db/migrate/20151209145909_migrate_ci_emails.rb b/db/migrate/20151209145909_migrate_ci_emails.rb
index 202fac8e3fc..7f330a2cf0a 100644
--- a/db/migrate/20151209145909_migrate_ci_emails.rb
+++ b/db/migrate/20151209145909_migrate_ci_emails.rb
@@ -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