-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(feat): Add basic schemas for database
- Loading branch information
1 parent
2abb199
commit 339552f
Showing
16 changed files
with
230 additions
and
12 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -79,6 +79,6 @@ | |
] | ||
}, | ||
"prisma": { | ||
"schema": "src/database/schema.prisma" | ||
"schema": "prisma/schema.prisma" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,7 +1,117 @@ | ||
//🧩Don't Edit this file.✨Generated in Tue Apr 09 2024 20:47:08 GMT+0200 (Central European Summer Time)✨ | ||
//🧩Don't Edit this file.✨Generated in Tue Apr 09 2024 21:19:58 GMT+0200 (Central European Summer Time)✨ | ||
model Account { | ||
id Int @id @default(autoincrement()) | ||
streamingService String | ||
username String @unique | ||
password String | ||
user User @relation(fields: [userId], references: [id]) | ||
userId Int | ||
subscriptionOffers SubscriptionOffer[] | ||
} | ||
|
||
model Actor { | ||
actorId Int @id @default(autoincrement()) | ||
firstName String | ||
lastName String | ||
birthDate DateTime? | ||
movies Movie[] @relation("ParticipatesIn") | ||
} | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "postgresql" | ||
url = env("DATABASE_URL") | ||
} | ||
|
||
model Language { | ||
id Int @id @default(autoincrement()) | ||
name String | ||
streamingAvailabilities StreamingAvailability[] | ||
movieTitles MovieTitle[] | ||
subtitles Subtitle[] | ||
} | ||
|
||
model Movie { | ||
id Int @id @default(autoincrement()) | ||
title String | ||
director String | ||
createdAt DateTime @default(now()) | ||
id Int @id @default(autoincrement()) | ||
director String | ||
genre String | ||
duration Int | ||
releaseDate DateTime | ||
movieTitle MovieTitle[] | ||
subtitles Subtitle[] | ||
ratings Rating[] | ||
streamingDetails StreamingAvailability[] | ||
actors Actor[] @relation("ParticipatesIn") | ||
} | ||
|
||
model MovieTitle { | ||
movieTitleId Int @id @default(autoincrement()) | ||
movieId Int | ||
languageId Int | ||
title String | ||
Movie Movie @relation(fields: [movieId], references: [id]) | ||
Language Language @relation(fields: [languageId], references: [id]) | ||
} | ||
|
||
model Rating { | ||
ratingId Int @id @default(autoincrement()) | ||
movieId Int | ||
site String | ||
rating Float | ||
link String? | ||
Movie Movie @relation(fields: [movieId], references: [id]) | ||
} | ||
|
||
model StreamingAvailability { | ||
streamingId Int @id @default(autoincrement()) | ||
movieId Int | ||
currentAvailability Boolean | ||
whenBecomesAvailable DateTime? | ||
whenExpires DateTime? | ||
languages Language[] | ||
deepLink String? | ||
Movie Movie @relation(fields: [movieId], references: [id]) | ||
StreamingService StreamingService[] | ||
} | ||
|
||
model StreamingService { | ||
companyId Int @id @default(autoincrement()) | ||
companyName String | ||
subscriptionOffers SubscriptionOffer[] | ||
streamingAvailabilities StreamingAvailability[] | ||
} | ||
|
||
model SubscriptionOffer { | ||
subscriptionId Int @id @default(autoincrement()) | ||
companyId Int | ||
accountId Int | ||
cost Float | ||
active Boolean | ||
StreamingService StreamingService @relation(fields: [companyId], references: [companyId]) | ||
Account Account @relation(fields: [accountId], references: [id]) | ||
} | ||
|
||
model Subtitle { | ||
languageId Int | ||
movieId Int | ||
Language Language @relation(fields: [languageId], references: [id]) | ||
Movie Movie @relation(fields: [movieId], references: [id]) | ||
@@id([languageId, movieId]) | ||
} | ||
|
||
model User { | ||
id Int @id @default(autoincrement()) | ||
watchLists Watchlist[] | ||
accounts Account[] | ||
} | ||
|
||
model Watchlist { | ||
watchlistId Int @id @default(autoincrement()) | ||
userId Int | ||
name String | ||
User User @relation(fields: [userId], references: [id]) | ||
} |
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,9 @@ | ||
model Account { | ||
id Int @id @default(autoincrement()) | ||
streamingService String | ||
username String @unique | ||
password String | ||
user User @relation(fields: [userId], references: [id]) | ||
userId Int | ||
subscriptionOffers SubscriptionOffer[] | ||
} |
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,7 @@ | ||
model Actor { | ||
actorId Int @id @default(autoincrement()) | ||
firstName String | ||
lastName String | ||
birthDate DateTime? | ||
movies Movie[] @relation("ParticipatesIn") | ||
} |
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,17 @@ | ||
//////////////////////////////////////////////////////////////////////////////////////// | ||
///// Auto Commented Out by 🅿🆁🅸🆂🅼🅰-🅼🆄🅻🆃🅸🆂🅲🅷🅴🅼🅰 //////// | ||
///// Detected : Datasource and Generator Client //////// | ||
///// You can change this files content is commented or Uncommented Stage. //////// | ||
///// It will take effect after you run npx prisma-multischema //////// | ||
///// Feel free to change Datasource/ Database URL / Provider / Binary Targets //////// | ||
///// DO NOT EDIT in this comment box //////// | ||
///// CHANGE ONLY BELOW THIS LINE. //////// | ||
///////////////////////////////////////////////////////////////////////////////////////// | ||
|
||
//generator client { | ||
//provider = "prisma-client-js" | ||
//} | ||
//datasource db { | ||
//provider = "postgresql" | ||
//url = env("DATABASE_URL") | ||
//} |
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,7 @@ | ||
model Language { | ||
id Int @id @default(autoincrement()) | ||
name String | ||
streamingAvailabilities StreamingAvailability[] | ||
movieTitles MovieTitle[] | ||
subtitles Subtitle[] | ||
} |
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,12 @@ | ||
model Movie { | ||
id Int @id @default(autoincrement()) | ||
director String | ||
genre String | ||
duration Int | ||
releaseDate DateTime | ||
movieTitle MovieTitle[] | ||
subtitles Subtitle[] | ||
ratings Rating[] | ||
streamingDetails StreamingAvailability[] | ||
actors Actor[] @relation("ParticipatesIn") | ||
} |
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,8 @@ | ||
model MovieTitle { | ||
movieTitleId Int @id @default(autoincrement()) | ||
movieId Int | ||
languageId Int | ||
title String | ||
Movie Movie @relation(fields: [movieId], references: [id]) | ||
Language Language @relation(fields: [languageId], references: [id]) | ||
} |
This file was deleted.
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,9 @@ | ||
|
||
model Rating { | ||
ratingId Int @id @default(autoincrement()) | ||
movieId Int | ||
site String | ||
rating Float | ||
link String? | ||
Movie Movie @relation(fields: [movieId], references: [id]) | ||
} |
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,11 @@ | ||
model StreamingAvailability { | ||
streamingId Int @id @default(autoincrement()) | ||
movieId Int | ||
currentAvailability Boolean | ||
whenBecomesAvailable DateTime? | ||
whenExpires DateTime? | ||
languages Language[] | ||
deepLink String? | ||
Movie Movie @relation(fields: [movieId], references: [id]) | ||
StreamingService StreamingService[] | ||
} |
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,6 @@ | ||
model StreamingService { | ||
companyId Int @id @default(autoincrement()) | ||
companyName String | ||
subscriptionOffers SubscriptionOffer[] | ||
streamingAvailabilities StreamingAvailability[] | ||
} |
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,9 @@ | ||
model SubscriptionOffer { | ||
subscriptionId Int @id @default(autoincrement()) | ||
companyId Int | ||
accountId Int | ||
cost Float | ||
active Boolean | ||
StreamingService StreamingService @relation(fields: [companyId], references: [companyId]) | ||
Account Account @relation(fields: [accountId], references: [id]) | ||
} |
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,8 @@ | ||
model Subtitle { | ||
languageId Int | ||
movieId Int | ||
Language Language @relation(fields: [languageId], references: [id]) | ||
Movie Movie @relation(fields: [movieId], references: [id]) | ||
@@id([languageId, movieId]) | ||
} |
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,5 @@ | ||
model User { | ||
id Int @id @default(autoincrement()) | ||
watchLists Watchlist[] | ||
accounts Account[] | ||
} |
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,6 @@ | ||
model Watchlist { | ||
watchlistId Int @id @default(autoincrement()) | ||
userId Int | ||
name String | ||
User User @relation(fields: [userId], references: [id]) | ||
} |