Replies: 1 comment
-
|
Hey @nick-kang, it should works just fine. Please check that your generated entity definition should have a #[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq)]
#[sea_orm(schema_name = "schema_name", table_name = "_cake_filling_")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub cake_id: i32,
#[sea_orm(primary_key, auto_increment = false)]
pub filling_id: i32,
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
How do you handle code generation with multiple Postgres schemas with foreign keys in different schemas? We use multiple schemas to organize our tables.
I tried two methods that don't seem to work.
I tried running the cli command twice, but this lead to
mod.rsonly containing the tables for the last schema.I then tried creating a separate folder for each schema, but the code won't compile because it expected all the entities to be in the same folder (ie, the table referenced another table in a separate schema which was in a separate folder now)
Our current workaround is to put all tables in one schema, which isn't ideal.
Beta Was this translation helpful? Give feedback.
All reactions