# Generated by Django 3.0 on 2020-11-03 13:07

from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ('restaurant_entities', '0003_menuitem'),
    ]

    operations = [
        migrations.CreateModel(
            name='Allergen',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, help_text='Unique global identifier', unique=True, verbose_name='Global ID')),
                ('number', models.PositiveIntegerField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, help_text='Unique global identifier', unique=True, verbose_name='Global ID')),
                ('internal_name', models.CharField(max_length=255)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Language',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, help_text='Unique global identifier', unique=True, verbose_name='Global ID')),
                ('name', models.CharField(max_length=100)),
                ('code', models.CharField(max_length=3)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='menuitem',
            name='internal_name',
            field=models.CharField(default=0, max_length=255),
            preserve_default=False,
        ),
        migrations.CreateModel(
            name='MenuItemTranslation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, help_text='Unique global identifier', unique=True, verbose_name='Global ID')),
                ('name', models.CharField(max_length=255)),
                ('description', models.TextField()),
                ('quantity', models.CharField(max_length=50)),
                ('language', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='restaurant_entities.Language')),
                ('menu_item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='restaurant_entities.MenuItem')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='CategoryTranslation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, help_text='Unique global identifier', unique=True, verbose_name='Global ID')),
                ('name', models.CharField(max_length=255)),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='restaurant_entities.Category')),
                ('language', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='restaurant_entities.Language')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='AllergenTranslation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('gid', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, help_text='Unique global identifier', unique=True, verbose_name='Global ID')),
                ('name', models.CharField(max_length=255)),
                ('allergen', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='restaurant_entities.Allergen')),
                ('language', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='restaurant_entities.Language')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.AddField(
            model_name='menuitem',
            name='allergens',
            field=models.ManyToManyField(related_name='menu_item_allergens', to='restaurant_entities.Allergen'),
        ),
    ]
