# Generated by Django 5.2.8 on 2025-11-25 18:59

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


class Migration(migrations.Migration):

    dependencies = [
        ("core", "0115_reference_validated_url_at_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="AdminCommandResult",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("command", models.TextField()),
                ("resolved_command", models.TextField()),
                ("command_name", models.CharField(blank=True, max_length=150)),
                ("stdout", models.TextField(blank=True)),
                ("stderr", models.TextField(blank=True)),
                ("traceback", models.TextField(blank=True)),
                ("runtime", models.DurationField(default=datetime.timedelta)),
                ("exit_code", models.IntegerField(default=0)),
                ("success", models.BooleanField(default=False)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "user",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        related_name="command_results",
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
            options={
                "verbose_name": "Command Result",
                "verbose_name_plural": "Command Results",
                "ordering": ("-created_at",),
            },
        ),
    ]
