Make proxmox_storage a global setting instead of a per-job snapshot
Backup jobs stored their own proxmox_storage column, copied from settings at creation time and never resynced. process_backup preferred that frozen job value, so changing Settings > Proxmox storage had no effect on existing jobs. Drop the per-job column and always use the current global setting when starting a backup. Also copies AGENTS.md to CLAUDE.md.
This commit is contained in:
+3
-5
@@ -51,10 +51,10 @@ def create_job(payload: dict) -> dict:
|
||||
"""
|
||||
INSERT INTO backup_jobs(
|
||||
guest_vmid, guest_name, guest_type, node, enabled, cron_schedule,
|
||||
proxmox_storage, backup_mode, compression, retention_type, retention_value,
|
||||
backup_mode, compression, retention_type, retention_value,
|
||||
next_run_at, created_at, updated_at
|
||||
)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
""",
|
||||
(
|
||||
payload["guest_vmid"],
|
||||
@@ -63,7 +63,6 @@ def create_job(payload: dict) -> dict:
|
||||
payload["node"],
|
||||
int(payload.get("enabled", True)),
|
||||
payload["cron_schedule"],
|
||||
payload["proxmox_storage"],
|
||||
payload["backup_mode"],
|
||||
payload["compression"],
|
||||
payload["retention_type"],
|
||||
@@ -88,7 +87,7 @@ def update_job(job_id: int, payload: dict) -> dict:
|
||||
"""
|
||||
UPDATE backup_jobs SET
|
||||
guest_vmid = ?, guest_name = ?, guest_type = ?, node = ?, enabled = ?,
|
||||
cron_schedule = ?, proxmox_storage = ?, backup_mode = ?, compression = ?,
|
||||
cron_schedule = ?, backup_mode = ?, compression = ?,
|
||||
retention_type = ?, retention_value = ?, next_run_at = ?, updated_at = ?
|
||||
WHERE id = ?
|
||||
""",
|
||||
@@ -99,7 +98,6 @@ def update_job(job_id: int, payload: dict) -> dict:
|
||||
merged["node"],
|
||||
int(merged["enabled"]),
|
||||
merged["cron_schedule"],
|
||||
merged["proxmox_storage"],
|
||||
merged["backup_mode"],
|
||||
merged["compression"],
|
||||
merged["retention_type"],
|
||||
|
||||
Reference in New Issue
Block a user