-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathschema.prisma
82 lines (74 loc) · 2.21 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
// 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 User {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
id Int @id @default(autoincrement())
lastName String
firstName String
// could be 3A or so
schoolGrade String?
schoolTeacherName String?
eMail String?
active Boolean @default(true)
books Book[]
}
model LoginUser {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
id Int @id @default(autoincrement())
username String @unique
email String
password String
role String
active Boolean @default(true)
}
model Audit {
createdAt DateTime @default(now())
id Int @id @default(autoincrement())
eventType String
eventContent String
bookid Int?
userid Int?
}
model Book {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
id Int @id @default(autoincrement())
rentalStatus String @default("available")
rentedDate DateTime @default(now())
dueDate DateTime?
renewalCount Int
title String
subtitle String?
author String
topics String?
imageLink String?
//additional fields from OpenBiblio data model
isbn String?
editionDescription String?
publisherLocation String?
pages Int?
summary String?
minPlayers String?
publisherName String?
otherPhysicalAttributes String?
supplierComment String?
publisherDate String?
physicalSize String?
minAge String?
maxAge String?
additionalMaterial String?
//why is this string? In the migration, there were often DM prices or some other text
price String?
externalLinks String?
user User? @relation(fields: [userId], references: [id], onUpdate: Cascade, onDelete: Cascade)
userId Int?
}