Files
ServerKit/backend/app/models
Juan DenisandClaude Opus 4.8 5d606a6030 refactor(unify): §8 Phase B1 — generalize BackupPolicy to all target types
First slice of the backups/snapshots unification. Makes the policy-driven
BackupPolicy/BackupRun system able to describe every data-protection target,
not just application/wordpress_site — the foundation for folding the legacy
BackupService (database/files) into one system.

- BackupPolicy gains target_subtype + target_meta_json (+ get/set helpers,
  surfaced in to_dict). VALID_TARGET_TYPES = application, wordpress_site,
  database, files, server.
- BackupPolicyService.validate_target_type(); get_or_create_policy() accepts
  and (idempotently) refreshes target_subtype/target_meta for non-resource
  targets like database/files.
- Migration 037 (idempotent, additive columns).

Additive only — no behavior change for existing app/WP policies.
Verified: 6 new tests + existing backup-protection suite pass (18 passed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 14:16:45 -04:00
..