# Generated by Django 2.2.3 on 2019-11-24 16:58

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name_country', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='Films',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name_film', models.CharField(max_length=20)),
                ('film_year', models.IntegerField(null=True)),
                ('film_country', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polls.Country')),
            ],
        ),
        migrations.CreateModel(
            name='Genres',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name_genre', models.CharField(max_length=20)),
            ],
        ),
        migrations.CreateModel(
            name='Person_Function',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name_function', models.CharField(max_length=20, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Studio',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name_studio', models.TextField(max_length=20)),
                ('country_studio', models.ForeignKey(null=True, on_delete=django.db.models.fields.TextField, to='polls.Country')),
            ],
        ),
        migrations.CreateModel(
            name='Rating_film',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rating', models.FloatField(null=True)),
                ('film_r', models.ForeignKey(null=True, on_delete=django.db.models.fields.TextField, related_name='film_rating', to='polls.Films')),
            ],
        ),
        migrations.CreateModel(
            name='Persons',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('last_name', models.CharField(max_length=20)),
                ('date_birth', models.DateField(blank=True, null=True)),
                ('age', models.IntegerField()),
                ('country', models.ForeignKey(null=True, on_delete=django.db.models.fields.TextField, to='polls.Country')),
                ('person_function', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polls.Person_Function')),
            ],
        ),
        migrations.CreateModel(
            name='News_for_film',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('news', models.TextField()),
                ('name_film', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='films_name', to='polls.Films')),
            ],
        ),
        migrations.CreateModel(
            name='Image_BD',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ImageField(upload_to='images/')),
                ('image_name', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, to='polls.Films')),
            ],
        ),
        migrations.AddField(
            model_name='films',
            name='film_genre',
            field=models.ManyToManyField(null=True, to='polls.Genres'),
        ),
        migrations.AddField(
            model_name='films',
            name='film_person',
            field=models.ManyToManyField(null=True, related_name='film_person', to='polls.Persons'),
        ),
        migrations.AddField(
            model_name='films',
            name='film_person_crate',
            field=models.ForeignKey(null=True, on_delete=django.db.models.fields.TextField, related_name='film_person_crate', to='polls.Persons'),
        ),
        migrations.AddField(
            model_name='films',
            name='film_studio',
            field=models.ManyToManyField(null=True, related_name='film_studio', to='polls.Studio'),
        ),
        migrations.CreateModel(
            name='Blog_for_person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('blog', models.TextField()),
                ('name_blog', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='polls.Films')),
            ],
        ),
    ]
