I am working with a project that has been running for a while against MySQL. There are migrations such as this:
add_index "things", ["one", "two", "three", "andevenmorelongnamedfields"]
Which causes an index named like this index_things_on_one_and_two_and_three_and_andevenmorelongnamedfields
. This is OK for MySQL but too long for PostgreSQL.
This question recommends altering existing migrations.
add_index "things", ["one", "two", "three", "andevenmorelongnamedfields"], :name => "index_things_on_one_and_two_and_three_and_more"
That would solve it superficially.
However the codebase is already running against MySQL so changing past migrations would be a bad idea. I'm trying to install from scratch against PostgreSQL which (I think) means running all migrations?
I may have missed something here (I'm more familiar with Django), but am I correct in thinking that ActiveRecord isn't compatible with PostgreSQL in this specific instance?
How can I solve this (i.e. get it working with both Postgres and MySQL) without creating integrity problems for others?