feat(db/m7-recurring-scans): migration 0019 + sqlc queries
Adds the singleton scan_schedule table holding the operator's recurring-scan config. mode is the discriminator (off/interval/ daily/weekly); CHECK constraints enforce per-mode field validity (interval_hours required for interval; time_of_day for daily and weekly; weekly_day 1..7 for weekly). Seed row is mode='off'. Two new queries: GetScanSchedule (read singleton; used by scheduler boot + admin GET) and UpdateScanSchedule (admin PATCH; application normalizes per-mode fields to NULL when mode='off').
This commit is contained in:
@@ -393,6 +393,15 @@ type ScanRun struct {
|
||||
ArtistArtEnrich []byte
|
||||
}
|
||||
|
||||
type ScanSchedule struct {
|
||||
ID bool
|
||||
Mode string
|
||||
IntervalHours *int32
|
||||
TimeOfDay *string
|
||||
WeeklyDay *int32
|
||||
UpdatedAt pgtype.Timestamptz
|
||||
}
|
||||
|
||||
type ScrobbleQueue struct {
|
||||
ID pgtype.UUID
|
||||
UserID pgtype.UUID
|
||||
|
||||
Reference in New Issue
Block a user