# Generated by Django 5.1.2 on 2025-01-22 10:05

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


def migrate_sex_values(apps, schema_editor):
    PersonModel = apps.get_model('core', 'Person')
    db_alias = schema_editor.connection.alias

    PersonModel.objects.using(db_alias).filter(sex='m').update(sex='M')
    PersonModel.objects.using(db_alias).filter(sex='f').update(sex='F')
    PersonModel.objects.using(db_alias).filter(sex='x').update(sex='X')


class Migration(migrations.Migration):

    dependencies = [
        ('core', '0073_datetime_constraints_rrule_until'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.AlterField(
            model_name='person',
            name='sex',
            field=models.CharField(blank=True, choices=[('F', 'female'), ('M', 'male'), ('X', 'other')], max_length=1, verbose_name='Sex'),
        ),
        migrations.RunPython(migrate_sex_values),
    ]
