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

Prevent panic when db schema differs from migrations #373

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

Conversation

JonasFocke01
Copy link

Hello,

sorry for just opening a pr without an issue linked.
I did this because the change i have done was pretty small.

I got this panic, when i applied a migration, then altered the database schema and ran the migration again.
2025-03-06_13-14
I tracked the unwrap() in question down to the changed file in the pr and just updated the failed state of the migration.
This allows the user to catch the error and handle it himself.

Anything i should do different?

runner.abort_missing,
&runner.migration_table_name,
);
let failed = unapplied_migrations.is_err();
Copy link
Author

Choose a reason for hiding this comment

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

I had to assign failed up here, because borrowchecker

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