-
Notifications
You must be signed in to change notification settings - Fork 3
/
schema.prisma
36 lines (32 loc) · 910 Bytes
/
schema.prisma
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model User {
id Int @id @default(autoincrement())
email String @unique
password String
refreshTokens RefreshToken[]
posts Post[]
createdAt DateTime @default(now())
}
model RefreshToken {
id String @id @unique @default(uuid())
hashedToken String
userId Int
User User @relation(fields: [userId], references: [id], onDelete: Cascade)
revoked Boolean @default(false)
createdAt DateTime @default(now())
}
model Post {
id Int @id @default(autoincrement())
content String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
published Boolean @default(false)
authorId Int
author User @relation(fields: [authorId], references: [id])
}