# Generated by Django 6.0.3 on 2026-03-13 07:40

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


class Migration(migrations.Migration):

    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
        ("wagtailadmin", "0005_editingsession_is_editing"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="FormState",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("data", models.TextField()),
                ("object_id", models.CharField(max_length=255)),
                ("parent_object_id", models.CharField(max_length=255)),
                ("last_updated_at", models.DateTimeField()),
                (
                    "content_type",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="contenttypes.contenttype",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="wagtail_form_states",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "ordering": ["-last_updated_at"],
                "indexes": [
                    models.Index(
                        fields=[
                            "user",
                            "content_type",
                            "object_id",
                            "parent_object_id",
                        ],
                        name="formstate_user_object",
                    )
                ],
            },
        ),
    ]
