# Generated by Django 4.1.7 on 2023-04-17 14:03

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone


class Migration(migrations.Migration):
    dependencies = [
        ("blog", "0007_promotionpost_external_link_and_more"),
        ("programs", "0014_program_is_spotlighted"),
        ("projects", "0016_alter_project_due_date_and_more"),
        ("geofr", "0044_perimeter_density_typology_perimeter_insee_and_more"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("organizations", "0013_organization_density_typology_and_more"),
        ("keywords", "0002_synonymlist_model"),
        ("backers", "0015_backer_perimeter"),
        ("stats", "0035_aidsearchevent_organization_aidsearchevent_user"),
    ]

    operations = [
        migrations.CreateModel(
            name="ValidatedProjectSearchEvent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "text",
                    models.CharField(
                        blank=True,
                        default="",
                        max_length=256,
                        verbose_name="Recherche textuelle",
                    ),
                ),
                ("querystring", models.TextField(verbose_name="Querystring")),
                (
                    "results_count",
                    models.PositiveIntegerField(
                        default=0, verbose_name="Nombre de résultats"
                    ),
                ),
                (
                    "date_created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        verbose_name="Date de création",
                    ),
                ),
                (
                    "organization",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="organizations.organization",
                        verbose_name="Structure",
                    ),
                ),
                (
                    "perimeter",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="geofr.perimeter",
                        verbose_name="Périmètre",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Utilisateur",
                    ),
                ),
            ],
            options={
                "verbose_name": "Événement recherche projets subventionnés",
                "verbose_name_plural": "Événements recherche projets subventionnés",
            },
        ),
        migrations.CreateModel(
            name="PublicProjectViewEvent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "date_created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        verbose_name="Date de création",
                    ),
                ),
                (
                    "organization",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="organizations.organization",
                        verbose_name="Structure",
                    ),
                ),
                (
                    "project",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="projects.project",
                        verbose_name="Projet public",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Utilisateur",
                    ),
                ),
            ],
            options={
                "verbose_name": "Événement projet public vu",
                "verbose_name_plural": "Événements projet public vu",
            },
        ),
        migrations.CreateModel(
            name="PublicProjectSearchEvent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("querystring", models.TextField(verbose_name="Querystring")),
                (
                    "results_count",
                    models.PositiveIntegerField(
                        default=0, verbose_name="Nombre de résultats"
                    ),
                ),
                (
                    "date_created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        verbose_name="Date de création",
                    ),
                ),
                (
                    "organization",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="organizations.organization",
                        verbose_name="Structure",
                    ),
                ),
                (
                    "perimeter",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.PROTECT,
                        to="geofr.perimeter",
                        verbose_name="Périmètre",
                    ),
                ),
                (
                    "project_types",
                    models.ManyToManyField(
                        blank=True,
                        related_name="public_project_search_events",
                        to="keywords.synonymlist",
                        verbose_name="Types de projet",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Utilisateur",
                    ),
                ),
            ],
            options={
                "verbose_name": "Événement recherche projets publics",
                "verbose_name_plural": "Événements recherche projets publics",
            },
        ),
        migrations.CreateModel(
            name="ProgramViewEvent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "source",
                    models.CharField(default="", max_length=256, verbose_name="Source"),
                ),
                (
                    "date_created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        verbose_name="Date de création",
                    ),
                ),
                (
                    "organization",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="organizations.organization",
                        verbose_name="Structure",
                    ),
                ),
                (
                    "program",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="programs.program",
                        verbose_name="Programme",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Utilisateur",
                    ),
                ),
            ],
            options={
                "verbose_name": "Événement programme vu",
                "verbose_name_plural": "Événements programmes vus",
            },
        ),
        migrations.CreateModel(
            name="PostViewEvent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "date_created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        verbose_name="Date de création",
                    ),
                ),
                (
                    "organization",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="organizations.organization",
                        verbose_name="Structure",
                    ),
                ),
                (
                    "post",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="blog.blogpost",
                        verbose_name="article de blog",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Utilisateur",
                    ),
                ),
            ],
            options={
                "verbose_name": "Événement article de blog vu",
                "verbose_name_plural": "Événements articles de blog vus",
            },
        ),
        migrations.CreateModel(
            name="BackerViewEvent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "source",
                    models.CharField(default="", max_length=256, verbose_name="Source"),
                ),
                (
                    "date_created",
                    models.DateTimeField(
                        default=django.utils.timezone.now,
                        verbose_name="Date de création",
                    ),
                ),
                (
                    "backer",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="backers.backer",
                        verbose_name="Porteur",
                    ),
                ),
                (
                    "organization",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to="organizations.organization",
                        verbose_name="Structure",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        blank=True,
                        null=True,
                        on_delete=django.db.models.deletion.SET_NULL,
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="Utilisateur",
                    ),
                ),
            ],
            options={
                "verbose_name": "Événement porteur vu",
                "verbose_name_plural": "Événements porteurs vus",
            },
        ),
    ]
