Add snapshots

This commit is contained in:
Edgar P. Burkhart 2022-05-21 21:00:26 +02:00
parent 52eade1159
commit 29484e3c02
Signed by: edpibu
GPG key ID: 9833D3C5A25BD227
4 changed files with 120 additions and 1 deletions

View file

@ -0,0 +1,44 @@
# Generated by Django 4.0.4 on 2022-05-21 18:40
import datetime
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
("main", "0008_alter_category_options_category_icon"),
]
operations = [
migrations.CreateModel(
name="Snapshot",
fields=[
(
"id",
models.UUIDField(
default=uuid.uuid4,
editable=False,
primary_key=True,
serialize=False,
),
),
("date", models.DateField(default=datetime.date.today)),
(
"value",
models.DecimalField(decimal_places=2, default=0, max_digits=12),
),
(
"previous",
models.OneToOneField(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="main.snapshot",
),
),
],
),
]

View file

@ -0,0 +1,25 @@
# Generated by Django 4.0.4 on 2022-05-21 18:44
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("main", "0009_snapshot"),
]
operations = [
migrations.AlterField(
model_name="snapshot",
name="previous",
field=models.OneToOneField(
blank=True,
editable=False,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="main.snapshot",
),
),
]