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

75 lines
2.4 KiB
Python
Raw Normal View History

2024-07-18 15:21:22 +00:00
# Generated by Django 5.0.6 on 2024-07-17 14:57
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-07-18 15:21:22 +00:00
("device", "0001_initial"),
2024-07-09 11:35:35 +00:00
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
2024-07-18 15:21:22 +00:00
name="LotTag",
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-18 15:21:22 +00:00
("name", models.CharField(max_length=64)),
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,
to=settings.AUTH_USER_MODEL,
2024-07-09 11:35:35 +00:00
),
),
2024-07-18 15:21:22 +00:00
],
),
migrations.CreateModel(
name="Lot",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("created", models.DateTimeField(auto_now_add=True)),
("updated", models.DateTimeField(auto_now=True)),
2024-07-09 11:35:35 +00:00
("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)),
("devices", models.ManyToManyField(to="device.device")),
(
"owner",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
2024-07-18 15:21:22 +00:00
(
"type",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE, to="lot.lottag"
),
),
2024-07-09 11:35:35 +00:00
],
),
]