Bruno Casado
10/21/2021, 5:58 PMTableA {
fieldA_id int
fieldA Gene @relation(fields: [fieldA_id], references: [id])
}
Gene {
...
TableA TableA[]
}
But after i changed the Gene TableA to use 2 fields but same opposition relationship it stops to works:
like:
fieldA_id int
fieldB_id int
fieldA Gene @relation(name: "field_a_pk", fields: [fieldA_id], references: [id])
fieldB Gene @relation(name: "field_b_pk", fields: [fieldB_id], references: [id])
error:
WomanCareInfo = TableA in this case.
error: Error validating field `gene_loc_1` in model `WomanCareInfo`: The relation field `gene_loc_1` on Model `WomanCareInfo` is missing an opposite relation field on the model `Gene`. Either run `prisma format` or add it manually.
--> schema.prisma:335
|
334 |
335 | gene_loc_1 Gene @relation(name: "gene_1_pk", fields: [gene_1_id], references: [id])
336 | gene_loc_2 Gene @relation(name: "gene_2_pk", fields: [gene_2_id], references: [id])
|
error: Error validating field `gene_loc_2` in model `WomanCareInfo`: The relation field `gene_loc_2` on Model `WomanCareInfo` is missing an opposite relation field on the model `Gene`. Either run `prisma format` or add it manually.
--> schema.prisma:336
|
335 | gene_loc_1 Gene @relation(name: "gene_1_pk", fields: [gene_1_id], references: [id])
336 | gene_loc_2 Gene @relation(name: "gene_2_pk", fields: [gene_2_id], references: [id])
337 |
is this a sort of bug?Bruno Casado
10/22/2021, 2:21 PM