Skip to content

Modify migration 005 to tolerate the absence of river_migration - #465

Merged
brandur merged 1 commit into
masterfrom
brandur-005-tolerate-river-migration-absence
Jul 24, 2024
Merged

Modify migration 005 to tolerate the absence of river_migration#465
brandur merged 1 commit into
masterfrom
brandur-005-tolerate-river-migration-absence

Conversation

@brandur

@brandur brandur commented Jul 22, 2024

Copy link
Copy Markdown
Contributor

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;

@brandur brandur Jul 22, 2024

Copy link
Copy Markdown
Contributor Author

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

brandur commented Jul 24, 2024

Copy link
Copy Markdown
Contributor Author

Thanks!

@brandur
brandur merged commit a1f8098 into master Jul 24, 2024
@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