# Generated by Django 5.0.12 on 2025-03-07 14:58

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


class Migration(migrations.Migration):

    dependencies = [
        ("diarios", "0002_pdfdocument_page_content"),
    ]

    operations = [
        migrations.CreateModel(
            name="TipoDiarioOficial",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("nome", models.CharField(max_length=100, unique=True)),
            ],
            options={
                "verbose_name_plural": "Tipos de Diários Oficiais",
            },
        ),
        migrations.CreateModel(
            name="DiarioOficial",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("data", models.DateField()),
                (
                    "arquivo",
                    models.FileField(
                        blank=True, null=True, upload_to="diarios_oficiais/"
                    ),
                ),
                ("numero", models.CharField(max_length=20, unique=True)),
                ("link", models.URLField(blank=True, null=True, unique=True)),
                ("finalizado", models.BooleanField(default=False)),
                (
                    "tipo",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="diarios",
                        to="diarios.tipodiariooficial",
                    ),
                ),
            ],
            options={
                "verbose_name_plural": "Diários Oficiais",
            },
        ),
        migrations.AddConstraint(
            model_name="diariooficial",
            constraint=models.UniqueConstraint(
                fields=("numero",), name="unique_numero"
            ),
        ),
    ]
