Skip to content
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

[Bug] Delegate Model and Extended Model should support different db schema #1647

Closed
gattish opened this issue Aug 16, 2024 · 2 comments
Closed
Milestone

Comments

@gattish
Copy link

gattish commented Aug 16, 2024

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

@gattish 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
@gattish
Copy link
Author

gattish commented 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.

@ymc9
Copy link
Member

ymc9 commented Jan 7, 2025

Fixed in v2.11.0

@ymc9 ymc9 closed this as completed Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants