-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
41 lines (32 loc) · 1.17 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
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("POSTGRES_PRISMA_URL")
directUrl = env("POSTGRES_URL_NON_POOLING")
}
model User {
hash String @id @unique
createdAt DateTime @default(now()) @map(name: "created_at")
ContentInteraction ContentInteraction[]
@@map(name: "users")
}
model Content {
slug String @id @unique
createdAt DateTime @default(now()) @map(name: "created_at")
ContentInteraction ContentInteraction[]
@@map(name: "contents")
}
model ContentInteraction {
createdAt DateTime @default(now()) @map(name: "created_at")
updatedAt DateTime @updatedAt @map(name: "updated_at")
seen Boolean @default(false)
likes Int @default(0) @db.SmallInt()
User User @relation(fields: [userHash], references: [hash])
userHash String @map(name: "user_hash")
Content Content @relation(fields: [contentSlug], references: [slug])
contentSlug String @map(name: "content_slug")
@@id(name: "interactionRelation", [userHash, contentSlug])
@@map(name: "content_interactions")
}