wip: reconstruct bulk insert video service

This commit is contained in:
2026-07-02 22:40:33 +07:00
parent 9cfb793e59
commit a46b465409
8 changed files with 55 additions and 199 deletions

View File

@ -538,8 +538,9 @@ Table episodes {
Table videos {
id String [pk]
service video_services [not null]
video_service video_services [not null]
episode episodes [not null]
priority Int
video_code String [not null]
short_code String
thumbnail_code String
@ -551,6 +552,11 @@ Table videos {
media_id String [not null]
created_by_id String [not null]
video_submission video_submissions
video_service_id String [not null]
indexes {
(media_id, episode_number, priority) [unique]
}
}
Table video_submissions {
@ -695,11 +701,6 @@ Table home_media_banners {
created_by_id String [not null]
}
Table VideoToVideoService {
serviceId String [ref: > video_services.id]
videosId String [ref: > videos.id]
}
Enum user_role {
user
contributor
@ -887,6 +888,8 @@ Ref: episodes.created_by_id > users.id
Ref: episodes.media_id > medias.id
Ref: videos.video_service_id > video_services.id
Ref: videos.(episode_number, media_id) > episodes.(episode_number, media_id)
Ref: video_submissions.created_by_id > users.id

View File

@ -690,7 +690,7 @@ model Episode {
model Video {
id String @id @default(uuid(7)) @db.Uuid
video_service VideoService @relation(fields: [videoServiceId], references: [id])
video_service VideoService @relation(fields: [video_service_id], references: [id])
episode Episode @relation(fields: [episode_number, media_id], references: [episode_number, media_id])
priority Int? @db.SmallInt
video_code String @db.VarChar(255)
@ -705,7 +705,7 @@ model Video {
media_id String @db.Uuid
created_by_id String @db.Uuid
video_submission VideoSubmission?
videoServiceId String @db.Uuid
video_service_id String @db.Uuid
@@unique([media_id, episode_number, priority])
@@map("videos")