feat: monitoring data model (WatchedArtist, MonitoredRelease, Request link)
This commit is contained in:
@@ -23,6 +23,12 @@ enum JobState {
|
||||
needs_attention
|
||||
}
|
||||
|
||||
enum MonitoredReleaseState {
|
||||
wanted
|
||||
grabbed
|
||||
fulfilled
|
||||
}
|
||||
|
||||
model Request {
|
||||
id String @id @default(cuid())
|
||||
artist String
|
||||
@@ -31,6 +37,9 @@ model Request {
|
||||
createdAt DateTime @default(now())
|
||||
job Job?
|
||||
libraryItem LibraryItem?
|
||||
|
||||
monitoredReleaseId String?
|
||||
monitoredRelease MonitoredRelease? @relation(fields: [monitoredReleaseId], references: [id], onDelete: SetNull)
|
||||
}
|
||||
|
||||
model Job {
|
||||
@@ -82,3 +91,34 @@ model Config {
|
||||
secret Boolean @default(false)
|
||||
updatedAt DateTime @updatedAt
|
||||
}
|
||||
|
||||
model WatchedArtist {
|
||||
id String @id @default(cuid())
|
||||
mbid String @unique
|
||||
name String
|
||||
autoMonitorFuture Boolean @default(false)
|
||||
monitorFrom DateTime @default(now())
|
||||
lastPolledAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
releases MonitoredRelease[]
|
||||
}
|
||||
|
||||
model MonitoredRelease {
|
||||
id String @id @default(cuid())
|
||||
watchedArtist WatchedArtist? @relation(fields: [watchedArtistId], references: [id], onDelete: Cascade)
|
||||
watchedArtistId String?
|
||||
artistMbid String
|
||||
artistName String
|
||||
rgMbid String @unique
|
||||
album String
|
||||
primaryType String?
|
||||
secondaryTypes String[]
|
||||
firstReleaseDate String?
|
||||
monitored Boolean @default(false)
|
||||
state MonitoredReleaseState @default(wanted)
|
||||
currentQualityClass Int?
|
||||
firstGrabbedAt DateTime?
|
||||
lastSearchedAt DateTime?
|
||||
createdAt DateTime @default(now())
|
||||
requests Request[]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user