-
Notifications
You must be signed in to change notification settings - Fork 65
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
Hash mismatch when running the same migration on different OS (Windows and macOS) #64
Comments
Hi, thanks for the bug report. Could you explain what practical problem this causes? Do you have apps running on different OSs connecting to the same shared database and both doing migrations? If so... can I ask why? |
The situation is: Now the migrations validation works without any issue on macOS but on Windows, they fail because the local files are checked out with CR LF endings by git. Therefore, there's a hash mismatch. The PR converts the CR LF line endings to LF before calculating the hash. |
Great, thanks. That's useful context. Since this is essentially a breaking change on Windows, in my mind this potentially needs a new major version. I have some other changes I'd like to merge in as well (#58) so I'll find some time soon to get those changes in and release them. |
Probably, faced the same problem. Initially ran migration on Windows. After that tried to run same migration on the same DB but in wsl2 ubuntu. Got:
|
I think hash should be generated after formatting the SQL file without any excessive new space or any new line at all. So that even with formatting differences, the output of the hash is the same. |
I ended up forking and making the migrator log hash differences but not prevent the migrations from running. This is fine as the project is only for me so there isn't a chance of index clashes etc. |
Faced this issue recently, ended up patching the package with |
There's a hash mismatch when running the same migration on different operating systems. I believe it's due to the line endings, the hash that gets generated is different. What's the possible solution to this? Will replacing CRLF with LF fix this?
The text was updated successfully, but these errors were encountered: