# Generated by Django 2.1.7 on 2019-06-12 18:59

import datetime
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='Client',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='код')),
                ('name', models.CharField(max_length=50, verbose_name='имя')),
                ('phone_number', models.BigIntegerField(verbose_name='номер телефона')),
            ],
            options={
                'verbose_name': 'клиент',
                'verbose_name_plural': 'клиенты',
            },
        ),
        migrations.CreateModel(
            name='Client_Auth',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('phone_number', models.CharField(max_length=15)),
                ('code_of_auth', models.CharField(max_length=6)),
                ('end_of_live', models.DateTimeField(default=datetime.datetime(2019, 6, 12, 22, 9, 30, 547313))),
            ],
        ),
        migrations.CreateModel(
            name='Order',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='код')),
                ('dateTimeOrder', models.DateTimeField(verbose_name='дата и время заказа')),
                ('price', models.PositiveIntegerField(verbose_name='сумма заказа')),
                ('city', models.CharField(max_length=25, verbose_name='город')),
                ('street', models.CharField(max_length=25, verbose_name='улица')),
                ('house', models.PositiveIntegerField(verbose_name='номер дома')),
                ('entrance', models.PositiveSmallIntegerField(verbose_name='этаж')),
                ('apartament_number', models.PositiveIntegerField(verbose_name='квартира')),
                ('status', models.CharField(choices=[('Ожидание подтверждения', 'Ожидание подтверждения'), ('В обработке', 'В обработке'), ('Готов', 'Готов')], default='Ожидание подтверждения', max_length=30, verbose_name='статус')),
                ('client_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='obp.Client', verbose_name='клиент')),
            ],
            options={
                'verbose_name': 'заказ',
                'verbose_name_plural': 'заказы',
            },
        ),
        migrations.CreateModel(
            name='Product',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='код товара')),
                ('title', models.CharField(max_length=25, unique=True, validators=[django.core.validators.MinLengthValidator(2)], verbose_name='название товара')),
                ('size', models.DecimalField(decimal_places=1, max_digits=4, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(9999)], verbose_name='вес')),
                ('unitSize', models.CharField(choices=[('г.', 'г.'), ('л.', 'л.')], default='г.', max_length=3, verbose_name='единица измерения веса')),
                ('price', models.PositiveSmallIntegerField(validators=[django.core.validators.MaxValueValidator(9999), django.core.validators.MinValueValidator(1)], verbose_name='цена')),
                ('image', models.ImageField(blank=True, upload_to='', verbose_name='изображение')),
                ('date', models.DateField(default=datetime.date.today, verbose_name='дата добавления')),
            ],
            options={
                'verbose_name': 'товар',
                'verbose_name_plural': 'товары',
            },
        ),
        migrations.CreateModel(
            name='Product_comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('text', models.TextField(max_length=500)),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='obp.Client')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='obp.Product')),
            ],
        ),
        migrations.CreateModel(
            name='Product_composition',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('ingradient', models.CharField(max_length=40, verbose_name='ингредиент')),
                ('product_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='obp.Product', verbose_name='Код')),
            ],
            options={
                'verbose_name': 'ингредиент',
                'verbose_name_plural': 'ингредиенты',
            },
        ),
        migrations.CreateModel(
            name='Product_order',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('quantity', models.PositiveSmallIntegerField(verbose_name='количество')),
                ('order_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='obp.Order', verbose_name='номер заказа')),
                ('product_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='obp.Product', verbose_name='наименование товара')),
            ],
            options={
                'verbose_name': 'товар в заказ',
                'verbose_name_plural': 'товары в заказе',
            },
        ),
        migrations.CreateModel(
            name='Section',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False, verbose_name='код')),
                ('title', models.CharField(max_length=25, validators=[django.core.validators.MinLengthValidator(2)], verbose_name='название')),
            ],
            options={
                'verbose_name': 'категория',
                'verbose_name_plural': 'категории',
            },
        ),
        migrations.CreateModel(
            name='Special_offers',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('url', models.URLField(max_length=300, verbose_name='URL-адрес')),
                ('image', models.ImageField(blank=True, upload_to='', verbose_name='Изображение')),
                ('status', models.BooleanField(verbose_name='Статус')),
            ],
        ),
        migrations.CreateModel(
            name='Stock',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('value', models.PositiveSmallIntegerField(verbose_name='цена со скидкой')),
                ('status', models.BooleanField(verbose_name='статус')),
                ('product_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='obp.Product', verbose_name='товар')),
            ],
            options={
                'verbose_name': 'акция',
                'verbose_name_plural': 'акции',
            },
        ),
        migrations.AddField(
            model_name='product',
            name='section_id',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='obp.Section', verbose_name='категория'),
        ),
    ]
