from django.db import migrations, models
from django.db.models import Q


class Migration(migrations.Migration):

    dependencies = [
        ('ai', '0007_alter_adminaianalysis_options'),
    ]

    operations = [
        migrations.AddField(
            model_name='prompttemplate',
            name='language',
            field=models.CharField(
                choices=[('zh-hans', 'Chinese (Simplified)'), ('en', 'English')],
                default='zh-hans',
                help_text='Language for this prompt template',
                max_length=10,
                verbose_name='Language'
            ),
        ),
        migrations.AlterUniqueTogether(
            name='prompttemplate',
            unique_together={('divination_type', 'name', 'language')},
        ),
        migrations.AddConstraint(
            model_name='prompttemplate',
            constraint=models.UniqueConstraint(
                fields=('divination_type', 'language'),
                condition=Q(status='active'),
                name='unique_active_template_per_language'
            ),
        ),
    ]

