# Generated by Django 4.2.10 on 2024-03-07 23:06

import django.contrib.sites.managers
from django.db import migrations, models
import edc_consent.managers


class Migration(migrations.Migration):

    dependencies = [
        ("meta_consent", "0022_alter_historicalsubjectconsent_site_and_more"),
    ]

    operations = [
        migrations.CreateModel(
            name="SubjectConsentV1",
            fields=[],
            options={
                "verbose_name": "Consent V1",
                "verbose_name_plural": "Consent V1",
                "proxy": True,
                "indexes": [],
                "constraints": [],
            },
            bases=("meta_consent.subjectconsent",),
            managers=[
                ("objects", edc_consent.managers.ConsentObjectsByCdefManager()),
                ("on_site", django.contrib.sites.managers.CurrentSiteManager()),
            ],
        ),
        migrations.RemoveConstraint(
            model_name="subjectconsent",
            name="meta_consent_subjectconsent_version_uniq",
        ),
        migrations.RenameField(
            model_name="historicalsubjectconsent",
            old_name="updates_versions",
            new_name="update_versions",
        ),
        migrations.RenameField(
            model_name="subjectconsent",
            old_name="updates_versions",
            new_name="update_versions",
        ),
        migrations.AddField(
            model_name="historicalsubjectconsent",
            name="consent_definition_name",
            field=models.CharField(
                editable=False, max_length=50, null=True, verbose_name="Consent definition"
            ),
        ),
        migrations.AddField(
            model_name="subjectconsent",
            name="consent_definition_name",
            field=models.CharField(
                editable=False, max_length=50, null=True, verbose_name="Consent definition"
            ),
        ),
        migrations.AlterField(
            model_name="historicalsubjectconsent",
            name="version",
            field=models.CharField(
                editable=False,
                help_text="See 'consent definition' for consent versions by period.",
                max_length=10,
                verbose_name="Consent version",
            ),
        ),
        migrations.AlterField(
            model_name="subjectconsent",
            name="version",
            field=models.CharField(
                editable=False,
                help_text="See 'consent definition' for consent versions by period.",
                max_length=10,
                verbose_name="Consent version",
            ),
        ),
        migrations.AddConstraint(
            model_name="subjectconsent",
            constraint=models.UniqueConstraint(
                fields=("version", "screening_identifier", "subject_identifier"),
                name="meta_consent_subjectconsent_version_uniq",
            ),
        ),
    ]
