# -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-06-22 22:12
from __future__ import unicode_literals

import apps.common.models.image
from django.db import migrations, models
import django.db.models.deletion
import uuid


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Company',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('moviedb_id', models.IntegerField()),
                ('name', models.CharField(blank=True, max_length=200, null=True)),
            ],
            options={
                'db_table': 'movies_company',
            },
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('iso_id', models.CharField(blank=True, max_length=2, null=True)),
                ('name', models.CharField(blank=True, max_length=200, null=True)),
            ],
            options={
                'db_table': 'movies_country',
            },
        ),
        migrations.CreateModel(
            name='Genre',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('moviedb_id', models.CharField(blank=True, max_length=200, null=True)),
                ('name', models.CharField(blank=True, max_length=200, null=True)),
            ],
            options={
                'db_table': 'movies_genre',
            },
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image_type', models.CharField(max_length=200)),
                ('size', models.CharField(max_length=200)),
                ('filename', models.CharField(max_length=200)),
                ('image', models.ImageField(blank=True, null=True, upload_to=apps.common.models.image.upload_to)),
            ],
            options={
                'db_table': 'movies_image',
            },
        ),
        migrations.CreateModel(
            name='Language',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('iso_id', models.CharField(blank=True, max_length=200, null=True)),
                ('name', models.CharField(blank=True, max_length=200, null=True)),
            ],
            options={
                'db_table': 'movies_language',
            },
        ),
        migrations.CreateModel(
            name='Library',
            fields=[
                ('name', models.CharField(blank=True, max_length=200, null=True)),
                ('pub_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
            ],
            options={
                'abstract': False,
                'db_table': 'movies_library',
            },
        ),
        migrations.CreateModel(
            name='Movie',
            fields=[
                ('name', models.CharField(blank=True, max_length=2000, null=True)),
                ('name_the_less', models.CharField(blank=True, max_length=2000, null=True)),
                ('filename', models.CharField(blank=True, default=b'', max_length=2000, null=True)),
                ('pub_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('moviedb_id', models.CharField(blank=True, max_length=2000, null=True)),
                ('imdb_id', models.CharField(blank=True, max_length=2000, null=True)),
                ('original_title', models.CharField(blank=True, max_length=2000, null=True)),
                ('overview', models.CharField(blank=True, max_length=2000, null=True)),
                ('popularity', models.IntegerField(blank=True, null=True)),
                ('release_date', models.CharField(blank=True, max_length=2000, null=True)),
                ('tagline', models.CharField(blank=True, max_length=2000, null=True)),
                ('runtime', models.IntegerField(blank=True, null=True)),
                ('revenue', models.IntegerField(blank=True, null=True)),
                ('budget', models.IntegerField(blank=True, null=True)),
                ('vote_average', models.IntegerField(blank=True, null=True)),
                ('vote_count', models.IntegerField(blank=True, null=True)),
                ('has_metadata', models.BooleanField(default=False)),
                ('has_recommendations', models.BooleanField(default=False)),
                ('genres', models.ManyToManyField(to='movies.Genre')),
                ('production_companies', models.ManyToManyField(to='movies.Company')),
                ('production_countries', models.ManyToManyField(to='movies.Country')),
                ('spoken_languages', models.ManyToManyField(to='movies.Language')),
            ],
            options={
                'db_table': 'movies_movie',
            },
        ),
        migrations.CreateModel(
            name='MovieImageMap',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='movies.Image')),
                ('movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='movies.Movie')),
            ],
            options={
                'db_table': 'movies_movie_image_map',
            },
        ),
        migrations.CreateModel(
            name='MovieListMovieMap',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('movie_pub_id', models.CharField(max_length=32)),
                ('movie_list_pub_id', models.CharField(max_length=32)),
            ],
            options={
                'db_table': 'movies_movie_list_movie_map',
            },
        ),
        migrations.CreateModel(
            name='Recommendation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('recommended_id', models.CharField(blank=True, max_length=200, null=True)),
                ('poster_path', models.CharField(blank=True, max_length=200, null=True)),
                ('release_date', models.CharField(blank=True, max_length=200, null=True)),
                ('title', models.CharField(blank=True, max_length=200, null=True)),
                ('vote_average', models.FloatField()),
                ('vote_count', models.IntegerField()),
                ('popularity', models.FloatField()),
                ('based_on_movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='based_on_movie', to='movies.Movie')),
                ('recommended_movie', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='recommended_movie', to='movies.Movie')),
            ],
        ),
        migrations.CreateModel(
            name='Torrent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('transmission_id', models.IntegerField()),
                ('movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='movies.Movie')),
            ],
            options={
                'db_table': 'movies_torrent',
            },
        ),
        migrations.CreateModel(
            name='Watchlist',
            fields=[
                ('name', models.CharField(blank=True, max_length=200, null=True)),
                ('pub_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
                ('library', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='movies.Library')),
            ],
            options={
                'abstract': False,
                'db_table': 'movies_watchlist',
            },
        ),
    ]
