# Generated by Django 5.1.2 on 2024-10-16 00:53

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


class Migration(migrations.Migration):

    dependencies = [
        ("meta_reports", "0051_remove_endpoints_baseline_datetime_and_more"),
        ("sites", "0002_alter_domain_unique"),
    ]

    operations = [
        migrations.CreateModel(
            name="LastImpVisit",
            fields=[
                (
                    "id",
                    models.BigAutoField(
                        auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
                    ),
                ),
                ("report_model", models.CharField(max_length=50)),
                ("subject_identifier", models.CharField(max_length=25)),
                ("created", models.DateTimeField(default=edc_utils.date.get_utcnow)),
                ("reference_date", models.DateField(null=True)),
                ("imp_visit_code", models.FloatField(null=True)),
                ("imp_visit_date", models.DateField(null=True)),
                ("next_visit_code", models.FloatField(null=True)),
                ("next_appt_date", models.DateField(null=True)),
                ("visit_code", models.CharField(max_length=15, null=True)),
                ("visit_code_sequence", models.IntegerField(null=True)),
                ("days_since", models.IntegerField(null=True)),
                ("days_until", models.IntegerField(null=True)),
                (
                    "site",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.DO_NOTHING, to="sites.site"
                    ),
                ),
            ],
            options={
                "verbose_name": "Last IMP Visit",
                "verbose_name_plural": "Last IMP Visits",
                "abstract": False,
                "default_permissions": ("view", "export", "viewallsites"),
                "indexes": [
                    models.Index(
                        fields=["subject_identifier", "site"],
                        name="meta_report_subject_4a9e15_idx",
                    )
                ],
            },
        ),
    ]
