mirror of
https://github.com/wasp-lang/wasp.git
synced 2025-01-01 13:42:12 +03:00
39 lines
738 B
Plaintext
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[]
|
||
|
}
|