mirror of
https://github.com/zenstackhq/zenstack
synced 2026-05-24 10:08:55 +00:00
35 lines
683 B
Text
35 lines
683 B
Text
datasource db {
|
|
provider = 'sqlite'
|
|
}
|
|
|
|
model User {
|
|
id String @id @default(cuid())
|
|
email String @unique
|
|
name String?
|
|
posts Post[]
|
|
}
|
|
|
|
model Post {
|
|
id String @id @default(cuid())
|
|
title String
|
|
owner User? @relation(fields: [ownerId], references: [id])
|
|
ownerId String?
|
|
category Category? @relation(fields: [categoryId], references: [id])
|
|
categoryId String?
|
|
}
|
|
|
|
model Category {
|
|
id String @id @default(cuid())
|
|
name String @unique
|
|
posts Post[]
|
|
}
|
|
|
|
model Foo {
|
|
id String @id @default(cuid())
|
|
type String
|
|
@@delegate(type)
|
|
}
|
|
|
|
model Bar extends Foo {
|
|
title String
|
|
}
|