From ad44cc813890ba12703cafe02768e7e5564c23ca Mon Sep 17 00:00:00 2001 From: Rosa Gutierrez Date: Mon, 16 Sep 2024 12:45:30 +0200 Subject: [PATCH] Clarify migrations when upgrading from version < 0.6.0 As pointed out in #348 --- README.md | 4 ++-- UPGRADING.md | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 313623c7..b2d43542 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Solid Queue is configured by default in new Rails 8 applications. But if you're This will configure Solid Queue as the production Active Job backend, create the configuration files `config/queue.yml` and `config/recurring.yml`, and create the `db/queue_schema.rb`. It'll also create a `bin/jobs` executable wrapper that you can use to start Solid Queue. -Once you've done that, you will then have to add the configuration for the queue database in `config/database.yml`. If you're using sqlite, it'll look like this: +Once you've done that, you will then have to add the configuration for the queue database in `config/database.yml`. If you're using SQLite, it'll look like this: ```yaml production: @@ -56,7 +56,7 @@ For small projects, you can run Solid Queue on the same machine as your webserve ### Single database configuration -It's also possible to use one single database for both production data: +Running Solid Queue in a separate database is recommended, but it's also possible to use one single database for both the app and the queue. Just follow these steps: 1. Copy the contents of `db/queue_schema.rb` into a normal migration and delete `db/queue_schema.rb` 2. Remove `config.solid_queue.connects_to` from `production.rb` diff --git a/UPGRADING.md b/UPGRADING.md index 3fa46cee..cb39a5d2 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -4,23 +4,17 @@ This version has two breaking changes regarding configuration: - Recurring tasks are now defined in `config/recurring.yml` (by default). Before, they would be defined as part of the _dispatcher_ configuration. Now they've been upgraded to their own configuration file, and a dedicated process (the _scheduler_) to manage them. Check the _Recurring tasks_ section in the `README` to learn how to configure them in detail. They still follow the same format as before when they lived under `dispatchers > recurring_tasks`. # Upgrading to version 0.8.x -*IMPORTANT*: This version collapsed all migrations into a single `db/queue_schema.rb`, that will use a separate `queue` database. If you're upgrading from a version < 0.6.0, you need to upgrade to 0.6.0 first, ensure all migrations are up-to-date, and then upgrade further. +*IMPORTANT*: This version collapsed all migrations into a single `db/queue_schema.rb`, that will use a separate `queue` database on install. If you're upgrading from a version < 0.6.0, you need to upgrade to 0.6.0 first, ensure all migrations are up-to-date, and then upgrade further. You don't have to switch to a separate `queue` database or use the new `db/queue_schema.rb` file, these are for people starting on a version >= 0.8.x. You can continue using your existing database (be it separate or the same as your app) as long as you run all migrations defined up to version 0.6.0. # Upgrading to version 0.7.x This version removed the new async mode introduced in version 0.4.0 and introduced a new binstub that can be used to start Solid Queue's supervisor. -To install both the binstub `bin/jobs` and the migration, you can just run +To install the binstub `bin/jobs`, you can just run: ``` bin/rails generate solid_queue:install ``` -Or, if you're using a different database for Solid Queue: - -```bash -$ bin/rails generate solid_queue:install --database -``` - # Upgrading to version 0.6.x