You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
506 B

  1. class AddCaseInsensitiveBtreeIndexToTags < ActiveRecord::Migration[5.2]
  2. disable_ddl_transaction!
  3. def up
  4. safety_assured { execute 'CREATE UNIQUE INDEX CONCURRENTLY index_tags_on_name_lower_btree ON tags (lower(name) text_pattern_ops)' }
  5. remove_index :tags, name: 'index_tags_on_name_lower'
  6. end
  7. def down
  8. safety_assured { execute 'CREATE UNIQUE INDEX CONCURRENTLY index_tags_on_name_lower ON tags (lower(name))' }
  9. remove_index :tags, name: 'index_tags_on_name_lower_btree'
  10. end
  11. end