-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathschema.prisma
More file actions
34 lines (30 loc) · 809 Bytes
/
schema.prisma
File metadata and controls
34 lines (30 loc) · 809 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
datasource db {
provider = "postgresql"
url = "postgresql://admin:admin@localhost:54322/example?schema=public"
}
generator client {
provider = "prisma-client-js"
}
model Post {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String @db.VarChar(255)
content String?
published Boolean @default(false)
author User @relation(fields: [authorId], references: [id])
authorId Int
}
model Profile {
id Int @id @default(autoincrement())
bio String?
user User @relation(fields: [userId], references: [id])
userId Int @unique
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
posts Post[]
profile Profile?
}