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

psl: fix database name clash validation with multiSchema #3255

Merged
merged 1 commit into from Sep 30, 2022

Conversation

tomhoule
Copy link
Contributor

The validation we have validates that no two models in the whole schema have the same database name. Database name is defined as the contents of the model's @@map attribute, or the model name if the model name does not have an @@map attribute. It is the name we give to the table/collection corresponding to the model in the database.

When the multiSchema preview feature is turned on, the tables in the database can be in different schemas, so we have to adapt the validation to allow multiple models to have the same database name, as long as they are in a different schema. This is what this commit does.

closes prisma/prisma#15009

@tomhoule tomhoule requested a review from a team as a code owner September 30, 2022 14:31
@tomhoule tomhoule added this to the 4.5.0 milestone Sep 30, 2022
The validation we have validates that no two models in the whole schema
have the same database name. Database name is defined as the contents of
the model's `@@map` attribute, or the model name if the model name does
not have an `@@map` attribute. It is the name we give to the
table/collection corresponding to the model in the database.

When the `multiSchema` preview feature is turned on, the tables in the
database can be in different schemas, so we have to adapt the
validation to allow multiple models to have the same database name, as
long as they are in a different schema. This is what this commit does.

closes prisma/prisma#15009
@tomhoule tomhoule merged commit 6a8c406 into main Sep 30, 2022
@tomhoule tomhoule deleted the psl/multi-schema-map-conflict branch September 30, 2022 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Multi Schema] Same model map different schema
3 participants