# Generated by Django 3.1.3 on 2020-12-01 08:53

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('hall', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='Client',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name_client', models.CharField(max_length=100, verbose_name='Имя Клиентв')),
                ('email_client', models.CharField(max_length=100, verbose_name='Почта Клиента')),
                ('phone_client', models.CharField(max_length=100, verbose_name='Телефон Клиента')),
            ],
            options={
                'verbose_name': 'Client',
                'verbose_name_plural': 'Clients',
            },
        ),
        migrations.CreateModel(
            name='Reservation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField(verbose_name='Дата бронирования')),
                ('client', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reserved_client', to='reserver.client')),
                ('table', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='reserved_table', to='hall.struct')),
            ],
            options={
                'verbose_name': 'Reservation',
                'verbose_name_plural': 'Reservations',
            },
        ),
        migrations.AddConstraint(
            model_name='reservation',
            constraint=models.UniqueConstraint(fields=('table', 'client', 'date'), name='unique_reserv'),
        ),
    ]
