# Generated by Django 5.1 on 2024-09-11 16:37

from django.db import migrations, models


def migrate_order_from_1_to_0(apps, schema_editor):
    Constituenta = apps.get_model('rsform', 'Constituenta')
    for cst in Constituenta.objects.all():
        cst.order = max(0, cst.order - 1)
        cst.save()


class Migration(migrations.Migration):

    dependencies = [
        ('rsform', '0002_alter_constituenta_order'),
    ]

    operations = [
        migrations.AlterField(
            model_name='constituenta',
            name='order',
            field=models.PositiveIntegerField(default=0, verbose_name='Позиция'),
        ),
        migrations.RunPython(migrate_order_from_1_to_0),
    ]
