devicehub-django/snapshot/migrations/0001_initial.py
Cayo Puigdefabregas b1440fddfa new structure
2024-07-18 17:21:22 +02:00

60 lines
1.8 KiB
Python

# Generated by Django 5.0.6 on 2024-07-17 14:57
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
("device", "0001_initial"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="Annotation",
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()),
(
"type",
models.SmallIntegerField(choices=[(0, "System"), (1, "User")]),
),
("key", models.CharField(max_length=256)),
("value", models.CharField(max_length=256)),
(
"device",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="device.device"
),
),
(
"owner",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.AddConstraint(
model_name="annotation",
constraint=models.UniqueConstraint(
fields=("type", "key", "uuid"), name="unique_type_key_uuid"
),
),
]