# Generated by Django 3.1.7 on 2021-05-01 17:49

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='CompiledCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, validators=[django.core.validators.MinLengthValidator(2)])),
                ('description', models.CharField(blank=True, max_length=30000, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='CompiledCategoryAssignment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.compiledcategory')),
            ],
        ),
        migrations.CreateModel(
            name='Scrapable',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('url', models.CharField(max_length=1000, unique=True)),
                ('column', models.PositiveSmallIntegerField(default=0, null=True)),
                ('isCategory', models.BooleanField(default=True)),
                ('type', models.CharField(max_length=20)),
                ('scraped', models.BooleanField(default=False)),
                ('food_count', models.PositiveIntegerField(null=True)),
            ],
        ),
        migrations.CreateModel(
            name='UsdaFood',
            fields=[
                ('fdc_id', models.CharField(max_length=20, primary_key=True, serialize=False, unique=True)),
                ('description', models.CharField(max_length=20000)),
                ('dataType', models.CharField(max_length=200)),
                ('foodClass', models.CharField(max_length=200)),
                ('foodCode', models.CharField(max_length=20, null=True)),
                ('totalRefuse', models.CharField(max_length=20, null=True)),
                ('ingredients', models.CharField(max_length=20000, null=True)),
                ('scientificName', models.CharField(max_length=500, null=True)),
                ('category', models.CharField(max_length=500, null=True)),
                ('gtinUpc', models.CharField(max_length=20, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='WikiCategory',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, validators=[django.core.validators.MinLengthValidator(2)])),
                ('description', models.CharField(max_length=30000)),
                ('wiki_url', models.CharField(max_length=1000, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='WikiCategoryAssignment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.wikicategory')),
            ],
        ),
        migrations.CreateModel(
            name='WikiFood',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, validators=[django.core.validators.MinLengthValidator(2)])),
                ('description', models.CharField(max_length=30000)),
                ('wiki_url', models.CharField(max_length=1000, unique=True)),
                ('img_src', models.CharField(max_length=1000, null=True)),
                ('categories', models.ManyToManyField(blank=True, through='review.WikiCategoryAssignment', to='review.WikiCategory')),
            ],
        ),
        migrations.AddField(
            model_name='wikicategoryassignment',
            name='food',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.wikifood'),
        ),
        migrations.AddField(
            model_name='wikicategory',
            name='foods',
            field=models.ManyToManyField(blank=True, through='review.WikiCategoryAssignment', to='review.WikiFood'),
        ),
        migrations.AddField(
            model_name='wikicategory',
            name='parent_category',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='review.wikicategory'),
        ),
        migrations.CreateModel(
            name='UsdaNutrient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('number', models.CharField(max_length=100)),
                ('name', models.CharField(max_length=100)),
                ('rank', models.PositiveSmallIntegerField(null=True)),
                ('unitName', models.CharField(max_length=100)),
            ],
            options={
                'unique_together': {('number', 'unitName')},
            },
        ),
        migrations.CreateModel(
            name='UsdaFoodNutrient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('amount', models.FloatField()),
                ('nutrient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.usdanutrient')),
                ('usda_food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.usdafood')),
            ],
        ),
        migrations.CreateModel(
            name='CompiledFood',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, validators=[django.core.validators.MinLengthValidator(2)])),
                ('description', models.CharField(blank=True, max_length=30000, null=True)),
                ('img_src', models.CharField(max_length=1000)),
                ('wiki_url', models.CharField(max_length=1000, null=True)),
                ('categories', models.ManyToManyField(through='review.CompiledCategoryAssignment', to='review.CompiledCategory')),
                ('usda_food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.usdafood')),
            ],
        ),
        migrations.AddField(
            model_name='compiledcategoryassignment',
            name='food',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.compiledfood'),
        ),
        migrations.AddField(
            model_name='compiledcategory',
            name='foods',
            field=models.ManyToManyField(through='review.CompiledCategoryAssignment', to='review.CompiledFood'),
        ),
        migrations.AddField(
            model_name='compiledcategory',
            name='parent_category',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='review.compiledcategory'),
        ),
        migrations.CreateModel(
            name='WikiFoodName',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=500)),
                ('type', models.CharField(choices=[('IN', 'infobox'), ('SC', 'scientific'), ('BL', 'bold'), ('PT', 'pageTitle')], default='IN', max_length=2)),
                ('food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.wikifood')),
            ],
            options={
                'unique_together': {('name', 'type', 'food')},
            },
        ),
        migrations.AlterUniqueTogether(
            name='wikicategoryassignment',
            unique_together={('food', 'category')},
        ),
        migrations.CreateModel(
            name='UsdaWikiPairing',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('indexed', models.BooleanField(default=False)),
                ('usda_food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.usdafood')),
                ('wiki_food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.wikifood')),
            ],
            options={
                'unique_together': {('usda_food', 'wiki_food')},
            },
        ),
        migrations.CreateModel(
            name='UsdaFoodPortion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('portionDescription', models.CharField(max_length=200, null=True)),
                ('modifier', models.CharField(max_length=100)),
                ('gramWeight', models.CharField(max_length=20)),
                ('sequenceNumber', models.PositiveIntegerField(null=True)),
                ('usda_food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.usdafood')),
            ],
            options={
                'unique_together': {('portionDescription', 'usda_food')},
            },
        ),
        migrations.CreateModel(
            name='UnsplashPhoto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('search_term', models.CharField(max_length=100)),
                ('order', models.IntegerField()),
                ('total', models.IntegerField()),
                ('width', models.IntegerField()),
                ('height', models.IntegerField()),
                ('color', models.CharField(max_length=20)),
                ('blur_hash', models.CharField(max_length=500, null=True)),
                ('description', models.CharField(max_length=1500, null=True)),
                ('alt_description', models.CharField(max_length=1500, null=True)),
                ('raw', models.CharField(max_length=500, null=True)),
                ('full', models.CharField(max_length=500, null=True)),
                ('thumb', models.CharField(max_length=500, null=True)),
                ('small', models.CharField(max_length=500, null=True)),
                ('regular', models.CharField(max_length=500, null=True)),
                ('unsplash_page', models.CharField(max_length=500, null=True)),
                ('username', models.CharField(max_length=100, null=True)),
                ('ancestryCategory', models.CharField(max_length=100, null=True)),
                ('ancestrySubcategory', models.CharField(max_length=100, null=True)),
                ('food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.wikifood')),
            ],
            options={
                'unique_together': {('search_term', 'order', 'food')},
            },
        ),
        migrations.CreateModel(
            name='PixabayPhoto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('search_term', models.CharField(max_length=100)),
                ('order', models.IntegerField()),
                ('total', models.IntegerField()),
                ('pageURL', models.CharField(max_length=100)),
                ('pixabay_id', models.IntegerField()),
                ('tags', models.CharField(max_length=100)),
                ('previewWidth', models.IntegerField()),
                ('previewHeight', models.IntegerField()),
                ('webformatWidth', models.IntegerField()),
                ('webformatHeight', models.IntegerField()),
                ('largeImageURL', models.CharField(max_length=200)),
                ('imageURL', models.CharField(max_length=200)),
                ('imageWidth', models.IntegerField()),
                ('imageHeight', models.IntegerField()),
                ('imageSize', models.IntegerField()),
                ('views', models.IntegerField()),
                ('downloads', models.IntegerField()),
                ('favorites', models.IntegerField()),
                ('likes', models.IntegerField()),
                ('comments', models.IntegerField()),
                ('user_id', models.IntegerField()),
                ('user', models.CharField(max_length=30)),
                ('previewURL', models.CharField(max_length=200)),
                ('food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.wikifood')),
            ],
            options={
                'unique_together': {('search_term', 'order', 'food')},
            },
        ),
        migrations.CreateModel(
            name='PexelsPhoto',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('search_term', models.CharField(max_length=100)),
                ('order', models.IntegerField()),
                ('total', models.IntegerField()),
                ('pexels_id', models.IntegerField()),
                ('width', models.IntegerField()),
                ('height', models.IntegerField()),
                ('url', models.CharField(max_length=100)),
                ('photographer', models.CharField(max_length=30)),
                ('photographer_url', models.CharField(max_length=100)),
                ('photographer_id', models.IntegerField()),
                ('avg_color', models.CharField(max_length=10)),
                ('original', models.CharField(max_length=200)),
                ('large2x', models.CharField(max_length=200)),
                ('small', models.CharField(max_length=200)),
                ('tiny', models.CharField(max_length=200)),
                ('food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.wikifood')),
            ],
            options={
                'unique_together': {('search_term', 'order', 'food')},
            },
        ),
        migrations.CreateModel(
            name='CompiledFoodName',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=500)),
                ('type', models.CharField(choices=[('IN', 'infobox'), ('SC', 'scientific'), ('BL', 'bold'), ('PT', 'pageTitle')], default='IN', max_length=2)),
                ('food', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='review.compiledfood')),
            ],
            options={
                'unique_together': {('name', 'type', 'food')},
            },
        ),
        migrations.AlterUniqueTogether(
            name='compiledcategoryassignment',
            unique_together={('food', 'category')},
        ),
    ]
