wasp/examples/thoughts/schema.prisma
2024-07-08 18:02:54 +02:00

39 lines
738 B
Plaintext

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model Thought {
id Int @id @default(autoincrement())
textMarkdown String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
tags Tag[]
user User @relation(fields: [userId], references: [id])
userId Int
}
model Tag {
id Int @id @default(autoincrement())
name String
createdAt DateTime @default(now())
thoughts Thought[]
user User @relation(fields: [userId], references: [id])
userId Int
@@unique([name, userId])
}
model User {
id Int @id @default(autoincrement())
thoughts Thought[]
tags Tag[]
}