# Generated by Django 3.2.12 on 2022-02-07 13:59

import django.core.validators
import django_countries.fields
import jasmin_ldap_django.models
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("jasmin_services", "0016_new_grant_clean"),
    ]

    operations = [
        migrations.CreateModel(
            name="CedaLdapGroup",
            fields=[
                (
                    "name",
                    jasmin_ldap_django.models.CharField(
                        db_column="cn",
                        error_messages={
                            "max_length": "Name must have at most %(limit_value)d characters.",
                            "unique": "Name is already in use.",
                        },
                        max_length=50,
                        primary_key=True,
                        serialize=False,
                        validators=[
                            django.core.validators.RegexValidator(
                                message="Name must start with a letter.",
                                regex="^[a-zA-Z]",
                            ),
                            django.core.validators.RegexValidator(
                                message="Name must end with a letter or number.",
                                regex="[a-zA-Z0-9]$",
                            ),
                            django.core.validators.RegexValidator(
                                message="Name must contain letters, numbers, _ and -.",
                                regex="^[a-zA-Z0-9_-]+$",
                            ),
                        ],
                    ),
                ),
                (
                    "description",
                    jasmin_ldap_django.models.TextField(blank=True, db_column="description"),
                ),
                (
                    "member_uids",
                    jasmin_ldap_django.models.ListField(blank=True, db_column="memberUid"),
                ),
                (
                    "gidNumber",
                    jasmin_ldap_django.models.PositiveIntegerField(blank=True, unique=True),
                ),
            ],
            options={
                "verbose_name": "CEDA LDAP Group",
                "verbose_name_plural": None,
                "ordering": ["name"],
                "abstract": False,
                "managed": False,
            },
        ),
        migrations.CreateModel(
            name="CloudTenancyLdapGroup",
            fields=[
                (
                    "name",
                    jasmin_ldap_django.models.CharField(
                        db_column="cn",
                        error_messages={
                            "max_length": "Name must have at most %(limit_value)d characters.",
                            "unique": "Name is already in use.",
                        },
                        max_length=50,
                        primary_key=True,
                        serialize=False,
                        validators=[
                            django.core.validators.RegexValidator(
                                message="Name must start with a letter.",
                                regex="^[a-zA-Z]",
                            ),
                            django.core.validators.RegexValidator(
                                message="Name must end with a letter or number.",
                                regex="[a-zA-Z0-9]$",
                            ),
                            django.core.validators.RegexValidator(
                                message="Name must contain letters, numbers, _ and -.",
                                regex="^[a-zA-Z0-9_-]+$",
                            ),
                        ],
                    ),
                ),
                (
                    "description",
                    jasmin_ldap_django.models.TextField(blank=True, db_column="description"),
                ),
                (
                    "member_uids",
                    jasmin_ldap_django.models.ListField(blank=True, db_column="memberUid"),
                ),
                (
                    "gidNumber",
                    jasmin_ldap_django.models.PositiveIntegerField(blank=True, unique=True),
                ),
            ],
            options={
                "verbose_name": "Cloud Tenancy LDAP Group",
                "verbose_name_plural": None,
                "ordering": ["name"],
                "abstract": False,
                "managed": False,
            },
        ),
        migrations.RemoveIndex(
            model_name="grant",
            name="jasmin_serv_role_id_f8ad17_idx",
        ),
        migrations.AlterField(
            model_name="access",
            name="id",
            field=models.AutoField(primary_key=True, serialize=False),
        ),
        migrations.AlterField(
            model_name="behaviour",
            name="id",
            field=models.AutoField(primary_key=True, serialize=False),
        ),
        migrations.AlterField(
            model_name="category",
            name="id",
            field=models.AutoField(primary_key=True, serialize=False),
        ),
        migrations.AlterField(
            model_name="grant",
            name="id",
            field=models.AutoField(primary_key=True, serialize=False),
        ),
        migrations.AlterField(
            model_name="request",
            name="id",
            field=models.AutoField(primary_key=True, serialize=False),
        ),
        migrations.AlterField(
            model_name="role",
            name="id",
            field=models.AutoField(primary_key=True, serialize=False),
        ),
        migrations.AlterField(
            model_name="roleobjectpermission",
            name="id",
            field=models.AutoField(primary_key=True, serialize=False),
        ),
        migrations.AlterField(
            model_name="service",
            name="id",
            field=models.AutoField(primary_key=True, serialize=False),
        ),
        migrations.AlterField(
            model_name="service",
            name="instution_countries",
            field=django_countries.fields.CountryField(
                blank=True,
                help_text="Coutries a user's institute must be located to begin approval. Hold ctrl or cmd for mac to select multiple countries. Leave blank for any country.",
                max_length=747,
                multiple=True,
            ),
        ),
        migrations.AddIndex(
            model_name="grant",
            index=models.Index(
                fields=["access", "granted_at"], name="jasmin_serv_access__a210bd_idx"
            ),
        ),
    ]
