# Generated by Django 2.2.5 on 2021-06-15 18:53

from django.conf import settings
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import re


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('film', '0003_alter_film_link_of_film'),
    ]

    operations = [
        migrations.CreateModel(
            name='actors',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=40)),
            ],
        ),
        migrations.CreateModel(
            name='categories',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])),
            ],
        ),
        migrations.CreateModel(
            name='Director',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')])),
            ],
        ),
        migrations.RemoveField(
            model_name='film',
            name='Categories',
        ),
        migrations.AlterField(
            model_name='film',
            name='director',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='director', to='film.Director'),
        ),
        migrations.AlterField(
            model_name='film',
            name='id',
            field=models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID'),
        ),
        migrations.AlterField(
            model_name='film',
            name='production_company',
            field=models.CharField(max_length=60),
        ),
        migrations.AlterField(
            model_name='film',
            name='spoken_language',
            field=models.CharField(max_length=50),
        ),
        migrations.AlterField(
            model_name='film',
            name='title',
            field=models.CharField(max_length=50, validators=[django.core.validators.RegexValidator(re.compile('^[-a-zA-Z0-9_]+\\Z'), "Enter a valid 'slug' consisting of letters, numbers, underscores or hyphens.", 'invalid')]),
        ),
        migrations.CreateModel(
            name='search_history',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('Text', models.CharField(max_length=9000)),
                ('chosen_or_not', models.IntegerField()),
                ('films', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='namefileOfUser', to='film.film')),
                ('users', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='search', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='review_of_film',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('times_tamp', models.DateField(null=True)),
                ('precent_rate', models.IntegerField()),
                ('films', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='namefileUser', to='film.film')),
                ('users', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='nameUser', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='like_un_like_film',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('true_or_not', models.IntegerField()),
                ('films', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='namefile', to='film.film')),
                ('users', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='makelike', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='acotors_film',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('actors', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='actorfilm', to='film.actors')),
                ('films', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='actorfilm', to='film.film')),
            ],
        ),
        migrations.AddField(
            model_name='film',
            name='categorie',
            field=models.ForeignKey(default=30, on_delete=django.db.models.deletion.CASCADE, related_name='categories', to='film.categories'),
            preserve_default=False,
        ),
    ]
