-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.prisma
38 lines (34 loc) · 1.13 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
generator client {
provider = "prisma-client-js"
previewFeatures = ["reactNative"]
}
datasource db {
provider = "sqlite"
url = "file:./app.db"
}
// Your data model
model User {
id Int @id @default(autoincrement())
name String
email String @default("")
notionFiles NotionFile[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model NotionFile {
id Int @id @default(autoincrement())
coverPhoto String
icon String
title String
description String
content String
type String
authorId Int
author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
parentFileId Int? // Nullable to allow top-level files
parentFile NotionFile? @relation("FileHierarchy", fields: [parentFileId], references: [id], onDelete: Cascade)
subFiles NotionFile[] @relation("FileHierarchy")
order Int @default(0)
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}