Closed Bayezid1989 closed 6 months ago
Hi, I probably founded a minor bug for implicit join table type. Version: 1.7.1
Here is a sample schema that has 2 models that joined m-n way.
model Shop { id Int @id @default(autoincrement()) name String categories Category[] } model Category { name String @id shops Shop[] }
In this case, the following is correctly created, which corresponds to the actual created table.
export type CategoryToShop = { A: string; B: number; };
[Bug case] On the other hand, if I name the join field from "shops" to "businesses",
model Shop { id Int @id @default(autoincrement()) name String categories Category[] } model Category { name String @id businesses Shop[] }
Types of A and B become opposite, which doesn't match with the actual table.
export type CategoryToShop = { A: number; B: string; };
Hi, I probably founded a minor bug for implicit join table type. Version: 1.7.1
Here is a sample schema that has 2 models that joined m-n way.
In this case, the following is correctly created, which corresponds to the actual created table.
[Bug case] On the other hand, if I name the join field from "shops" to "businesses",
Types of A and B become opposite, which doesn't match with the actual table.