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

159 lines
5.2 KiB
Python
Raw Permalink Normal View History

2024-10-10 10:40:52 +00:00
# Generated by Django 5.0.6 on 2024-10-10 10:35
2024-07-09 11:35:35 +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 = [
2024-10-10 10:28:03 +00:00
("user", "0001_initial"),
2024-07-09 11:35:35 +00:00
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
2024-07-30 11:37:08 +00:00
name="Lot",
2024-07-09 11:35:35 +00:00
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
2024-07-30 11:37:08 +00:00
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
("name", models.CharField(blank=True, max_length=64, null=True)),
("code", models.CharField(blank=True, max_length=64, null=True)),
("description", models.CharField(blank=True, max_length=64, null=True)),
("closed", models.BooleanField(default=True)),
2024-07-09 11:35:35 +00:00
(
2024-07-18 15:21:22 +00:00
"owner",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
2024-10-10 10:28:03 +00:00
to="user.institution",
),
),
(
"user",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
2024-07-18 15:21:22 +00:00
to=settings.AUTH_USER_MODEL,
2024-07-09 11:35:35 +00:00
),
),
2024-07-18 15:21:22 +00:00
],
),
migrations.CreateModel(
2024-07-30 11:37:08 +00:00
name="DeviceLot",
2024-07-18 15:21:22 +00:00
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
2024-07-30 11:37:08 +00:00
("device_id", models.CharField(max_length=256)),
2024-07-09 11:35:35 +00:00
(
2024-07-30 11:37:08 +00:00
"lot",
2024-07-09 11:35:35 +00:00
models.ForeignKey(
2024-07-30 11:37:08 +00:00
on_delete=django.db.models.deletion.CASCADE, to="lot.lot"
2024-07-09 11:35:35 +00:00
),
),
2024-07-30 11:37:08 +00:00
],
),
2024-10-10 10:28:03 +00:00
migrations.CreateModel(
name="LotAnnotation",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created", models.DateTimeField(auto_now_add=True)),
(
"type",
models.SmallIntegerField(
choices=[(0, "System"), (1, "User"), (2, "Document")]
),
),
("key", models.CharField(max_length=256)),
("value", models.CharField(max_length=256)),
(
"lot",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="lot.lot"
),
),
(
"owner",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="user.institution",
),
),
(
"user",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to=settings.AUTH_USER_MODEL,
),
),
],
),
2024-07-30 11:37:08 +00:00
migrations.CreateModel(
name="LotTag",
fields=[
2024-07-18 15:21:22 +00:00
(
2024-07-30 11:37:08 +00:00
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(max_length=64)),
(
"owner",
2024-07-18 15:21:22 +00:00
models.ForeignKey(
2024-07-30 11:37:08 +00:00
on_delete=django.db.models.deletion.CASCADE,
2024-10-10 10:28:03 +00:00
to="user.institution",
),
),
(
"user",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
2024-07-30 11:37:08 +00:00
to=settings.AUTH_USER_MODEL,
2024-07-18 15:21:22 +00:00
),
),
2024-07-09 11:35:35 +00:00
],
),
2024-07-30 11:37:08 +00:00
migrations.AddField(
model_name="lot",
name="type",
field=models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="lot.lottag"
),
),
2024-07-09 11:35:35 +00:00
]