Код
model Account {
id Int @id @default(autoincrement())
parentAccountId Int?
parentAccount Account? @relation("Parent", fields: [parentAccountId], references: [id])
childAccounts Account[] @relation("Parent")
email String @unique
name String?
meta Json
isActive Boolean @default(false)
createdAt DateTime @default(now())
posts Post[]
}
model Post {
id Int @id @default(autoincrement())
title String
content String?
published Boolean @default(false)
account Account @relation(fields: [accountId], references: [id])
accountId Int
}