-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Diesel migration fails to apply schema patch. #3055
Comments
From diesels side everything seems to work as expected here. Diesel cli tries to apply the patch file to the newly generated schema and fails due to merge conflicts. There is no way for us to automatically apply the patch in such situations, therefore the error message. Closed as this is not a bug. |
I understand but given that this is the only workflow available with no way to recover from errors (as far as I can tell), maybe the diesel team should come up with a way to handle situations like this one. As a user, I don't expect my migrations not to work due to "patch" conflicts. Maybe the problem is that diesel uses patch files, or that there's no workflow to resolve the conflicts if they do happen. Maybe there's no better way, I don't know. Just FYI, I managed to work around this by changing the table name in the migration. But you can imagine why I may not want to do that. |
It would be great to see improvements here, but we do not have the capacity to implement larger improvements here. That written improvements to the existing workflow are definitively welcome. Please open a new discussion thread outlining the basic idea, if someone is interested to work on concrete proposals. |
Setup
Versions
Feature Flags
Problem Description
Diesel fails to apply the patch. It seems to be an issue with
recent_crate_downloads
. AFAIK, there isn't a way to manually apply the patch or fix the issues so it's unclear how to make any progress.What are you trying to accomplish?
Setup a new table in crates.io
What is the expected output?
The migration runs successfully.
What is the actual output?
Can't apply the patch.
Are you seeing any additional errors?
No.
Steps to reproduce
Clone crates.io and follow the instructions in docs/CONTRIBUTING.md to setup up for backend development.
Assuming everything builds with
cargo build
, create a new migration namedcreate_sessions
(name won't matter).Setup the migration files as follows:
up.sql
down.sql
DROP TABLE sessions;
Run
diesel migration run
.Checklist
closed if this is not the case)
The text was updated successfully, but these errors were encountered: