Track snapshot base lineage in Django

This commit is contained in:
2026-05-19 11:19:22 +02:00
parent 5808800981
commit 659377d894
6 changed files with 201 additions and 5 deletions

View File

@@ -111,6 +111,17 @@ class SnapshotRecord(models.Model):
kind = models.CharField(max_length=16, choices=Kind.choices)
dirname = models.CharField(max_length=255)
path = models.CharField(max_length=1024)
base = models.ForeignKey(
"self",
on_delete=models.SET_NULL,
null=True,
blank=True,
related_name="derived_snapshots",
)
base_kind = models.CharField(max_length=16, blank=True)
base_dirname = models.CharField(max_length=255, blank=True)
base_path = models.CharField(max_length=1024, blank=True)
base_snapshot_id = models.CharField(max_length=64, blank=True)
status = models.CharField(max_length=32, blank=True)
started_at = models.DateTimeField(null=True, blank=True)
ended_at = models.DateTimeField(null=True, blank=True)