devicehub-django/evidence/migrations/0001_initial.py

65 lines
2.0 KiB
Python
Raw Normal View History

2024-10-10 10:28:03 +00:00
# Generated by Django 5.0.6 on 2024-10-10 09:46
2024-06-12 07:32:49 +00:00
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("user", "0001_initial"),
2024-06-12 07:32:49 +00:00
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
2024-07-18 15:21:22 +00:00
name="Annotation",
2024-06-12 07:32:49 +00:00
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created", models.DateTimeField(auto_now_add=True)),
("uuid", models.UUIDField()),
(
2024-07-18 15:21:22 +00:00
"type",
models.SmallIntegerField(
choices=[(0, "System"), (1, "User"), (2, "Document")]
),
2024-06-12 07:32:49 +00:00
),
2024-07-18 15:21:22 +00:00
("key", models.CharField(max_length=256)),
("value", models.CharField(max_length=256)),
2024-06-12 07:32:49 +00:00
(
"owner",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="user.institution",
),
),
(
"user",
2024-06-12 07:32:49 +00:00
models.ForeignKey(
2024-10-07 14:56:58 +00:00
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
2024-06-12 07:32:49 +00:00
to=settings.AUTH_USER_MODEL,
),
),
],
),
2024-07-18 15:21:22 +00:00
migrations.AddConstraint(
model_name="annotation",
constraint=models.UniqueConstraint(
fields=("type", "key", "uuid"), name="unique_type_key_uuid"
),
),
2024-06-12 07:32:49 +00:00
]