# Generated by Django 2.1.7 on 2019-03-06 07:47

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


class Migration(migrations.Migration):

    dependencies = [
        ('webapp', '0005_auto_20190304_0646'),
    ]

    operations = [
        migrations.CreateModel(
            name='Discount',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('discount', models.IntegerField(max_length=2)),
                ('discount_start', models.DateTimeField(blank=True, null=True)),
                ('discount_finish', models.DateTimeField(blank=True, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Reservation',
            fields=[
                ('id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('status', models.CharField(choices=[('Создано', 'Новый'), ('Выкуплено', 'Выкуплено'), ('Отмена', 'Отмена')], default='Создано', max_length=255)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('changed_at', models.DateTimeField(auto_now=True)),
                ('seats', models.ManyToManyField(related_name='reservation_seats', to='webapp.Seat')),
                ('show', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='reservation_show', to='webapp.Show')),
            ],
        ),
        migrations.CreateModel(
            name='Ticket',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('return_ticket', models.BooleanField(default=False)),
                ('discount', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='ticket_discount', to='webapp.Discount')),
                ('seat', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='ticket_seat', to='webapp.Seat')),
                ('show', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='ticket_show', to='webapp.Show')),
            ],
        ),
    ]
