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
entc/gen: set foreign-key columns non-nullable for required edges #1703
Conversation
Is this still being worked on? This fix is really needed for my use case. |
is this still active? |
We faced this issue at @cirruslabs while trying to ensure consistency and I've tried reproducing the failed migration test locally and got this:
The previous migration created by It seems that the current migration logic is somewhat append-only and won't change any constraints: ent/dialect/sql/schema/migrate.go Lines 136 to 144 in 14cba0a
@a8m do you think adding a separate migration option that will enable schema modifications such as constraint updates would be a reasonable way solve this? I've also read in some issues that a work on a new migration engine is being done, do you have any plans to de-compose this task into smaller chunks and make this effort more transparent overall, so that the community could help? |
The UnsetNull simulates a test case for ent/ent#1703.
The UnsetNull simulates a test case for ent/ent#1703.
@a8m Any progress on this pull request? |
Hey all, this PR actually waited a long time for the new migration engine, due to migration failures, and thanks to github.com/ariga/atlas, this issue is resolved now and I plan to merge it on Sunday morning. CI is green, and the only thing left is to update the documentation. If you didn't have a chance to see our v0.10 yesterday, here's the announcement post. Thanks 🙏 ❤️ |
Note, this only applies to edges without circular references.
Fixed #1688 and #1374