# Generated by Django 5.2.9 on 2026-01-11 00:42

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("groups", "0002_initial"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Recipe",
            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)),
                (
                    "uuid",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        help_text="Stable identifier used for natural keys and API references.",
                        unique=True,
                    ),
                ),
                (
                    "slug",
                    models.SlugField(
                        help_text="Unique slug used to call this recipe from CLI helpers.",
                        max_length=100,
                        unique=True,
                    ),
                ),
                (
                    "display",
                    models.CharField(max_length=150, verbose_name="Verbose name"),
                ),
                (
                    "script",
                    models.TextField(
                        help_text="Python script contents. [SIGILS] and [ARG.*] tokens are resolved before execution."
                    ),
                ),
                (
                    "result_variable",
                    models.CharField(
                        default="result",
                        help_text="Variable name expected to contain the final recipe result.",
                        max_length=64,
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "group",
                    models.ForeignKey(
                        blank=True,
                        help_text="Security group that owns this object.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to="groups.securitygroup",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        blank=True,
                        help_text="User that owns this object.",
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="+",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Recipe",
                "verbose_name_plural": "Recipes",
                "ordering": ("display",),
            },
        ),
    ]
