refactor-db #33

Merged
vivy-agent merged 42 commits from refactor-db into main 2026-05-26 21:33:21 +07:00
7 changed files with 7599 additions and 2366 deletions
Showing only changes of commit 183642805d - Show all commits

View File

@ -78,6 +78,13 @@ enum like_type {
dislike
}
enum audit_action {
delete
restore
edit
flag
}
/**
@ -125,6 +132,7 @@ model User {
reviewed_video_services VideoServiceSubmission[] @relation("VideoServiceSubmissionReviewer")
comments Comment[]
comment_likes CommentLike[]
comment_audit_logs CommentAuditLog[]
@@index([email])
@@index([username])
@@map("users")
@ -655,6 +663,7 @@ model Comment {
user_id String @db.Uuid
episode_id String @db.Uuid
likes CommentLike[]
audit_logs CommentAuditLog[]
@@map("comments")
}
@ -670,6 +679,18 @@ model CommentLike {
@@map("comment_likes")
}
model CommentAuditLog {
id String @id @db.Uuid @default(uuid(7))
comment Comment @relation(fields: [comment_id], references: [id])
performed_by User @relation(fields: [performed_by_id], references: [id])
action audit_action
created_at DateTime @default(now()) @db.Timestamptz()
comment_id String @db.Uuid
performed_by_id String @db.Uuid
@@map("comment_audit_logs")
}
/**