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

[PG] adds warnings about missed migrations #3953

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Aeolun
Copy link

@Aeolun Aeolun commented Jan 15, 2025

The postgres migrator would silently skip migrations that were merged in from older branches if a newer migration had already been executed. If something went wrong, it also wasn't very clear what statement/migration caused the issues.

What has changed:

  • The migrator will now throw specific DrizzleError errors with appropriate contextual data when something goes wrong during migration, instead of relying on the message inherent to the failure.
  • A new error condition has been added when a migration will be skipped entirely while not yet existing in the migration table.

Potential further work:

  • Extend this to other dialects
  • Generalize it so code for the migrations isn't duplicated across dialects

@Aeolun Aeolun force-pushed the fix/more-sensible-postgres-warnings branch 3 times, most recently from e5bb5f5 to 9cdfa1d Compare January 15, 2025 00:40
@Aeolun Aeolun changed the title fix: adds warnings about missed migrations [PG] adds warnings about missed migrations Jan 15, 2025
The postgres migrator would silently skip migrations that were merged in from older branches if a newer migration had already been executed. It also wasn't very clear about during what statement/migration issues happened
@Aeolun Aeolun force-pushed the fix/more-sensible-postgres-warnings branch from 9cdfa1d to 57a760d Compare January 16, 2025 02:46
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.

1 participant