activerecord-trilogy-adapter icon indicating copy to clipboard operation
activerecord-trilogy-adapter copied to clipboard

DATABASE_URL compatibility with mysql2://...

Open joevandyk opened this issue 2 years ago • 2 comments

We're looking to migrate from mysql2 to trilogy.

We are using a DATABASE_URL like mysql2://.....

Say we're migrating to trilogy. That DATABASE_URL (right now) can't be used if there's no mysql2 gem loaded. So we would need to somehow magically switch to a different DATABASE_URL env var when the new apps boot.

On systems like heroku, I believe this would require a bit of downtime - shutdown running version, update DATABASE_URL from mysql2:// to trilogy://, then deploy the new app.

Is there a way around this where we can use trilogy using a DATABASE_URL containing mysql2:// ?

joevandyk avatar Oct 20 '23 12:10 joevandyk

You can install both adapters (mysql2 and trilogy), update the environment variable (in Heroku it will trigger a new deployment or similar) then you can remove the mysql2 gem.

D-system avatar Jan 04 '24 03:01 D-system