This is a pretty simple. industry standard one:
model Album {
AlbumId Int @id @default(autoincrement())
Title String @db.VarChar(160)
ArtistId Int
Artist Artist @relation(fields: [ArtistId], references: [ArtistId])
Track Track[]
@@index([ArtistId], name: "IFK_AlbumArtistId")
}
model Artist {
ArtistId Int @id @default(autoincrement())
Name String? @db.VarChar(120)
Album Album[]
}
model Customer {
CustomerId Int @id @default(autoincrement())
FirstName String @db.VarChar(40)
LastName String @db.VarChar(20)
Company String? @db.VarChar(80)
Address String? @db.VarChar(70)
City String? @db.VarChar(40)
State String? @db.VarChar(40)
Country String? @db.VarChar(40)
PostalCode String? @db.VarChar(10)
Phone String? @db.VarChar(24)
Fax String? @db.VarChar(24)
Email String @db.VarChar(60)
SupportRepId Int?
Employee Employee? @relation(fields: [SupportRepId], references: [EmployeeId])
Invoice Invoice[]
@@index([SupportRepId], name: "IFK_CustomerSupportRepId")
}
model Employee {
EmployeeId Int @id @default(autoincrement())
LastName String @db.VarChar(20)
FirstName String @db.VarChar(20)
Title String? @db.VarChar(30)
ReportsTo Int?
BirthDate DateTime? @db.DateTime(0)
HireDate DateTime? @db.DateTime(0)
Address String? @db.VarChar(70)
City String? @db.VarChar(40)
State String? @db.VarChar(40)
Country String? @db.VarChar(40)
PostalCode String? @db.VarChar(10)
Phone String? @db.VarChar(24)
Fax String? @db.VarChar(24)
Email String? @db.VarChar(60)
Employee Employee? @relation("EmployeeToEmployee_ReportsTo", fields: [ReportsTo], references: [EmployeeId])
Customer Customer[]
other_Employee Employee[] @relation("EmployeeToEmployee_ReportsTo")
@@index([ReportsTo], name: "IFK_EmployeeReportsTo")
}
model Genre {
GenreId Int @id @default(autoincrement())
Name String? @db.VarChar(120)
Track Track[]
}
model Invoice {
InvoiceId Int @id @default(autoincrement())
CustomerId Int
InvoiceDate DateTime @db.DateTime(0)
BillingAddress String? @db.VarChar(70)
BillingCity String? @db.VarChar(40)
BillingState String? @db.VarChar(40)
BillingCountry String? @db.VarChar(40)
BillingPostalCode String? @db.VarChar(10)
Total Decimal @db.Decimal(10, 2)
Customer Customer @relation(fields: [CustomerId], references: [CustomerId])
InvoiceLine InvoiceLine[]
@@index([CustomerId], name: "IFK_InvoiceCustomerId")
}
model InvoiceLine {
InvoiceLineId Int @id @default(autoincrement())
InvoiceId Int
TrackId Int
UnitPrice Decimal @db.Decimal(10, 2)
Quantity Int
Invoice Invoice @relation(fields: [InvoiceId], references: [InvoiceId])
Track Track @relation(fields: [TrackId], references: [TrackId])
@@index([InvoiceId], name: "IFK_InvoiceLineInvoiceId")
@@index([TrackId], name: "IFK_InvoiceLineTrackId")
}
model MediaType {
MediaTypeId Int @id @default(autoincrement())
Name String? @db.VarChar(120)
Track Track[]
}
model Playlist {
PlaylistId Int @id @default(autoincrement())
Name String? @db.VarChar(120)
PlaylistTrack PlaylistTrack[]
}
model PlaylistTrack {
PlaylistId Int
TrackId Int
Playlist Playlist @relation(fields: [PlaylistId], references: [PlaylistId])
Track Track @relation(fields: [TrackId], references: [TrackId])
@@id([PlaylistId, TrackId])
@@index([TrackId], name: "IFK_PlaylistTrackTrackId")
}
model Track {
TrackId Int @id @default(autoincrement())
Name String @db.VarChar(200)
AlbumId Int?
MediaTypeId Int
GenreId Int?
Composer String? @db.VarChar(220)
Milliseconds Int
Bytes Int?
UnitPrice Decimal @db.Decimal(10, 2)
Album Album? @relation(fields: [AlbumId], references: [AlbumId])
Genre Genre? @relation(fields: [GenreId], references: [GenreId])
MediaType MediaType @relation(fields: [MediaTypeId], references: [MediaTypeId])
InvoiceLine InvoiceLine[]
PlaylistTrack PlaylistTrack[]
@@index([AlbumId], name: "IFK_TrackAlbumId")
@@index([GenreId], name: "IFK_TrackGenreId")
@@index([MediaTypeId], name: "IFK_TrackMediaTypeId")
}
Let me know if you need more, both huge or small, to test specific things - happy to help out here.