fix prisma models tests
@@ -242,7 +242,8 @@ fn explicit_relation_fields() {
model Post {
id Int @id
- blog Blog? @map(name:"blog_id")
+ blogId Int? @map("blog_id")
+ blog Blog? @relation(fields: blogId, references: id)
}
"#,
);
@@ -357,7 +358,8 @@ fn explicit_relation_names() {
model Post {
id Int @id
- blog Blog? @relation(name: "MyRelationName")
+ blogId Int?
+ blog Blog? @relation(name: "MyRelationName", fields: blogId, references: id)
}
"#,
);
@@ -407,8 +409,10 @@ fn ambiguous_relations() {
model Post {
id Int @id
- blog1 Blog @relation(name: "Relation1")
- blog2 Blog @relation(name: "Relation2")
+ blog1Id Int
+ blog2Id Int
+ blog1 Blog @relation(name: "Relation1", fields: blog1Id, references: id)
+ blog2 Blog @relation(name: "Relation2", fields: blog2Id, references: id)
}
"#,
);
