# Generated by Django 6.0.5 on 2026-07-20 15:42

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


class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name="Account",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=15, unique=True)),
                ("jwk", models.TextField(blank=True)),
                ("alg", models.CharField(max_length=10)),
                ("contact", models.CharField(max_length=255)),
                ("eab_kid", models.TextField(blank=True, max_length=255)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name="Cahandler",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=50, unique=True)),
                ("value1", models.CharField(blank=True, max_length=250)),
                ("value2", models.CharField(blank=True, max_length=250)),
                (
                    "created_at",
                    models.DateTimeField(
                        auto_now_add=True, null=True, verbose_name="value"
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Cliaccount",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=15, unique=True)),
                ("jwk", models.TextField(blank=True)),
                ("contact", models.CharField(max_length=255)),
                ("reportadmin", models.BooleanField(default=False)),
                ("cliadmin", models.BooleanField(default=False)),
                ("certificateadmin", models.BooleanField(default=False)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name="Housekeeping",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=30, unique=True)),
                ("value", models.CharField(blank=True, max_length=30)),
                (
                    "modified_at",
                    models.DateTimeField(
                        auto_now_add=True, null=True, verbose_name="value"
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Nonce",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("nonce", models.CharField(max_length=50)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name="Status",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=15, unique=True)),
            ],
        ),
        migrations.CreateModel(
            name="Order",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=15, unique=True)),
                ("notbefore", models.IntegerField(default=0)),
                ("notafter", models.IntegerField(default=0)),
                ("identifiers", models.TextField()),
                ("profile", models.TextField(blank=True)),
                ("expires", models.IntegerField(default=0)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "account",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="acme_srv.account",
                    ),
                ),
                (
                    "status",
                    models.ForeignKey(
                        default=2,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="acme_srv.status",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Certificate",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=15, unique=True)),
                ("csr", models.TextField(blank=True, null=True)),
                ("cert", models.TextField(blank=True, null=True)),
                ("cert_raw", models.TextField(blank=True, null=True)),
                ("error", models.TextField(blank=True, null=True)),
                ("poll_identifier", models.TextField(blank=True, null=True)),
                ("expire_uts", models.IntegerField(default=0)),
                ("issue_uts", models.IntegerField(default=0)),
                ("renewal_info", models.TextField(blank=True, null=True)),
                ("aki", models.TextField(blank=True, null=True)),
                ("serial", models.TextField(blank=True, null=True)),
                ("replaced", models.BooleanField(default=False)),
                ("header_info", models.TextField(blank=True, null=True)),
                ("created_at", models.DateTimeField(auto_now_add=True, null=True)),
                (
                    "order",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="acme_srv.order"
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Authorization",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=15, unique=True)),
                ("type", models.CharField(max_length=5)),
                ("value", models.TextField()),
                ("token", models.CharField(blank=True, max_length=64)),
                ("expires", models.IntegerField(default=0)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "order",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE, to="acme_srv.order"
                    ),
                ),
                (
                    "status",
                    models.ForeignKey(
                        default=1,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="acme_srv.status",
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="Challenge",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=15, unique=True)),
                ("type", models.CharField(max_length=15)),
                ("token", models.CharField(max_length=64)),
                ("expires", models.IntegerField(default=0)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("keyauthorization", models.CharField(blank=True, max_length=128)),
                ("source", models.CharField(blank=True, max_length=128)),
                ("validated", models.IntegerField(default=0)),
                ("validation_error", models.TextField(blank=True)),
                (
                    "authorization",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="acme_srv.authorization",
                    ),
                ),
                (
                    "status",
                    models.ForeignKey(
                        default=2,
                        on_delete=django.db.models.deletion.CASCADE,
                        to="acme_srv.status",
                    ),
                ),
            ],
        ),
        migrations.AddField(
            model_name="account",
            name="status",
            field=models.ForeignKey(
                default=5,
                on_delete=django.db.models.deletion.CASCADE,
                to="acme_srv.status",
            ),
        ),
    ]
