<gh_stars>1-10
# Generated by Django 2.2 on 2019-10-08 06:26

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


class Migration(migrations.Migration):

    dependencies = [
        ('utils', '0002_auto_20190824_2234'),
        ('meals', '0002_auto_20190824_2234'),
    ]

    operations = [
        migrations.CreateModel(
            name='Ingredient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=100, unique=True)),
                ('description', models.TextField(blank=True)),
                ('slug', models.CharField(blank=True, max_length=100, null=True, unique=True)),
                ('shelf_life', models.CharField(choices=[('LO', 'Low'), ('MD', 'Medium'), ('HI', 'High')], default='HI', max_length=2)),
                ('availability', models.CharField(choices=[('LC', 'Locally'), ('EX', 'Exotic')], default='LC', max_length=2)),
            ],
            options={
                'db_table': 'ingredients',
            },
        ),
        migrations.CreateModel(
            name='Recipe',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=100, unique=True)),
                ('description', models.TextField(blank=True)),
                ('slug', models.CharField(blank=True, max_length=100, null=True, unique=True)),
                ('calories', models.PositiveIntegerField(default=0)),
                ('ingredients', models.ManyToManyField(blank=True, related_name='recipes', to='meals.Ingredient')),
                ('tags', models.ManyToManyField(blank=True, related_name='tagged_recipes', to='utils.Tag')),
            ],
            options={
                'db_table': 'recipes',
            },
        ),
        migrations.RemoveField(
            model_name='meal',
            name='foods',
        ),
        migrations.RemoveField(
            model_name='nutritionalinformation',
            name='food',
        ),
        migrations.DeleteModel(
            name='Food',
        ),
        migrations.AddField(
            model_name='meal',
            name='recipes',
            field=models.ManyToManyField(related_name='recipe_meals', to='meals.Recipe'),
        ),
        migrations.AddField(
            model_name='nutritionalinformation',
            name='recipe',
            field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.PROTECT, to='meals.Recipe'),
            preserve_default=False,
        ),
    ]

# Generated by Django 2.2 on 2019-10-08 06:26

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


class Migration(migrations.Migration):

    dependencies = [
        ('utils', '0002_auto_20190824_2234'),
        ('meals', '0002_auto_20190824_2234'),
    ]

    operations = [
        migrations.CreateModel(
            name='Ingredient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=100, unique=True)),
                ('description', models.TextField(blank=True)),
                ('slug', models.CharField(blank=True, max_length=100, null=True, unique=True)),
                ('shelf_life', models.CharField(choices=[('LO', 'Low'), ('MD', 'Medium'), ('HI', 'High')], default='HI', max_length=2)),
                ('availability', models.CharField(choices=[('LC', 'Locally'), ('EX', 'Exotic')], default='LC', max_length=2)),
            ],
            options={
                'db_table': 'ingredients',
            },
        ),
        migrations.CreateModel(
            name='Recipe',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('modified_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=100, unique=True)),
                ('description', models.TextField(blank=True)),
                ('slug', models.CharField(blank=True, max_length=100, null=True, unique=True)),
                ('calories', models.PositiveIntegerField(default=0)),
                ('ingredients', models.ManyToManyField(blank=True, related_name='recipes', to='meals.Ingredient')),
                ('tags', models.ManyToManyField(blank=True, related_name='tagged_recipes', to='utils.Tag')),
            ],
            options={
                'db_table': 'recipes',
            },
        ),
        migrations.RemoveField(
            model_name='meal',
            name='foods',
        ),
        migrations.RemoveField(
            model_name='nutritionalinformation',
            name='food',
        ),
        migrations.DeleteModel(
            name='Food',
        ),
        migrations.AddField(
            model_name='meal',
            name='recipes',
            field=models.ManyToManyField(related_name='recipe_meals', to='meals.Recipe'),
        ),
        migrations.AddField(
            model_name='nutritionalinformation',
            name='recipe',
            field=models.OneToOneField(default=1, on_delete=django.db.models.deletion.PROTECT, to='meals.Recipe'),
            preserve_default=False,
        ),
    ]
# Generated by Django 2.2 on 2019-10-08 06:26