In my Rails app that, using 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 on that column. I do this with following migration:
execute('create index person_identifiers_identifier on person_identifiers using gin (identifier gin_trgm_ops)')
that is working as expected so in schema I have the following index:
add_index "person_identifiers", ["identifier"], name: "person_identifiers_identifier", using: :gin
But I want to have 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 that's unfortunately is not visible in schema.rb? I know that I can use SQL format instead of schema.rb, but I want to stick to see this in schema.rb.