# Generated by Django 3.0.6 on 2020-06-12 17:26
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("authens", "0001_initial"),
    ]

    operations = [
        migrations.CreateModel(
            name="OldCASAccount",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "cas_login",
                    models.CharField(max_length=1023, verbose_name="ancien login CAS"),
                ),
                (
                    "entrance_year",
                    models.SmallIntegerField(
                        verbose_name="année de création du compte CAS"
                    ),
                ),
                (
                    "user",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="old_cas_account",
                        to=settings.AUTH_USER_MODEL,
                        verbose_name="utilisateurice",
                    ),
                ),
            ],
            options={
                "verbose_name": "Ancien compte CAS",
                "verbose_name_plural": "Anciens comptes CAS",
            },
        ),
        migrations.AddConstraint(
            model_name="oldcasaccount",
            constraint=models.UniqueConstraint(
                fields=("cas_login", "entrance_year"), name="clipper_year_uniqueness"
            ),
        ),
    ]
