In my Rails application, which, using a PostgreSQL database, I have a table that looks like this:
create_table "person_identifiers", force: :cascade do |t| t.string "identifier", limit: 255 end
I want to add an index to this column. I do this with the following migration:
execute('create index person_identifiers_identifier on person_identifiers using gin (identifier gin_trgm_ops)')
works as expected, so in the circuit I have the following index:
add_index "person_identifiers", ["identifier"], name: "person_identifiers_identifier", using: :gin
But I want this index to be case insensitive, so I write:
execute('create index person_identifiers_identifier on person_identifiers using gin (lower(identifier) gin_trgm_ops)')
but unfortunately this is not visible in schema.rb? I know that I can use the SQL format instead of schema.rb, but I want to stick with this in schema.rb.
source share