Amit Kumar
09/29/2022, 7:20 AMuser_id
in the table user_posts
is a reference to the table users
.
So when I introspect the database, schema like the following is generated, where it doesn't implicitly knows the relations
model users {
id BigInt @id @default(autoincrement())
user_name String? @db.VarChar
tenant_id Int?
}
model user_posts {
id BigInt @id @default(autoincrement())
post_id Int?
user_id Int?
tenant_id Int?
}
Any solution for this other than declaring each supposed foreign key in the main database?Raphael Etim
09/29/2022, 7:32 AMAmit Kumar
09/29/2022, 7:35 AMAmit Kumar
09/29/2022, 7:37 AMRaphael Etim
09/29/2022, 7:43 AMAmit Kumar
09/29/2022, 9:06 AMRaphael Etim
09/29/2022, 9:36 AMVladi Stevanovic