# Generated by Django 4.2.16 on 2024-11-06 15:49

from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import taggit.managers
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ("scrobbles", "0066_scrobble_beer_alter_scrobble_media_type"),
        ("videos", "0018_video_youtube_url_alter_video_video_type"),
    ]

    operations = [
        migrations.RenameField(
            model_name="video",
            old_name="youtube_url",
            new_name="youtube_id",
        ),
        migrations.CreateModel(
            name="Channel",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "created",
                    django_extensions.db.fields.CreationDateTimeField(
                        auto_now_add=True, verbose_name="created"
                    ),
                ),
                (
                    "modified",
                    django_extensions.db.fields.ModificationDateTimeField(
                        auto_now=True, verbose_name="modified"
                    ),
                ),
                (
                    "uuid",
                    models.UUIDField(
                        blank=True,
                        default=uuid.uuid4,
                        editable=False,
                        null=True,
                    ),
                ),
                ("name", models.CharField(max_length=255)),
                (
                    "cover_image",
                    models.ImageField(
                        blank=True, null=True, upload_to="videos/channels/"
                    ),
                ),
                (
                    "genre",
                    taggit.managers.TaggableManager(
                        help_text="A comma-separated list of tags.",
                        through="scrobbles.ObjectWithGenres",
                        to="scrobbles.Genre",
                        verbose_name="Tags",
                    ),
                ),
            ],
            options={
                "get_latest_by": "modified",
                "abstract": False,
            },
        ),
        migrations.AddField(
            model_name="video",
            name="channel",
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to="videos.channel",
            ),
        ),
    ]
