# Generated by Django 6.0.1 on 2026-02-04 02:47

from django.db import migrations, models


def convert_working_to_draft(apps, schema_editor):
    PartRevision = apps.get_model('bom', 'PartRevision')
    PartRevision.objects.filter(configuration='W').update(configuration='D')


def convert_draft_to_working(apps, schema_editor):
    PartRevision = apps.get_model('bom', 'PartRevision')
    PartRevision.objects.filter(configuration='D').update(configuration='W')


class Migration(migrations.Migration):

    dependencies = [
        ('bom', '0052_remove_partrevision_attribute_and_more'),
    ]

    operations = [
        migrations.AlterField(
            model_name='partrevision',
            name='configuration',
            field=models.CharField(choices=[('D', 'Draft'), ('I', 'In Review'), ('R', 'Released'), ('O', 'Obsolete')], default='D', max_length=1),
        ),
        migrations.RunPython(convert_working_to_draft, convert_draft_to_working),
    ]
