forked from remix-run/example-trellix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.prisma
64 lines (53 loc) · 1.51 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
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model Account {
id String @id @default(uuid())
email String @unique
boards Board[]
Password Password?
}
model Password {
id String @id @default(uuid())
salt String
hash String
Account Account @relation(fields: [accountId], references: [id])
accountId String @unique
}
model Board {
id Int @id @default(autoincrement())
name String
color String @default("#e0e0e0")
createdAt DateTime @default(now())
columns Column[]
items Item[]
Account Account @relation(fields: [accountId], references: [id])
accountId String
}
model Column {
id String @id @default(uuid())
name String
order Float @default(0)
items Item[]
Board Board @relation(fields: [boardId], references: [id], onDelete: Cascade)
boardId Int
}
model Item {
id String @id @default(uuid())
title String
content String?
// we split the difference between the prev/next items. If an item is dropped
// between 1.00 and 2.00 it will be 1.50. If dropped between 1.50 and 2.00 it
// will be 1.75, etc.
order Float
Column Column @relation(fields: [columnId], references: [id], onDelete: Cascade)
columnId String
Board Board @relation(fields: [boardId], references: [id], onDelete: Cascade)
boardId Int
}