-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathschema.prisma
72 lines (62 loc) · 1.82 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource sqlite {
provider = "sqlite"
url = env("DATABASE_URL")
// url = "file:./data.db"
}
generator client {
provider = "prisma-client-js"
}
model Link {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
href String
readingTime String?
user User @relation(fields: [userId], references: [id])
userId Int
tags Tag[] @relation(references: [id])
timeout DateTime
notify Boolean @default(true)
title String?
@@unique([userId, href])
}
model Tag {
id Int @id @default(autoincrement())
tag String
user User @relation(fields: [userId], references: [id])
notify Boolean @default(true)
userId Int
posts Link[] @relation(references: [id])
@@unique([userId, tag])
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
createdAt DateTime @default(now())
notify Boolean @default(true)
Link Link[]
Tag Tag[]
EmailLog EmailLog[]
twitterUsername String? @unique
stripeCustomerId String? @unique
paymentStatus String @default("unsubscribed")
pocketConnected Boolean @default(false)
pocketToken PocketToken?
}
model EmailLog {
id Int @id @default(autoincrement())
mailId String
createdAt DateTime @default(now())
user User @relation(fields: [userId], references: [id])
userId Int
text String
html String
}
model PocketToken {
id Int @id @default(autoincrement())
token String? @unique
user User @relation(fields: [userId], references: [id])
userId Int
}