diff --git a/collector/migrations/0001_initial.py b/collector/migrations/0001_initial.py new file mode 100644 index 0000000..0667a7b --- /dev/null +++ b/collector/migrations/0001_initial.py @@ -0,0 +1,41 @@ +# Generated by Django 5.1.7 on 2025-03-12 21:29 + +import django_extensions.db.fields +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [] + + operations = [ + migrations.CreateModel( + name="Teile", + fields=[ + ( + "id", + models.BigAutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("name", models.TextField(verbose_name="Name of the part")), + ( + "modified", + django_extensions.db.fields.ModificationDateTimeField( + auto_now=True, verbose_name="last changed" + ), + ), + ], + options={ + "indexes": [models.Index(fields=["modified"], name="modified")], + "constraints": [ + models.UniqueConstraint(fields=("name",), name="unique_names") + ], + }, + ), + ] diff --git a/collector/migrations/__init__.py b/collector/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/collector/models.py b/collector/models.py new file mode 100644 index 0000000..bd7f6f0 --- /dev/null +++ b/collector/models.py @@ -0,0 +1,15 @@ +from django.db import models +from django_extensions.db.models import ModificationDateTimeField + + +class Teile(models.Model): + name = models.TextField("Name of the part", null=False, blank=False) + modified = ModificationDateTimeField("last changed") + + class Meta: + constraints = [ + models.UniqueConstraint(fields=["name"], name="unique_names"), + ] + indexes = [ + models.Index(fields=["modified"], name="modified"), + ]