# Generated by Django 2.2.6 on 2019-10-29 20:10

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


class Migration(migrations.Migration):

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

    operations = [
        migrations.CreateModel(
            name='Genre',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('genre_id', models.CharField(max_length=9999)),
                ('genre_name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='Person',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('person_id', models.CharField(max_length=9999)),
                ('person_name', models.CharField(max_length=100)),
                ('person_url_image', models.CharField(max_length=1000)),
                ('person_rating_av_from_films', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_id', models.CharField(max_length=9999)),
                ('user_name', models.TextField()),
                ('user_login', models.IntegerField()),
            ],
        ),
        migrations.CreateModel(
            name='Rating',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('rating_id', models.CharField(max_length=9999)),
                ('rating_number', models.IntegerField()),
                ('rating_movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Movie')),
                ('rating_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.User')),
            ],
        ),
        migrations.CreateModel(
            name='Person_Movie',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('role', models.CharField(max_length=100)),
                ('movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Movie')),
                ('person', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Person')),
            ],
        ),
        migrations.CreateModel(
            name='Comment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('comment_id', models.CharField(max_length=9999)),
                ('comment_description', models.TextField()),
                ('comment_date', models.DateTimeField()),
                ('comment_movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.Movie')),
                ('comment_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='mainapp.User')),
            ],
        ),
        migrations.AddField(
            model_name='movie',
            name='movie_genres',
            field=models.ManyToManyField(to='mainapp.Genre'),
        ),
        migrations.AddField(
            model_name='movie',
            name='movie_persons',
            field=models.ManyToManyField(through='mainapp.Person_Movie', to='mainapp.Person'),
        ),
        migrations.AddField(
            model_name='movie',
            name='movie_rated_users',
            field=models.ManyToManyField(through='mainapp.Rating', to='mainapp.User'),
        ),
    ]
