# Generated by Django 5.2.10 on 2026-02-02 18:03

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


class Migration(migrations.Migration):

    dependencies = [
        ("cards", "0004_cardface_media_background"),
    ]

    operations = [
        migrations.CreateModel(
            name="CardDesign",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("name", models.CharField(blank=True, default="", max_length=255)),
                ("sequence", models.PositiveIntegerField(default=0)),
                ("fields", models.JSONField(blank=True, default=dict)),
                ("created_on", models.DateTimeField(auto_now_add=True)),
            ],
            options={
                "verbose_name": "Card Design",
                "verbose_name_plural": "Card Designs",
                "ordering": ("card_set", "sequence", "name"),
            },
        ),
        migrations.CreateModel(
            name="CardSet",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("is_seed_data", models.BooleanField(default=False, editable=False)),
                ("is_user_data", models.BooleanField(default=False, editable=False)),
                ("is_deleted", models.BooleanField(default=False, editable=False)),
                ("name", models.CharField(max_length=255)),
                ("code", models.CharField(blank=True, default="", max_length=32)),
                ("language", models.CharField(blank=True, default="", max_length=32)),
                ("game", models.CharField(blank=True, default="", max_length=255)),
                ("style", models.CharField(blank=True, default="", max_length=255)),
                ("set_info", models.JSONField(blank=True, default=dict)),
                ("style_settings", models.JSONField(blank=True, default=dict)),
                ("raw_set_text", models.TextField(blank=True, default="")),
                (
                    "source_filename",
                    models.CharField(blank=True, default="", max_length=255),
                ),
                ("created_on", models.DateTimeField(auto_now_add=True)),
            ],
            options={
                "verbose_name": "Card Set",
                "verbose_name_plural": "Card Sets",
                "ordering": ("-created_on", "name"),
            },
        ),
        migrations.AddField(
            model_name="rfid",
            name="card_designs",
            field=models.ManyToManyField(
                blank=True,
                help_text="Card designs linked to this RFID.",
                related_name="rfids",
                to="cards.carddesign",
            ),
        ),
        migrations.AddField(
            model_name="carddesign",
            name="card_set",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="card_designs",
                to="cards.cardset",
            ),
        ),
    ]
