# Generated by Django 2.2 on 2020-08-31 11:37

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


class Migration(migrations.Migration):

    dependencies = [
        ('webapp', '0003_basket'),
    ]

    operations = [
        migrations.CreateModel(
            name='Orders',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('username', models.CharField(max_length=100, verbose_name='Имя пользователя')),
                ('phone', models.CharField(max_length=20, verbose_name='Телефон')),
                ('adress', models.CharField(max_length=100, verbose_name='Адресс')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Дата и время создания')),
            ],
        ),
        migrations.CreateModel(
            name='ProductOrder',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('qty', models.IntegerField(validators=[django.core.validators.MinValueValidator(0)], verbose_name='Количество')),
                ('order', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='ProductOrders', to='webapp.Orders', verbose_name='Номер заказа')),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='OrderProducts', to='webapp.Basket', verbose_name='Номер заказа')),
            ],
        ),
    ]
