# Generated by Django 3.1.7 on 2021-03-25 12:39

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Cart',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('session_key', models.CharField(blank=True, default='', max_length=999)),
                ('total_cost', models.PositiveIntegerField()),
                ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Category',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(help_text='введите название Категория', max_length=100, verbose_name='Название Категории')),
                ('description', models.CharField(max_length=500, verbose_name='Описание')),
            ],
            options={
                'verbose_name': 'Категория',
                'verbose_name_plural': 'Категории',
            },
        ),
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=250)),
            ],
        ),
        migrations.CreateModel(
            name='Dish',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(max_length=900, null=True, upload_to='images/', verbose_name='Картинка')),
                ('title', models.CharField(help_text='введите название блюда', max_length=100,
                                           verbose_name='Название блюда')),
                ('description', models.CharField(blank=True, max_length=500, verbose_name='Описание')),
                ('price', models.PositiveIntegerField(verbose_name='цена')),
                ('categories', models.ManyToManyField(to='food_shop.Category', verbose_name='Категория')),
                ('company', models.ForeignKey(default=2, null=True, on_delete=django.db.models.deletion.SET_NULL,
                                              to='food_shop.company', verbose_name='компания')),
            ],
            options={
                'verbose_name': 'Блюдо',
                'verbose_name_plural': 'Блюда',
            },
        ),
        migrations.CreateModel(
            name='CartContent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qty', models.PositiveIntegerField(null=True)),
                ('cart', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='food_shop.cart')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='food_shop.dish')),
            ],
        ),
    ]
