# Generated by Django 3.1.7 on 2021-11-04 14:53

from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):

    dependencies = [
        ("account", "0002_add_serviceaccount_api_token"),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("repository", "0026_add_unique_constraints"),
    ]

    operations = [
        migrations.RemoveConstraint(
            model_name="uploaderidentitymember",
            name="one_membership_per_user",
        ),
        migrations.RenameModel(
            old_name="UploaderIdentity",
            new_name="Team",
        ),
        migrations.RenameModel(
            old_name="UploaderIdentityMember",
            new_name="TeamMember",
        ),
        migrations.RenameField(
            model_name="teammember",
            old_name="identity",
            new_name="team",
        ),
        migrations.AddConstraint(
            model_name="teammember",
            constraint=models.UniqueConstraint(
                fields=("user", "team"), name="one_membership_per_user"
            ),
        ),
        migrations.AlterModelOptions(
            name="team",
            options={"verbose_name": "Team", "verbose_name_plural": "Teams"},
        ),
        migrations.AlterModelOptions(
            name="teammember",
            options={
                "verbose_name": "Team Member",
                "verbose_name_plural": "Team Members",
            },
        ),
        migrations.AlterField(
            model_name="teammember",
            name="user",
            field=models.ForeignKey(
                on_delete=models.deletion.CASCADE,
                related_name="teams",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
    ]
