# Generated by Django 3.1.13 on 2021-09-06 14:47

import django.core.serializers.json
from django.db import migrations, models
import django.db.models.deletion
import enumfields.fields
import security.enums

from security.backends.elasticsearch.models import (
    InputRequestLog, OutputRequestLog, CommandLog, CeleryTaskRunLog, CeleryTaskInvocationLog
)


def init_documents(apps, schema_editor):
    for document in InputRequestLog, OutputRequestLog, CommandLog, CeleryTaskRunLog, CeleryTaskInvocationLog:
        document._index.delete(ignore=404)
        document.init()


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.RunPython(init_documents),
    ]
