nk20/apps/food/migrations/0001_initial.py

98 lines
5.7 KiB
Python

# Generated by Django 2.2.28 on 2024-05-25 20:32
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('member', '0011_profile_vss_charter_read'),
]
operations = [
migrations.CreateModel(
name='BasicFood',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, verbose_name='name')),
('is_DLC', models.BooleanField(default=False, verbose_name='is DLC')),
('is_DDM', models.BooleanField(default=False, verbose_name='is DDM')),
('arrival_date', models.DateTimeField(default=django.utils.timezone.now, verbose_name='arrival date')),
('expiry_date', models.DateTimeField(blank=True, null=True, verbose_name='expiry date')),
('label', models.ImageField(max_length=255, upload_to='label/', verbose_name='food label')),
('was_eaten', models.BooleanField(default=False, verbose_name='was eaten')),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='member.Club', verbose_name='owner')),
],
options={
'verbose_name': 'Basic food',
'verbose_name_plural': 'Basic foods',
},
),
migrations.CreateModel(
name='TransformedFood',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, verbose_name='name')),
('creation_date', models.DateTimeField(verbose_name='creation date')),
('expiry_date', models.DateTimeField(verbose_name='expiry date')),
('is_active', models.BooleanField(default=True, verbose_name='is active')),
('was_eaten', models.BooleanField(default=False, verbose_name='was eaten')),
('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='+', to='member.Club', verbose_name='owner')),
('transformed_ingredient', models.ManyToManyField(blank=True, related_name='transformed_ingredient_inv', to='food.TransformedFood', verbose_name='transformed ingredient')),
],
options={
'verbose_name': 'Transformed food',
'verbose_name_plural': 'Transformed foods',
},
),
migrations.CreateModel(
name='QR_code',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('qr_code_number', models.PositiveIntegerField(verbose_name='QR-code number')),
('basic_food', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='QR_code', to='food.BasicFood', verbose_name='basic food')),
('transformed_food_container', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='QR_code', to='food.TransformedFood', verbose_name='transformed food container')),
],
options={
'verbose_name': 'QR-code',
'verbose_name_plural': 'QR-codes',
},
),
migrations.AddField(
model_name='basicfood',
name='transformed_food',
field=models.ManyToManyField(blank=True, related_name='BasicFood', to='food.TransformedFood', verbose_name='transformed food'),
),
migrations.CreateModel(
name='Allergen',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('gluten', models.BooleanField(default=False, verbose_name='gluten')),
('nut', models.BooleanField(default=False, verbose_name='nut')),
('crustecean', models.BooleanField(default=False, verbose_name='crustacean')),
('celery', models.BooleanField(default=False, verbose_name='celery')),
('egg', models.BooleanField(default=False, verbose_name='egg')),
('mustard', models.BooleanField(default=False, verbose_name='mustard')),
('fish', models.BooleanField(default=False, verbose_name='fish')),
('soy', models.BooleanField(default=False, verbose_name='soy')),
('milk', models.BooleanField(default=False, verbose_name='milk')),
('sulphite', models.BooleanField(default=False, verbose_name='sulphite')),
('lupine', models.BooleanField(default=False, verbose_name='lupine')),
('mollusc', models.BooleanField(default=False, verbose_name='mollusc')),
('groundnut', models.BooleanField(default=False, verbose_name='groundnut')),
('sesame', models.BooleanField(default=False, verbose_name='sesame')),
('alcohol', models.BooleanField(default=False, verbose_name='alcohol')),
('basic_food', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Allergen', to='food.BasicFood', verbose_name='basic food')),
('transformed_food', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='Allergen', to='food.TransformedFood', verbose_name='transformed food')),
],
options={
'verbose_name': 'Allergen',
'verbose_name_plural': 'Allergens',
},
),
]