-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow setting
Application Name
parameter on SQL Server connection s…
…tring (#2112)
- Loading branch information
Julius de Bruijn
committed
Jul 26, 2021
1 parent
d616ac2
commit 89facab
Showing
2 changed files
with
155 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
previewFeatures = ["nApi", "filterJson"] | ||
output = "./client" | ||
} | ||
|
||
generator client2 { | ||
provider = "prisma-client-js" | ||
previewFeatures = ["filterJson"] | ||
output = "./client-nonapi" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = "postgres://postgres:prisma@localhost:5435/postgres" | ||
} | ||
|
||
model Album { | ||
AlbumId Int @id | ||
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 | ||
Name String? @db.VarChar(120) | ||
Album Album[] | ||
} | ||
|
||
model Customer { | ||
CustomerId Int @id | ||
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 | ||
LastName String @db.VarChar(20) | ||
FirstName String @db.VarChar(20) | ||
Title String? @db.VarChar(30) | ||
ReportsTo Int? | ||
BirthDate DateTime? @db.Timestamp(6) | ||
HireDate DateTime? @db.Timestamp(6) | ||
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 | ||
Name String? @db.VarChar(120) | ||
Track Track[] | ||
} | ||
|
||
model Invoice { | ||
InvoiceId Int @id | ||
CustomerId Int | ||
InvoiceDate DateTime @db.Timestamp(6) | ||
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 | ||
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 | ||
Name String? @db.VarChar(120) | ||
Track Track[] | ||
} | ||
|
||
model Playlist { | ||
PlaylistId Int @id | ||
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 | ||
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") | ||
} |