# Generated by Django 5.1.8 on 2025-05-12 10:04

from django.contrib.postgres.operations import AddIndexConcurrently
from django.db import migrations, models


class Migration(migrations.Migration):
    atomic = False

    dependencies = [
        ("api", "0021_findings_new_performance_indexes_parent"),
        ("django_celery_beat", "0019_alter_periodictasks_options"),
    ]

    operations = [
        AddIndexConcurrently(
            model_name="scan",
            index=models.Index(
                condition=models.Q(("state", "completed")),
                fields=["tenant_id", "provider_id", "state", "-inserted_at"],
                name="scans_prov_state_ins_desc_idx",
            ),
        ),
        AddIndexConcurrently(
            model_name="scansummary",
            index=models.Index(
                fields=["tenant_id", "scan_id", "service"],
                name="ss_tenant_scan_service_idx",
            ),
        ),
        AddIndexConcurrently(
            model_name="scansummary",
            index=models.Index(
                fields=["tenant_id", "scan_id", "severity"],
                name="ss_tenant_scan_severity_idx",
            ),
        ),
    ]
