feat: link backup runs to snapshot records
Add a nullable SnapshotRecord foreign key to BackupRun and populate it when run_pobsync_backup records a completed or failed snapshot. Keep the existing snapshot_path for audit compatibility while making run-to-snapshot navigation explicit in the database and admin.
This commit is contained in:
@@ -50,9 +50,10 @@ class HostConfigAdmin(admin.ModelAdmin):
|
||||
|
||||
@admin.register(BackupRun)
|
||||
class BackupRunAdmin(admin.ModelAdmin):
|
||||
list_display = ("host", "run_type", "status", "started_at", "ended_at", "snapshot_path")
|
||||
list_display = ("host", "run_type", "status", "started_at", "ended_at", "snapshot")
|
||||
list_filter = ("run_type", "status", "started_at")
|
||||
search_fields = ("host__host", "snapshot_path")
|
||||
search_fields = ("host__host", "snapshot_path", "snapshot__dirname", "snapshot__path")
|
||||
autocomplete_fields = ("snapshot",)
|
||||
|
||||
|
||||
@admin.register(SnapshotRecord)
|
||||
|
||||
Reference in New Issue
Block a user