forked from prisma/prisma-engines
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datamodel_v2.prisma
110 lines (100 loc) · 2.53 KB
/
datamodel_v2.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
datasource chinook {
provider = "sqlite"
url = "file:./db/Chinook.db"
}
model Album {
id Int @id @map("AlbumId")
Title String @default("TestDefaultTitle")
ArtistId Int
Tracks Track[]
Artist Artist @relation(fields: [ArtistId], references: [id])
}
model Track {
id Int @id @map("TrackId")
Name String
Composer String?
Milliseconds Int
UnitPrice Float
AlbumId Int?
GenreId Int?
MediaTypeId Int
MediaType MediaType @relation(fields: [MediaTypeId], references: [id])
Genre Genre? @relation(fields: [GenreId], references: [id])
Album Album? @relation(fields: [AlbumId], references: [id])
InvoiceLines InvoiceLine[]
}
model MediaType {
id Int @id @map("MediaTypeId")
Name String?
Track Track[]
}
model Genre {
id Int @id @map("GenreId")
Name String?
Tracks Track[]
}
model Artist {
id Int @id @map("ArtistId")
Name String?
Albums Album[]
}
model Customer {
id Int @id @map("CustomerId")
FirstName String
LastName String
Company String?
Address String?
City String?
State String?
Country String?
PostalCode String?
Phone String?
Fax String?
Email String
SupportRepId Int?
SupportRep Employee? @relation(fields: [SupportRepId], references: [id])
Invoices Invoice[]
}
model Employee {
id Int @id @map("EmployeeId")
FirstName String
LastName String
Title String?
BirthDate DateTime?
HireDate DateTime?
Address String?
City String?
State String?
Country String?
PostalCode String?
Phone String?
Fax String?
Email String?
Customers Customer[]
}
model Invoice {
id Int @id @map("InvoiceId")
InvoiceDate DateTime
BillingAddress String?
BillingCity String?
BillingState String?
BillingCountry String?
BillingPostalCode String?
Total Float
CustomerId Int
Customer Customer @relation(fields: [CustomerId], references: [id])
Lines InvoiceLine[]
}
model InvoiceLine {
id Int @id @map("InvoiceLineId")
UnitPrice Float
Quantity Int
InvoiceId Int
TrackId Int
Invoice Invoice @relation(fields: [InvoiceId], references: [id])
Track Track @relation(fields: [TrackId], references: [id])
}
model Playlist {
id Int @id @map("PlaylistId")
Name String?
}