# Generated by Django 4.2.3 on 2023-07-07 13:22

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


class Migration(migrations.Migration):
    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ("auth", "0012_alter_user_first_name_max_length"),
        ("secrets", "0030_sharedsecretdata_granted_on"),
    ]

    operations = [
        migrations.RemoveField(
            model_name="secret",
            name="allowed_groups",
        ),
        migrations.RemoveField(
            model_name="secret",
            name="allowed_users",
        ),
        migrations.AddField(
            model_name="secret",
            name="shared_groups",
            field=models.ManyToManyField(
                blank=True, through="secrets.SharedSecretData", to="auth.group"
            ),
        ),
        migrations.AddField(
            model_name="secret",
            name="shared_users",
            field=models.ManyToManyField(
                blank=True,
                through="secrets.SharedSecretData",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterField(
            model_name="sharedsecretdata",
            name="granted_by",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                related_name="+",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
        migrations.AlterField(
            model_name="sharedsecretdata",
            name="group",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="secret_share_data",
                to="auth.group",
            ),
        ),
        migrations.AlterField(
            model_name="sharedsecretdata",
            name="secret",
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                related_name="share_data",
                to="secrets.secret",
            ),
        ),
        migrations.AlterField(
            model_name="sharedsecretdata",
            name="user",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name="secret_share_data",
                to=settings.AUTH_USER_MODEL,
            ),
        ),
    ]
