I needed to manually create an index for my table because rails/sqlite3 because collation hasn't been supported yet.
So in my migration I have:
## This doesn't work, so we'll do it manually
#add_index :events, :name, COLLATE: :NOCASE
execute <<-SQL
CREATE INDEX 'index_events_on_name' ON 'events' ('name' COLLATE NOCASE);
SQL
But evidently the index isn't being used, as I can see by trying to search for events using a name in the table, but with different case.
How can I get sqlite3 and rails to use the indexes I've created?
As an example, if I have an event with the name "Fred" and I search with:
Event.where("name == ?",nameVar)
Then I can find it when nameVar=="Fred" but not when nameVar=="fred"