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
MRE for 1778 #1779
base: master
Are you sure you want to change the base?
MRE for 1778 #1779
Conversation
issues/1778/src/entity/dest.rs
Outdated
@@ -0,0 +1,31 @@ | |||
//! SeaORM Entity. Generated by sea-orm-codegen 0.9.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting. But can you update to the latest sea-orm-cli version and check the result? Preferably 0.12.rc-5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad, yep—I originally did it with 0.11 and regenerated for this example. Will try it with 0.12.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reran with the latest version on master, which was 0.12.rc-4
. Couldn't find a branch or anything for rc-5
.
I also moved the files around into a separate module per schema (had mistakenly overwritten one mod/prelude with the other so the error looked the same), since that's the way my actual entities are organized, but I'm realizing I don't think that's standardized by sea-orm in any way I know of. Not sure if I got the idea of separating the schemata like that from an example of y'all's or if I just made that up.
If that is the intended organization (entity::schema::table::model
), then I was thinking it should just have gone one level up (like super::super::src::src::id
) but if it's not then that won't work in general. I guess the only like real danger with the current behavior is if you had a table with the same name in each schema, then the foreign key wouldn't give the compile error since it would resolve, just to the wrong table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://crates.io/crates/sea-orm-cli/0.12.0-rc.5 rc.5 was just released a few days ago
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
…rrect module structure
Thanks for helping out. A brief investigation says that we currently don't have a concept of "multiple schemas" in the codegen. And actually, inside SeaSchema, we are not capturing the However, a bigger question might be how actually we'd organize a multi-schema entity workspace. |
PR Info
sea_orm_cli
doesn't generate the correct relation for a foreign key in a different schema #1778