# Generated by Django 3.2.5 on 2021-08-27 10:43

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='Category',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150, verbose_name='Категория')),
            ],
            options={
                'verbose_name': 'Категория',
                'verbose_name_plural': 'Категории',
            },
        ),
        migrations.CreateModel(
            name='Discounts',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150, verbose_name='Тип скидки')),
            ],
            options={
                'verbose_name': 'Тип скидки',
                'verbose_name_plural': 'Типы скидок',
            },
        ),
        migrations.CreateModel(
            name='Users',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='Пользователь')),
            ],
            options={
                'verbose_name': 'Пользователь',
                'verbose_name_plural': 'Пользователи',
            },
        ),
        migrations.CreateModel(
            name='Restaurant',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=150, verbose_name='Ресторан')),
                ('cooking_time', models.CharField(max_length=100, verbose_name='Среднее время приготовления')),
                ('min_price', models.PositiveIntegerField(default=5, help_text='указывать сумму в рублях', verbose_name='Минимальная цена')),
                ('address', models.TextField(default='', max_length=100, verbose_name='Адресс')),
                ('email', models.EmailField(default='', max_length=254, verbose_name='Email')),
                ('draft', models.BooleanField(default=False, verbose_name='Черновик')),
                ('category', models.ManyToManyField(to='food.Category', verbose_name='Категория')),
                ('restaurant_owner', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='food.users', verbose_name='Пользователь')),
            ],
            options={
                'verbose_name': 'Ресторан',
                'verbose_name_plural': 'Рестораны',
            },
        ),
        migrations.CreateModel(
            name='Food',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=150, verbose_name='Еда')),
                ('description', models.TextField(default='', verbose_name='Описание')),
                ('price', models.FloatField(default=5, help_text='указывать сумму в рублях, без скидки', verbose_name='Цена')),
                ('percent', models.PositiveIntegerField(default=0, help_text="работает тольки при типе скидке : 'Скидка'", verbose_name='Процент скидки')),
                ('discounted_price', models.FloatField(default=5, help_text='Вписать любую, потом изменится', verbose_name='Конечная цена')),
                ('restaurant', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='food.restaurant', verbose_name='Ресторан')),
                ('type_discount', models.ForeignKey(default=1, on_delete=django.db.models.deletion.CASCADE, to='food.discounts', verbose_name='Тип скидки')),
            ],
            options={
                'verbose_name': 'Еда',
                'verbose_name_plural': 'Еда',
            },
        ),
    ]
