homelog/container/migrations/0001_initial.py

55 lines
3.0 KiB
Python
Raw Normal View History

2022-03-09 17:13:09 +00:00
# Generated by Django 3.2.12 on 2022-03-09 14:12
import container.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
2022-04-13 13:40:57 +00:00
import homelog
2022-03-09 17:13:09 +00:00
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='ContainerType',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('named_id', models.CharField(max_length=40, unique=True)),
('description', models.CharField(max_length=200)),
('width', models.IntegerField(verbose_name='width in mm')),
('height', models.IntegerField(verbose_name='height in mm')),
('length', models.IntegerField(verbose_name='length in mm')),
('inner_width', models.IntegerField(verbose_name='inner width in mm')),
('inner_height', models.IntegerField(verbose_name='inner height in mm')),
('inner_length', models.IntegerField(verbose_name='inner length in mm')),
('has_cover', models.BooleanField(verbose_name='container has a cover')),
('contains_container', models.BooleanField(verbose_name='container can bear container')),
('created_date', models.DateTimeField(verbose_name='datetime created')),
('changed_date', models.DateTimeField(verbose_name='datetime updated')),
2022-04-13 13:40:57 +00:00
('changed_by', models.ForeignKey(on_delete=models.SET(homelog.system_user.get_deleted_user), related_name='changed_container_types', to=settings.AUTH_USER_MODEL)),
('created_by', models.ForeignKey(on_delete=models.SET(homelog.system_user.get_deleted_user), related_name='created_container_types', to=settings.AUTH_USER_MODEL)),
2022-03-09 17:13:09 +00:00
],
),
migrations.CreateModel(
name='Container',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('named_id', models.CharField(max_length=40)),
('color', models.CharField(max_length=60)),
('description', models.CharField(max_length=200)),
('created_date', models.DateTimeField(verbose_name='datetime created')),
('changed_date', models.DateTimeField(verbose_name='datetime updated')),
2022-04-13 13:40:57 +00:00
('changed_by', models.ForeignKey(on_delete=models.SET(homelog.system_user.get_deleted_user), related_name='changed_container', to=settings.AUTH_USER_MODEL)),
2022-03-09 17:13:09 +00:00
('container_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='container.containertype')),
2022-04-13 13:40:57 +00:00
('created_by', models.ForeignKey(on_delete=models.SET(homelog.system_user.get_deleted_user), related_name='created_container', to=settings.AUTH_USER_MODEL)),
2022-03-09 17:13:09 +00:00
],
),
]