summaryrefslogtreecommitdiff
path: root/config/initializers
diff options
context:
space:
mode:
authorJasper Maes <jaspermaes.jm@gmail.com>2018-06-02 12:46:08 +0200
committerJasper Maes <jaspermaes.jm@gmail.com>2018-06-05 08:06:35 +0200
commit85a7e0813e9806ad3eb853e4a48c09ae5f78f94c (patch)
treedb7d77148d74f600b4d7e79c568afd816b9f1b9a /config/initializers
parent800d3b88c78ee7a98fa41f3a1628c6c2a6d12a68 (diff)
downloadgitlab-ce-85a7e0813e9806ad3eb853e4a48c09ae5f78f94c.tar.gz
Support rails5 in postgres indexes function and fix some migrations
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/postgresql_opclasses_support.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/config/initializers/postgresql_opclasses_support.rb b/config/initializers/postgresql_opclasses_support.rb
index c2f3023b330..03bda44a630 100644
--- a/config/initializers/postgresql_opclasses_support.rb
+++ b/config/initializers/postgresql_opclasses_support.rb
@@ -107,8 +107,15 @@ module ActiveRecord
result.map do |row|
index_name = row[0]
- unique = row[1] == 't'
+ unique = if Gitlab.rails5?
+ row[1]
+ else
+ row[1] == 't'
+ end
indkey = row[2].split(" ")
+ if Gitlab.rails5?
+ indkey = indkey.map(&:to_i)
+ end
inddef = row[3]
oid = row[4]