# Generated by Django 4.0.3 on 2022-06-11 14:05

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import receipe.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Allergenes',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='allergene name')),
            ],
        ),
        migrations.CreateModel(
            name='Article',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='article name')),
                ('EAN', receipe.models.CharNullField(blank=True, max_length=50, null=True, unique=True, verbose_name='EAN')),
                ('offlink', models.URLField(blank=True, null=True, verbose_name='Open Food Fact link')),
                ('quantityPerPackage', models.PositiveIntegerField(blank=True, null=True, verbose_name='quantity per packages')),
                ('unit', receipe.models.CharNullField(blank=True, max_length=2, null=True, verbose_name='unit')),
                ('novaGroup', models.PositiveIntegerField(blank=True, null=True, verbose_name='NOVA group')),
                ('nutritionGrade', models.CharField(blank=True, max_length=1, null=True, verbose_name='nutri grade')),
                ('MwSt', models.PositiveIntegerField(blank=True, null=True, verbose_name='taxes')),
                ('created', models.DateTimeField(db_index=True, default=django.utils.timezone.now, verbose_name='created')),
                ('modified', models.DateTimeField(auto_now=True, db_index=True, verbose_name='modified')),
                ('nutritionImage', models.FilePathField(default=None, editable=False, help_text='Nutrition image filename in storage', max_length=1024, null=True, unique=True, verbose_name='nutriton image filepath')),
                ('ingredientsImage', models.FilePathField(default=None, editable=False, help_text='Ingredients image filename in storage', max_length=1024, null=True, unique=True, verbose_name='ingredients image filepath')),
                ('frontImage', models.FilePathField(default=None, editable=False, help_text='Front image filename in storage', max_length=1024, null=True, unique=True, verbose_name='front image filepath')),
                ('allergenes', models.ManyToManyField(blank=True, to='receipe.allergenes')),
            ],
        ),
        migrations.CreateModel(
            name='Brand',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='brand name')),
            ],
        ),
        migrations.CreateModel(
            name='EMBs',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='emb name')),
            ],
        ),
        migrations.CreateModel(
            name='Ingredients',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='ingredient name')),
            ],
        ),
        migrations.CreateModel(
            name='Labels',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='label name')),
            ],
        ),
        migrations.CreateModel(
            name='ManufacturingPlaces',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='manufacturing places name')),
            ],
        ),
        migrations.CreateModel(
            name='OriginIngredients',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='origin of igredients')),
            ],
        ),
        migrations.CreateModel(
            name='Packaging',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='packaging name')),
            ],
        ),
        migrations.CreateModel(
            name='ReceipeImage',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('checksum', models.CharField(editable=False, help_text='The checksum of the original image.', max_length=32, unique=True, verbose_name='checksum')),
                ('thrashed_checksum', models.CharField(editable=False, help_text='The checksum of the thrashed image.', max_length=32, unique=True, verbose_name='threshed checksum')),
                ('filename', models.FilePathField(default=None, editable=False, help_text='Current filename in storage', max_length=1024, null=True, unique=True, verbose_name='filename')),
                ('filename_trashed', models.FilePathField(default=None, editable=False, help_text='Current filename of the modified picture in storage', max_length=1024, null=True, unique=True, verbose_name='filename trashed')),
                ('created', models.DateTimeField(db_index=True, default=django.utils.timezone.now, verbose_name='created')),
                ('modified', models.DateTimeField(auto_now=True, db_index=True, verbose_name='modified')),
                ('added', models.DateTimeField(db_index=True, default=django.utils.timezone.now, editable=False, verbose_name='added')),
            ],
        ),
        migrations.CreateModel(
            name='Traces',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='trace name')),
            ],
        ),
        migrations.CreateModel(
            name='NutritionalValues',
            fields=[
                ('article', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='receipe.article')),
                ('energy', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='energy')),
                ('energyUnit', models.CharField(max_length=2)),
                ('fat', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='fat')),
                ('fatUnit', models.CharField(max_length=2)),
                ('saturatedFat', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='saturatedFat')),
                ('saturatedFatUnit', models.CharField(max_length=2)),
                ('carbohydrate', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='carbohydrate')),
                ('carbohydrateUnit', models.CharField(max_length=2)),
                ('sugars', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='sugars')),
                ('sugarsUnit', models.CharField(max_length=2)),
                ('dietaryFiber', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='dietaryFiber')),
                ('dietaryFiberUnit', models.CharField(max_length=2)),
                ('proteins', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='proteins')),
                ('proteinsUnit', models.CharField(max_length=2)),
                ('salt', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='salt')),
                ('saltUnit', models.CharField(max_length=2)),
                ('sodium', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='sodium')),
                ('sodiumUnit', models.CharField(max_length=2)),
                ('vitamin_a', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_a')),
                ('vitamin_aUnit', models.CharField(max_length=2)),
                ('vitamin_b1', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_b1')),
                ('vitamin_b1mUnit', models.CharField(max_length=2)),
                ('vitamin_b2', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_b2')),
                ('vitamin_b2Unit', models.CharField(max_length=2)),
                ('vitamin_b3', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_b3')),
                ('vitamin_b3Unit', models.CharField(max_length=2)),
                ('vitamin_b5', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_b5')),
                ('vitamin_b5Unit', models.CharField(max_length=2)),
                ('vitamin_b7', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_b7')),
                ('vitamin_b7Unit', models.CharField(max_length=2)),
                ('vitamin_b9', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_b9')),
                ('vitamin_b9Unit', models.CharField(max_length=2)),
                ('vitamin_b12', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_b12')),
                ('vitamin_b12Unit', models.CharField(max_length=2)),
                ('vitamin_c', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_c')),
                ('vitamin_cUnit', models.CharField(max_length=2)),
                ('vitamin_d', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_d')),
                ('vitamin_dUnit', models.CharField(max_length=2)),
                ('vitamin_e', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_e')),
                ('vitamin_eUnit', models.CharField(max_length=2)),
                ('vitamin_k', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='vitamin_k')),
                ('vitamin_kUnit', models.CharField(max_length=2)),
                ('potassium', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='potassium')),
                ('potassiumUnit', models.CharField(max_length=2)),
                ('calcium', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='calcium')),
                ('calciumUnit', models.CharField(max_length=2)),
                ('magnesium', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='magnesium')),
                ('magnesiumUnit', models.CharField(max_length=2)),
                ('iron', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='iron')),
                ('ironUnit', models.CharField(max_length=2)),
                ('zinc', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='zinc')),
                ('zincUnit', models.CharField(max_length=2)),
                ('sulfat', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='sulfat')),
                ('sulfatUnit', models.CharField(max_length=2)),
                ('chlorid', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='chlorid')),
                ('chloridUnit', models.CharField(max_length=2)),
                ('hydrogencarbonat', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='hydrogencarbonat')),
                ('hydrogencarbonatUnit', models.CharField(max_length=2)),
            ],
        ),
        migrations.CreateModel(
            name='Purchase',
            fields=[
                ('purchase_date', models.DateField(verbose_name='purchase date')),
                ('payment_type', models.CharField(default='EC', max_length=10, verbose_name='payment type')),
                ('total_price', models.DecimalField(decimal_places=2, default=0, max_digits=7, verbose_name='total price')),
                ('created', models.DateTimeField(db_index=True, default=django.utils.timezone.now, verbose_name='created')),
                ('modified', models.DateTimeField(auto_now=True, db_index=True, verbose_name='modified')),
                ('receipeImage', models.OneToOneField(blank=True, on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='receipe.receipeimage')),
            ],
        ),
        migrations.CreateModel(
            name='PackagingArticle',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('weight', models.PositiveIntegerField(verbose_name='weight')),
                ('article_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='receipe.article', verbose_name='purchase id')),
                ('packaging_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='receipe.packaging', verbose_name='article id')),
            ],
        ),
        migrations.CreateModel(
            name='Market',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, verbose_name='market name')),
                ('street', models.CharField(max_length=50, verbose_name='street name')),
                ('street_number', models.PositiveIntegerField(verbose_name='street number')),
                ('zip_code', models.CharField(max_length=5, verbose_name='zip code')),
                ('city', models.CharField(max_length=50, verbose_name='city')),
                ('phone', receipe.models.CharNullField(blank=True, max_length=50, null=True, verbose_name='phone number')),
                ('created', models.DateTimeField(db_index=True, default=django.utils.timezone.now, verbose_name='created')),
                ('modified', models.DateTimeField(auto_now=True, db_index=True, verbose_name='modified')),
                ('articles', models.ManyToManyField(blank=True, to='receipe.article')),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True, verbose_name='category name')),
                ('parent', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='receipe.category')),
            ],
        ),
        migrations.CreateModel(
            name='ArticleMaps',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('receipeString', models.CharField(max_length=50, verbose_name='receipe string')),
                ('location_x', models.PositiveIntegerField(verbose_name='x coordiante in image')),
                ('location_y', models.PositiveIntegerField(verbose_name='y coordiante in image')),
                ('location_h', models.PositiveIntegerField(verbose_name='height in image')),
                ('location_w', models.PositiveIntegerField(verbose_name='width in image')),
                ('article', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='receipe.article', verbose_name='article id')),
                ('receipeImage', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='receipe.receipeimage')),
            ],
        ),
        migrations.AddField(
            model_name='article',
            name='brand',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='receipe.brand', verbose_name='brand id'),
        ),
        migrations.AddField(
            model_name='article',
            name='category',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='receipe.category', verbose_name='category id'),
        ),
        migrations.AddField(
            model_name='article',
            name='embs',
            field=models.ManyToManyField(blank=True, to='receipe.embs'),
        ),
        migrations.AddField(
            model_name='article',
            name='ingredients',
            field=models.ManyToManyField(blank=True, to='receipe.ingredients'),
        ),
        migrations.AddField(
            model_name='article',
            name='manufacturingPlaces',
            field=models.ManyToManyField(blank=True, to='receipe.manufacturingplaces'),
        ),
        migrations.AddField(
            model_name='article',
            name='originIngredients',
            field=models.ManyToManyField(blank=True, to='receipe.originingredients'),
        ),
        migrations.AddField(
            model_name='article',
            name='packaging',
            field=models.ManyToManyField(blank=True, through='receipe.PackagingArticle', to='receipe.packaging'),
        ),
        migrations.AddField(
            model_name='article',
            name='traces',
            field=models.ManyToManyField(blank=True, to='receipe.traces'),
        ),
        migrations.CreateModel(
            name='PurchaseArticle',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.PositiveIntegerField(verbose_name='quantity')),
                ('net_weight', models.DecimalField(decimal_places=3, max_digits=7, verbose_name='net weight')),
                ('price', models.DecimalField(decimal_places=2, max_digits=7, verbose_name='price')),
                ('inSale', models.BooleanField(verbose_name='in sale')),
                ('article_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='receipe.article', verbose_name='article id')),
                ('purchase_id', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='receipe.purchase', verbose_name='purchase id')),
            ],
        ),
        migrations.AddField(
            model_name='purchase',
            name='articles',
            field=models.ManyToManyField(through='receipe.PurchaseArticle', to='receipe.article'),
        ),
        migrations.AddField(
            model_name='purchase',
            name='market',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='receipe.market', verbose_name='market id'),
        ),
    ]
