rails / solid_queue

Database-backed Active Job backend
MIT License
1.66k stars 90 forks source link

Support multiple databases for install generator #217

Open fractaledmind opened 2 months ago

fractaledmind commented 2 months ago

Currently, there is no way to specify that the migration files be installed into a separate database from the default. This is problematic especially for SQLite apps, since the recommended approach is to use a separate SQLite database for the queue.

This change supports the existing behavior as well as specifying the --database option or the --db option.

fractaledmind commented 2 months ago

@rosa: I can't figure out how the solid_queue:install:migrations Rake task is defined, so I can't then figure out if there is any way to specify a specific database for that task or not.

fractaledmind commented 2 months ago

I will also add to the README and some tests

rosa commented 2 months ago

Thank you so much @fractaledmind! This is related to https://github.com/rails/solid_queue/issues/144.

The solid_queue:install:migrations task is given by Rails's Engine and yes! It does allow specifying a database via the DATABASE environment variable, it was added in https://github.com/rails/rails/pull/48579.

Thank you again! 🙏 🙇‍♀️