forked from GoogleCloudPlatform/pgadapter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.prisma
More file actions
83 lines (76 loc) · 2.07 KB
/
schema.prisma
File metadata and controls
83 lines (76 loc) · 2.07 KB
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
83
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Singer {
id String @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
firstName String
lastName String
/// `fullName` is generated by the database and should not be set.
fullName String?
active Boolean
albums Album[]
Concert Concert[]
@@index(lastName)
}
model Album {
id String @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
marketingBudget Decimal?
releaseDate DateTime? @db.Date
coverPicture Bytes?
singer Singer @relation(fields: [singerId], references: [id])
singerId String
tracks Track[]
@@unique([singerId, title])
}
model Track {
id String
trackNumber BigInt
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
title String
sampleRate Float?
album Album @relation(fields: [id], references: [id])
@@id([id, trackNumber])
@@unique([id, title])
}
model Venue {
id String @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
description Json
Concert Concert[]
}
model Concert {
id String @id
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
name String
venue Venue @relation(fields: [venueId], references: [id])
venueId String
singer Singer @relation(fields: [singerId], references: [id])
singerId String
startTime DateTime @db.Timestamptz
endTime DateTime @db.Timestamptz
ticketSales TicketSale[]
@@index([startTime(sort: Desc)])
}
model TicketSale {
id Int @id @default(autoincrement())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
concert Concert @relation(fields: [concertId], references: [id])
concertId String
customerName String
price Decimal
seats String[]
}