Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PB138 - Film Database Group Project
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tomáš Havlíček
PB138 - Film Database Group Project
Commits
d21b4de2
There was an error fetching the commit references. Please try again later.
Commit
d21b4de2
authored
2 years ago
by
Lukáš Kratochvíl
Browse files
Options
Downloads
Patches
Plain Diff
feat: created Prisma schema
parent
c5f36bf5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
backend/prisma/schema.prisma
+46
-0
46 additions, 0 deletions
backend/prisma/schema.prisma
with
46 additions
and
0 deletions
backend/prisma/schema.prisma
+
46
−
0
View file @
d21b4de2
...
...
@@ -9,3 +9,49 @@ datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Movie {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
deletedAt DateTime?
name String
originalName String
intro String
picture String?
publishedAt DateTime
runTimeMinutes Int
director Director @relation(fields: [directorId], references: [id])
directorId String
categories Category[] @relation(name: "MovieCategory")
@@unique([originalName, publishedAt, directorId])
}
model Director {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
deletedAt DateTime?
name String
surname String
birthDate DateTime?
movies Movie[]
@@unique([name, surname, birthDate])
}
model Category {
id String @id @default(uuid())
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
deletedAt DateTime?
name String @unique
movies Movie[] @relation(name: "MovieCategory")
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment