# Generated by Django 6.0.7 on 2026-07-23 12:44

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("customer", "__first__"),
        ("sites", "0002_alter_domain_unique"),
    ]

    operations = [
        migrations.CreateModel(
            name="SystemLog",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        primary_key=True,
                        serialize=False,
                        unique=True,
                        verbose_name="model.field.id",
                    ),
                ),
                (
                    "level",
                    models.CharField(
                        choices=[
                            ("debug", "enum.log-level.debug"),
                            ("info", "enum.log-level.info"),
                            ("success", "enum.log-level.success"),
                            ("warning", "enum.log-level.warning"),
                            ("error", "enum.log-level.error"),
                        ],
                        default="debug",
                        max_length=255,
                        verbose_name="model.field.level",
                    ),
                ),
                (
                    "category",
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        verbose_name="model.field.category",
                    ),
                ),
                (
                    "description",
                    models.TextField(verbose_name="model.field.description"),
                ),
                (
                    "created_at",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="model.field.created-at"
                    ),
                ),
                (
                    "customer",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="system_logs",
                        to="customer.customer",
                        verbose_name="model.field.customer",
                    ),
                ),
                (
                    "site",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="system_logs",
                        to="sites.site",
                        verbose_name="model.field.site",
                    ),
                ),
            ],
            options={
                "verbose_name": "model.system-log.name",
                "verbose_name_plural": "model.system-log.name.plural",
                "db_table": "system_log",
                "indexes": [
                    models.Index(fields=["level"], name="system_log_level"),
                    models.Index(fields=["category"], name="system_log_category"),
                    models.Index(fields=["created_at"], name="system_log_created_at"),
                ],
            },
        ),
    ]
