# Generated by Django 5.2.3 on 2025-07-08 20:37
from django.core.exceptions import ObjectDoesNotExist
from django.db import migrations
from sequences.models import Sequence


def update_sequences(apps, schema_editor):
    try:
        obj = Sequence.objects.get(name="edc_pharmacy.stocktransferconfirmation")
    except ObjectDoesNotExist:
        pass
    else:
        obj.name = "edc_pharmacy.confirmationatsite"
        obj.save()
    try:
        obj = Sequence.objects.get(name="edc_pharmacy.stocktransferconfirmationitem")
    except ObjectDoesNotExist:
        pass
    else:
        obj.name = "edc_pharmacy.confirmationatsiteitem"
        obj.save()


class Migration(migrations.Migration):

    dependencies = [
        ("sequences", "0002_alter_sequence_last"),
        ("edc_pharmacy", "0085_alter_confirmationatsite_options_and_more"),
    ]

    operations = [migrations.RunPython(update_sequences)]
