# Generated by Django 4.2.2 on 2023-08-29 08:29

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


class Migration(migrations.Migration):
    dependencies = [
        ("formkit_ninja", "0010_alter_option_options_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="NodeChildren",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "order",
                    models.PositiveIntegerField(
                        db_index=True, editable=False, verbose_name="order"
                    ),
                ),
                (
                    "child",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="parent",
                        to="formkit_ninja.formkitschemanode",
                    ),
                ),
                (
                    "parent",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="formkit_ninja.formkitschemanode",
                    ),
                ),
            ],
            options={
                "ordering": ("order",),
            },
        ),
        migrations.AddField(
            model_name="formkitschemanode",
            name="children",
            field=models.ManyToManyField(
                blank=True,
                through="formkit_ninja.NodeChildren",
                to="formkit_ninja.formkitschemanode",
            ),
        ),
    ]
