# Generated by Django 4.2 on 2024-04-09 16:07

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="Auditorium",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "number",
                    models.CharField(
                        max_length=20, verbose_name="Номер кинозала"
                    ),
                ),
                (
                    "row_count",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(1)
                        ],
                        verbose_name="Количество рядов кресел в зале",
                    ),
                ),
            ],
            options={
                "verbose_name": "Зал",
                "verbose_name_plural": "Залы",
                "db_table": "timetable_auditoriums",
            },
        ),
        migrations.CreateModel(
            name="Rows",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "row_number",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(1)
                        ],
                        verbose_name="Номер ряда",
                    ),
                ),
                (
                    "column_count",
                    models.IntegerField(
                        validators=[
                            django.core.validators.MinValueValidator(1)
                        ],
                        verbose_name="Количество кресел в ряду",
                    ),
                ),
                (
                    "auditorium",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="rows",
                        to="timetable.auditorium",
                        verbose_name="зал",
                    ),
                ),
            ],
            options={
                "verbose_name": "Место",
                "verbose_name_plural": "Места",
                "db_table": "timetable_rows",
            },
        ),
    ]
