[collector] create initial model and migration
This commit is contained in:
parent
8cc5d405b4
commit
67bb3e0777
3 changed files with 56 additions and 0 deletions
15
collector/models.py
Normal file
15
collector/models.py
Normal file
|
|
@ -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"),
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue