You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently: when creating a delegate model with a db schema (using @@Schema), we cannot define the extended model's schema, it must be in the same schema. If I try to set the @@Schema on the extended model, during generate I get error.
How it should: It would be a very good feature to have the possibility to put the extended model in a different db schema using the @@Schema tag for extended models as well.
Use Case: when creating a multi-tenant setup with different schemas, the delegate model goes into "public" db schema, while the extended models are going into the individual "tenant" schemas. This way all the tenants have the same "base" table but different extended tables (and possibly different fields) in their own db schema.
Thank you,
Attila
The text was updated successfully, but these errors were encountered:
gattish
changed the title
[Feature Request] Delegate Model and Extended Model should support different db schema
[Bug] Delegate Model and Extended Model should support different db schema
Aug 17, 2024
UPDATE: after investigating deeper it seems it is a bug, not a feature request. When generating with "zenstack generate" the prisma schema file is created but on the extended model both "@@Schema" tag is added which is wrong. The delegated model "@@Schema" tag is also added which should not be the case and that's why "prisma generate" cannot run but gives error.
Currently: when creating a delegate model with a db schema (using @@Schema), we cannot define the extended model's schema, it must be in the same schema. If I try to set the @@Schema on the extended model, during generate I get error.
How it should: It would be a very good feature to have the possibility to put the extended model in a different db schema using the @@Schema tag for extended models as well.
Use Case: when creating a multi-tenant setup with different schemas, the delegate model goes into "public" db schema, while the extended models are going into the individual "tenant" schemas. This way all the tenants have the same "base" table but different extended tables (and possibly different fields) in their own db schema.
Thank you,
Attila
The text was updated successfully, but these errors were encountered: