-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathschema.prisma
More file actions
47 lines (41 loc) · 1008 Bytes
/
schema.prisma
File metadata and controls
47 lines (41 loc) · 1008 Bytes
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
datasource db {
provider = "mongodb"
url = env("MONGO_DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
enum Status {
ACTIVE
REMOVED
}
model Post {
id String @id @default(uuid()) @map("_id")
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
content String?
someJson Json? @db.Json
status Status @default(ACTIVE)
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId String
}
model Profile {
id String @id @default(uuid()) @map("_id")
bio String?
user User @relation(fields: [userId], references: [id])
userId String @unique
}
model User {
id String @id @default(uuid()) @map("_id")
email String @unique
name String?
posts Post[]
profile Profile?
updatedAt DateTime @default(now()) @updatedAt
}
model UuidExample {
id String @id @default(uuid()) @map("_id")
label String
}