# Generated by Django 5.2 on 2025-09-15 17:50

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
        ('api', '0128_remove_browserllmtier_uniq_browser_tier_order_per_policy_and_more'),
    ]

    operations = [
        # Make constraint drops safe on DBs where they were never created,
        # while still updating Django's migration state to remove them.
        migrations.SeparateDatabaseAndState(
            database_operations=[
                migrations.RunSQL(
                    sql=(
                        "ALTER TABLE api_browserllmtier DROP CONSTRAINT IF EXISTS uniq_browser_tier_order_per_policy;"
                    ),
                    reverse_sql=migrations.RunSQL.noop,
                ),
                migrations.RunSQL(
                    sql=(
                        "ALTER TABLE api_browsertierendpoint DROP CONSTRAINT IF EXISTS uniq_browser_endpoint_per_tier;"
                    ),
                    reverse_sql=migrations.RunSQL.noop,
                ),
                migrations.RunSQL(
                    sql=(
                        "ALTER TABLE api_persistentllmtier DROP CONSTRAINT IF EXISTS uniq_persistent_tier_order_per_range;"
                    ),
                    reverse_sql=migrations.RunSQL.noop,
                ),
                migrations.RunSQL(
                    sql=(
                        "ALTER TABLE api_persistenttierendpoint DROP CONSTRAINT IF EXISTS uniq_persistent_endpoint_per_tier;"
                    ),
                    reverse_sql=migrations.RunSQL.noop,
                ),
            ],
            state_operations=[
                migrations.RemoveConstraint(
                    model_name='browserllmtier',
                    name='uniq_browser_tier_order_per_policy',
                ),
                migrations.RemoveConstraint(
                    model_name='browsertierendpoint',
                    name='uniq_browser_endpoint_per_tier',
                ),
                migrations.RemoveConstraint(
                    model_name='persistentllmtier',
                    name='uniq_persistent_tier_order_per_range',
                ),
                migrations.RemoveConstraint(
                    model_name='persistenttierendpoint',
                    name='uniq_persistent_endpoint_per_tier',
                ),
            ],
        ),
    ]
