# Generated by Django 3.2.16 on 2022-11-22 10:33

from django.db import migrations, models
import django.utils.timezone
import uuid


class Migration(migrations.Migration):

    initial = True

    operations = [
        migrations.CreateModel(
            name="Alert",
            fields=[
                (
                    "token",
                    models.UUIDField(
                        default=uuid.uuid4,
                        editable=False,
                        primary_key=True,
                        serialize=False,
                        verbose_name="Secret token",
                    ),
                ),
                ("email", models.EmailField(max_length=254, verbose_name="Email")),
                ("querystring", models.TextField(verbose_name="Querystring")),
                ("title", models.CharField(max_length=250, verbose_name="Title")),
                (
                    "alert_frequency",
                    models.CharField(
                        choices=[("daily", "Daily"), ("weekly", "Weekly")],
                        default="daily",
                        max_length=32,
                    ),
                ),
                (
                    "validated",
                    models.BooleanField(default=False, verbose_name="Confirmed?"),
                ),
                (
                    "latest_alert_date",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        verbose_name="Latest alert date",
                    ),
                ),
                (
                    "date_created",
                    models.DateTimeField(
                        default=django.utils.timezone.now, verbose_name="Date created"
                    ),
                ),
                (
                    "date_updated",
                    models.DateTimeField(auto_now=True, verbose_name="Date updated"),
                ),
                (
                    "date_validated",
                    models.DateTimeField(null=True, verbose_name="Date validated"),
                ),
            ],
            options={
                "verbose_name": "Alert",
                "verbose_name_plural": "Alerts",
            },
        ),
        migrations.AlterModelOptions(
            name="alert",
            options={
                "ordering": ["-date_created"],
                "verbose_name": "Alert",
                "verbose_name_plural": "Alerts",
            },
        ),
        migrations.AddField(
            model_name="alert",
            name="source",
            field=models.CharField(
                blank=True, default="", max_length=256, verbose_name="Source"
            ),
        ),
        migrations.AlterField(
            model_name="alert",
            name="alert_frequency",
            field=models.CharField(
                choices=[("daily", "Quotidiennement"), ("weekly", "Hebdomadairement")],
                default="daily",
                max_length=32,
            ),
        ),
    ]
