summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2018-12-12 17:11:23 +0100
committerYorick Peterse <yorickpeterse@gmail.com>2018-12-12 17:11:23 +0100
commit25ea6fdd5ee723dbe98b719c9966b19668cb7cda (patch)
treee5470fe6ac0a89bd523fc39eacc01c25daa1a82e
parent40ad7d5d7a01a6f019ce1c3bb8864b16fc48e9c8 (diff)
downloadgitlab-ce-25ea6fdd5ee723dbe98b719c9966b19668cb7cda.tar.gz
Fix deprecations in opclasses initializer
The use of `table_exists?` in the opclasses support initializer triggers a deprecation warning. Using `data_source_exists?` removes this deprecation.
-rw-r--r--config/initializers/postgresql_opclasses_support.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/config/initializers/postgresql_opclasses_support.rb b/config/initializers/postgresql_opclasses_support.rb
index 07b06629dea..5d643b75dd8 100644
--- a/config/initializers/postgresql_opclasses_support.rb
+++ b/config/initializers/postgresql_opclasses_support.rb
@@ -81,7 +81,7 @@ module ActiveRecord
if index_name.length > max_index_length
raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' is too long; the limit is #{max_index_length} characters"
end
- if table_exists?(table_name) && index_name_exists?(table_name, index_name, false)
+ if data_source_exists?(table_name) && index_name_exists?(table_name, index_name, false)
raise ArgumentError, "Index name '#{index_name}' on table '#{table_name}' already exists"
end
index_columns = quoted_columns_for_index(column_names, options).join(", ")