# Generated by Django 4.2 on 2024-04-23 03:20

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


class Migration(migrations.Migration):

    replaces = [
        ('films', '0002_alter_film_genres'),
        ('films', '0003_film_description'),
        ('films', '0004_film_image'),
        ('films', '0005_film_age_limit'),
        (
            'films',
            '0006_actor_country_director_film_actors_film_countries_and_more',
        ),
        ('films', '0007_alter_film_countries'),
    ]

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

    operations = [
        migrations.AlterField(
            model_name='film',
            name='genres',
            field=models.ManyToManyField(
                help_text='Жанры фильма',
                related_name='films',
                related_query_name='films',
                to='films.genre',
                verbose_name='Жанры',
            ),
        ),
        migrations.AddField(
            model_name='film',
            name='description',
            field=models.CharField(
                default='', help_text='Описание фильма', max_length=1000
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name='film',
            name='image',
            field=models.ImageField(
                blank=True,
                null=True,
                upload_to=films.models.Film.get_upload_path,
                verbose_name='Изображение фильма',
            ),
        ),
        migrations.AddField(
            model_name='film',
            name='age_limit',
            field=models.CharField(
                choices=[
                    ['0+', '0+'],
                    ['6+', '0+'],
                    ['12+', '12+'],
                    ['16+', '16+'],
                    ['18+', '18+'],
                ],
                default='12+',
                help_text='Возрастное ограничение',
                max_length=3,
            ),
            preserve_default=False,
        ),
        migrations.CreateModel(
            name='Actor',
            fields=[
                (
                    'id',
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'first_name',
                    models.CharField(
                        help_text='Имя актера',
                        max_length=100,
                        verbose_name='Имя',
                    ),
                ),
                (
                    'last_name',
                    models.CharField(
                        help_text='Фамилия актера',
                        max_length=100,
                        verbose_name='Фамилия',
                    ),
                ),
            ],
            options={
                'verbose_name': 'Актер',
                'verbose_name_plural': 'Актеры',
                'db_table': 'films_actors',
            },
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                (
                    'id',
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'name',
                    models.CharField(
                        help_text='Название страны',
                        max_length=500,
                        verbose_name='Название',
                    ),
                ),
            ],
            options={
                'verbose_name': 'Страна',
                'verbose_name_plural': 'Страны',
                'db_table': 'films_countries',
            },
        ),
        migrations.CreateModel(
            name='Director',
            fields=[
                (
                    'id',
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name='ID',
                    ),
                ),
                (
                    'first_name',
                    models.CharField(
                        help_text='Имя режиссера',
                        max_length=100,
                        verbose_name='Имя',
                    ),
                ),
                (
                    'last_name',
                    models.CharField(
                        help_text='Фамилия режиссера',
                        max_length=100,
                        verbose_name='Фамилия',
                    ),
                ),
            ],
            options={
                'verbose_name': 'Режиссер',
                'verbose_name_plural': 'Режиссеры',
                'db_table': 'films_directors',
            },
        ),
        migrations.AddField(
            model_name='film',
            name='actors',
            field=models.ManyToManyField(
                related_name='actor_films',
                related_query_name='actor_films',
                to='films.actor',
            ),
        ),
        migrations.AddField(
            model_name='film',
            name='directors',
            field=models.ManyToManyField(
                related_name='director_films',
                related_query_name='director_films',
                to='films.director',
            ),
        ),
        migrations.AddField(
            model_name='film',
            name='countries',
            field=models.ManyToManyField(
                related_name='country_films',
                related_query_name='country_films',
                to='films.country',
            ),
        ),
    ]
