-
Notifications
You must be signed in to change notification settings - Fork 194
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
Keep current database version when migration fails #81
Comments
I'm currently triaging all the old issues. Is this bug about:
The description is not quite clear about this 😉 |
Fair points. I was under the impression that when a migration e.g. from version 1 to 2 fails, version 2 will still be the new database version. This means that no data has been migrated but the new version is used already. Solutions:
If Floor would be able to generate migrations the chances would be smaller that these fail. What are your thoughts on this? @mqus |
I think generating migrations is pretty impossible to get right... But I haven't worked with many ORMs yet[1] to have a good impression on how others do this. Why do I think it is impossible then? The following has to happen in migrations:
All of the above are very semantic operations which heavily depend on the application logic. I also think that they cannot be described more concise than in sql. I think that failing early and loud is the right way, although i'm currently not near a pc to look at the code and what would be possible. [1]The one that immediately comes to my mind is diesel in rust, in which the migrations are the only sql you will have to write. The fully-migrated database is then type-validated with the annotated entities. But that's a completely different orm concept. |
After looking at the code it doesn't seem impossible to fail when we need to. I would also automatically put each migration into a |
Sounds reasonable 👍 |
No description provided.
The text was updated successfully, but these errors were encountered: