Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify migration 005 to tolerate the absence of river_migration #465

Merged
merged 1 commit into from
Jul 24, 2024

Conversation

brandur
Copy link
Contributor

@brandur brandur commented Jul 22, 2024

Version 0.10.0's migration (005) brought in a number of changes
including one that adds a new line field to the migration table.

It works, but could present a problem for River installations that are
purposely not using River's migration system, which is a path that even
if not explicitly recommended, we've been trying to support.

Here, add some conditionals to 005 so that the migration-related changes
only run if river_migration exists. A test verifies that even if 001
(which brings in river_migration) had never run, the up and own
migrations still work.

SELECT created_at, version
FROM river_migration_old;

DROP TABLE river_migration_old;
Copy link
Contributor Author

@brandur brandur Jul 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No actual changes here really, but everything moves up into the IF block/script above.

The down migration looks like it has more red because it already had a Pl/pgSQL block going on, and we only needed one of them, so I repurposed it to contain both conditionals.

@brandur brandur force-pushed the brandur-005-tolerate-river-migration-absence branch from 8ba37a1 to 24e2676 Compare July 22, 2024 04:52
@brandur brandur requested a review from bgentry July 22, 2024 04:54
Version 0.10.0's migration (005) brought in a number of changes
including one that adds a new `line` field to the migration table.

It works, but could present a problem for River installations that are
purposely not using River's migration system, which is a path that even
if not explicitly recommended, we've been trying to support.

Here, add some conditionals to 005 so that the migration-related changes
only run if `river_migration` exists. A test verifies that even if 001
(which brings in `river_migration`) had never run, the up and own
migrations still work.
@brandur brandur force-pushed the brandur-005-tolerate-river-migration-absence branch from 24e2676 to 2bd397b Compare July 24, 2024 03:00
@brandur
Copy link
Contributor Author

brandur commented Jul 24, 2024

Thanks!

@brandur brandur merged commit a1f8098 into master Jul 24, 2024
10 checks passed
@brandur brandur deleted the brandur-005-tolerate-river-migration-absence branch July 24, 2024 03:24
brandur added a commit that referenced this pull request Jul 24, 2024
A small patch release containing #465 which will allow 0.10.0's
migrations to be run more easily for users not using River's internal
migration framework.
@brandur brandur mentioned this pull request Jul 24, 2024
brandur added a commit that referenced this pull request Jul 24, 2024
A small patch release containing #465 which will allow 0.10.0's
migrations to be run more easily for users not using River's internal
migration framework.

This will also require a separate CLI release which I'll follow up with.
brandur added a commit that referenced this pull request Jul 24, 2024
A small patch release containing #465 which will allow 0.10.0's
migrations to be run more easily for users not using River's internal
migration framework.

This will also require a separate CLI release which I'll follow up with.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants