# Generated by Django 4.2.21 on 2025-06-24 13:34
# FileHash: 8d069529c20fce63ddd45711b014cbb6603be30c2d45108b10881480c49cfbcc

import ansible_base.feature_flags.models.aap_flag
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='AAPFlag',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('modified', models.DateTimeField(auto_now=True, help_text='The date/time this resource was created.')),
                ('created', models.DateTimeField(auto_now_add=True, help_text='The date/time this resource was created.')),
                ('name', models.CharField(help_text='The name of the feature flag. Must follow the format of FEATURE_<flag-name>_ENABLED.', max_length=64, validators=[ansible_base.feature_flags.models.aap_flag.validate_feature_flag_name])),
                ('ui_name', models.CharField(help_text='The pretty name to display in the application User Interface', max_length=64)),
                ('condition', models.CharField(default='boolean', help_text='Used to specify a condition, which if met, will enable the feature flag.', max_length=64)),
                ('value', models.CharField(default='False', help_text='The value used to evaluate the conditional specified.', max_length=127)),
                ('required', models.BooleanField(default=False, help_text="If multiple conditions are required to be met to enable a feature flag, 'required' can be used to specify the necessary conditionals.")),
                ('support_level', models.CharField(choices=[('DEVELOPER_PREVIEW', 'Developer Preview'), ('TECHNOLOGY_PREVIEW', 'Technology Preview')], editable=False, help_text='The support criteria for the feature flag. Must be one of (DEVELOPER_PREVIEW or TECHNOLOGY_PREVIEW).', max_length=25)),
                ('visibility', models.BooleanField(default=False, help_text='Controls whether the feature is visible in the UI.')),
                ('toggle_type', models.CharField(choices=[('install-time', 'install-time'), ('run-time', 'run-time')], default='run-time', help_text="Details whether a flag is toggle-able at run-time or install-time. (Default: 'run-time').", max_length=20)),
                ('description', models.CharField(default='', help_text='A detailed description giving an overview of the feature flag.', max_length=500)),
                ('support_url', models.CharField(blank=True, default='', help_text='A link to the documentation support URL for the feature', max_length=250)),
                ('labels', models.JSONField(blank=True, default=list, help_text='A list of labels for the feature flag.', null=True, validators=[ansible_base.feature_flags.models.aap_flag.validate_labels])),
                ('created_by', models.ForeignKey(default=None, editable=False, help_text='The user who created this resource.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_created+', to=settings.AUTH_USER_MODEL)),
                ('modified_by', models.ForeignKey(default=None, editable=False, help_text='The user who last modified this resource.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(app_label)s_%(class)s_modified+', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'unique_together': {('name', 'condition')},
            },
        ),
    ]
