# Generated by Django 3.2.5 on 2021-07-27 22:32

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Customer',
            fields=[
                ('username', models.CharField(db_index=True, max_length=50, primary_key=True, serialize=False, verbose_name='логин покупателя')),
            ],
            options={
                'verbose_name': 'Покупатель',
                'verbose_name_plural': 'Покупатели',
            },
        ),
        migrations.CreateModel(
            name='Gem',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, unique=True, verbose_name='наименование товара')),
            ],
            options={
                'verbose_name': 'Камень',
                'verbose_name_plural': 'Камни',
            },
        ),
        migrations.CreateModel(
            name='Deal',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('total', models.PositiveIntegerField(verbose_name='сумма сделки')),
                ('quantity', models.PositiveSmallIntegerField(verbose_name='количество товара, шт')),
                ('date', models.DateTimeField(verbose_name='дата и время регистрации сделки')),
                ('customer', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deals', to='API.customer')),
                ('item', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='deals', to='API.gem')),
            ],
            options={
                'verbose_name': 'Сделка',
                'verbose_name_plural': 'Сделки',
            },
        ),
    ]
