feat: Initial (and naive) ArchiveResult model

This commit is contained in:
Cristian 2020-11-03 09:54:02 -05:00
parent 4bdda4d753
commit 8f3c03a0f9
2 changed files with 37 additions and 0 deletions

View file

@ -0,0 +1,27 @@
# Generated by Django 3.0.8 on 2020-11-03 14:52
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0006_auto_20201012_1520'),
]
operations = [
migrations.CreateModel(
name='ArchiveResult',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('cmd', models.CharField(default='', max_length=500)),
('pwd', models.CharField(default='', max_length=200)),
('cmd_version', models.CharField(default='', max_length=20)),
('output', models.CharField(default='', max_length=500)),
('start_ts', models.DateTimeField()),
('end_ts', models.DateTimeField()),
('snapshot', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Snapshot')),
],
),
]

View file

@ -148,3 +148,13 @@ class Snapshot(models.Model):
tags_id.append(Tag.objects.get_or_create(name=tag)[0].id)
self.tags.clear()
self.tags.add(*tags_id)
class ArchiveResult(models.Model):
snapshot = models.ForeignKey(Snapshot, on_delete=models.CASCADE)
cmd = models.CharField(max_length=500, default="")
pwd = models.CharField(max_length=200, default="")
cmd_version = models.CharField(max_length=20, default="")
output = models.CharField(max_length=500, default="")
start_ts = models.DateTimeField()
end_ts = models.DateTimeField()