# Generated by Django 4.2.29 on 2026-03-21 17:14

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields


class Migration(migrations.Migration):

    dependencies = [
        ("scrobbles", "0072_add_scrobble_indexes"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("people", "0005_person_boardgamearena_id"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="person",
            name="scrobble_count",
        ),
        migrations.CreateModel(
            name="PersonScrobble",
            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"
                    ),
                ),
                (
                    "person",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="scrobble_associations",
                        to="people.person",
                    ),
                ),
                (
                    "scrobble",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="scrobbles.scrobble",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="person_scrobbles",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "indexes": [
                    models.Index(
                        fields=["person", "user"],
                        name="people_pers_person__b7ebc7_idx",
                    ),
                    models.Index(
                        fields=["user", "scrobble"],
                        name="people_pers_user_id_4f5fe7_idx",
                    ),
                ],
                "unique_together": {("person", "scrobble")},
            },
        ),
    ]
