# Generated by Django 6.0 on 2026-04-10 14:20

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


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0345_add_user_trial_eligibility_one_per_user_flag'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='UserFlagDefinition',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('slug', models.SlugField(help_text="Stable identifier used in code and admin search, for example 'example_flag'.", max_length=64, unique=True)),
                ('description', models.TextField(help_text='Human-readable explanation of what this flag means.')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'User flag definition',
                'verbose_name_plural': 'User flag definitions',
                'ordering': ('slug',),
            },
        ),
        migrations.CreateModel(
            name='UserFlagAssignment',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_flag_assignments', to=settings.AUTH_USER_MODEL)),
                ('flag', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_assignments', to='api.userflagdefinition')),
            ],
            options={
                'verbose_name': 'User flag assignment',
                'verbose_name_plural': 'User flag assignments',
                'constraints': [models.UniqueConstraint(fields=('user', 'flag'), name='unique_user_flag_assignment')],
            },
        ),
    ]
