summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb13
-rw-r--r--db/schema.rb4
2 files changed, 15 insertions, 2 deletions
diff --git a/db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb b/db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb
new file mode 100644
index 00000000000..ed359e8cd9e
--- /dev/null
+++ b/db/migrate/20210421121431_add_case_insensitive_btree_index_to_tags.rb
@@ -0,0 +1,13 @@
+class AddCaseInsensitiveBtreeIndexToTags < ActiveRecord::Migration[5.2]
+ disable_ddl_transaction!
+
+ def up
+ safety_assured { execute 'CREATE UNIQUE INDEX CONCURRENTLY index_tags_on_name_lower_btree ON tags (lower(name) text_pattern_ops)' }
+ remove_index :tags, name: 'index_tags_on_name_lower'
+ end
+
+ def down
+ safety_assured { execute 'CREATE UNIQUE INDEX CONCURRENTLY index_tags_on_name_lower ON tags (lower(name))' }
+ remove_index :tags, name: 'index_tags_on_name_lower_btree'
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index dcbbf4aea99..8dc0661fc92 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
-ActiveRecord::Schema.define(version: 2021_04_16_200740) do
+ActiveRecord::Schema.define(version: 2021_04_21_121431) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -862,7 +862,7 @@ ActiveRecord::Schema.define(version: 2021_04_16_200740) do
t.datetime "last_status_at"
t.float "max_score"
t.datetime "max_score_at"
- t.index "lower((name)::text)", name: "index_tags_on_name_lower", unique: true
+ t.index "lower((name)::text) text_pattern_ops", name: "index_tags_on_name_lower_btree", unique: true
end
create_table "tombstones", force: :cascade do |t|