# Generated by Django 3.2 on 2021-05-04 06:13

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="AgeRating",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("rating", models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name="Category",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name="Genre",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="SubGenre",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name="Webtoon",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("title", models.CharField(max_length=100)),
                (
                    "thumbnail",
                    models.ImageField(
                        default="media/default_thumnail_image.jpeg", upload_to=""
                    ),
                ),
                ("author", models.CharField(max_length=20)),
                ("description", models.TextField()),
                ("star_rating", models.FloatField()),
                ("likes", models.PositiveIntegerField()),
                ("is_completed", models.BooleanField(default=False)),
                (
                    "age_rating",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="webtoons.agerating",
                    ),
                ),
                (
                    "category",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="webtoons.category",
                    ),
                ),
                (
                    "genre",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="webtoons.genre"
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="MainGenre",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=10)),
                (
                    "sub_genre",
                    models.ManyToManyField(
                        through="webtoons.Genre", to="webtoons.SubGenre"
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="genre",
            name="main_genre",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="webtoons.maingenre"
            ),
        ),
        migrations.AddField(
            model_name="genre",
            name="sub_genre",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE, to="webtoons.subgenre"
            ),
        ),
        migrations.CreateModel(
            name="Episode",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "content",
                    models.ImageField(
                        default="media/default_episode_image.jpeg", upload_to=""
                    ),
                ),
                (
                    "star_rating",
                    models.FloatField(
                        validators=[
                            django.core.validators.MinValueValidator(0.0),
                            django.core.validators.MaxValueValidator(10.0),
                        ]
                    ),
                ),
                ("likes", models.PositiveIntegerField()),
                ("note", models.TextField()),
                ("created_at", models.DateField(auto_now_add=True)),
                (
                    "webtoon_info",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="webtoons.webtoon",
                    ),
                ),
            ],
        ),
    ]
