# Generated by Django 2.2.7 on 2020-01-06 17:15

from django.db import migrations, models


class Migration(migrations.Migration):
    atomic = False

    dependencies = [
        ("mds", "0002_pre_compliance_extra"),
    ]

    operations = [
        migrations.SeparateDatabaseAndState(
            database_operations=[
                migrations.RunSQL(
                    """CREATE INDEX CONCURRENTLY IF NOT EXISTS "device_mds_events_partial" ON "mds_eventrecord" ("device_id") WHERE NOT ("event_type" = 'telemetry')"""
                )
            ],
            state_operations=[
                migrations.AddIndex(
                    model_name="eventrecord",
                    index=models.Index(
                        condition=models.Q(_negated=True, event_type="telemetry"),
                        fields=["device"],
                        name="device_mds_events_partial",
                    ),
                ),
            ],
        ),
    ]
