# Generated by Django 4.2.9 on 2024-12-03 11:28

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

    dependencies = [
        ("federation", "0028_auto_20221027_1141"),
        ("playlists", "0006_playlisttrack_fid_playlisttrack_url_and_more"),
    ]

    operations = [
        migrations.AlterField(
            model_name="playlist",
            name="actor",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="playlists",
                to="federation.actor",
            ),
        ),
        migrations.AlterField(
            model_name="playlisttrack",
            name="uuid",
            field=models.UUIDField(default=uuid.uuid4, unique=True),
        ),
        migrations.CreateModel(
            name="PlaylistScan",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("total_files", models.PositiveIntegerField(default=0)),
                ("processed_files", models.PositiveIntegerField(default=0)),
                ("errored_files", models.PositiveIntegerField(default=0)),
                ("status", models.CharField(default="pending", max_length=25)),
                (
                    "creation_date",
                    models.DateTimeField(default=django.utils.timezone.now),
                ),
                ("modification_date", models.DateTimeField(blank=True, null=True)),
                (
                    "actor",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="federation.actor",
                    ),
                ),
                (
                    "playlist",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="scans",
                        to="playlists.playlist",
                    ),
                ),
            ],
        ),
    ]
