# Generated by Django 4.2.9 on 2024-06-03 8:06
from django.db import migrations


def update_line_num_allocated(apps, schema_editor):
    Line = apps.get_model("order", "Line")
    for line in Line.objects.all():
        if line.num_allocated is None:
            line.num_allocated = line.quantity
            line.save(update_fields=["num_allocated"])


class Migration(migrations.Migration):
    dependencies = [
        ('order', '0016_line_allocation_cancelled_line_num_allocated'),
    ]

    operations = [
        migrations.RunPython(update_line_num_allocated, migrations.RunPython.noop),
    ]
