Add an update generator to copy new migrations#765
Merged
Conversation
Future schema changes will ship as regular migrations, optional at first and required in the next major version. `rails solid_queue:update` (or the solid_queue:update generator directly) copies any new migration files from the gem to the application, honoring the database the app uses for Solid Queue via the --database option. Together with this, add a deprecator for Solid Queue, registered with the application so it follows the app's deprecation behavior settings, and a warning helper that features guarded behind pending migrations can use to instruct users to update. Extracted from earlier work on linking claimed executions to processes by name, which ended up not being needed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Groundwork for shipping schema changes as regular migrations, starting with batch support: new migrations will be optional at first (features degrade gracefully with a deprecation warning) and required in the next major version.
This adds:
SolidQueue::UpdateGenerator:bin/rails solid_queue:update(orbin/rails generate solid_queue:update) copies any new migration files shipped with the gem into the application, honoring the Solid Queue database via--database(defaults toqueue, so migrations land in the rightmigrations_paths). Idempotent: already-copied migrations are skipped. There are no migration templates yet — the first one arrives with batches.SolidQueue.deprecator, registered with the application's deprecators, so it follows the app's configured deprecation behavior.Record.warn_about_pending_migrations: the warning helper features guarded behind pending migrations will use, pointing users atsolid_queue:update+db:migrateand noting the migrations become required after the next major version.Extracted from earlier exploratory work (the
claimed-executions-by-process-namebranch) whose feature ended up not being needed — the migration machinery is what we want to keep.🤖 Generated with Claude Code