# -*- coding: utf-8 -*-
# Generated by Django 1.9.4 on 2016-05-12 14:16
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Anime',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=300, unique=True)),
                ('slug', models.SlugField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ('-created_at', '-id'),
            },
        ),
        migrations.CreateModel(
            name='Fansub',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('slug', models.SlugField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='MALMeta',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mal_id', models.PositiveIntegerField(unique=True)),
                ('synopsys', models.TextField(blank=True, null=True)),
                ('title', models.TextField(blank=True, null=True)),
                ('title_en', models.CharField(blank=True, max_length=100, null=True)),
                ('resumen', models.TextField(blank=True, null=True)),
                ('image', models.URLField(blank=True, null=True)),
                ('synonyms', models.TextField(blank=True, null=True)),
                ('status', models.CharField(blank=True, max_length=20, null=True)),
                ('alternative_title', models.CharField(blank=True, max_length=300, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='MetaTorrent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('episode', models.CharField(blank=True, max_length=20, null=True)),
                ('format', models.CharField(blank=True, max_length=10, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('anime', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='torrents.Anime')),
                ('mal', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='torrents.MALMeta')),
            ],
        ),
        migrations.CreateModel(
            name='ReleaseGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
                ('alias', models.CharField(blank=True, max_length=100, null=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Torrent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('full', models.TextField()),
                ('url', models.URLField()),
                ('download_url', models.URLField()),
                ('download_magnet', models.TextField(null=True)),
                ('date', models.DateTimeField()),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'ordering': ('-created_at', '-id'),
            },
        ),
        migrations.AlterUniqueTogether(
            name='torrent',
            unique_together=set([('full', 'url')]),
        ),
        migrations.AddField(
            model_name='metatorrent',
            name='release_group',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='torrents.ReleaseGroup'),
        ),
        migrations.AddField(
            model_name='metatorrent',
            name='torrent',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='torrents.Torrent'),
        ),
        migrations.AddField(
            model_name='fansub',
            name='release_groups',
            field=models.ManyToManyField(to='torrents.ReleaseGroup'),
        ),
    ]
