# Generated by Django 3.1.7 on 2021-10-12 10:39
import os

from django.db import connection, migrations


def load_triggers(apps, schema_editor):
    file_names = ["triggers_entity.sql"]
    with connection.cursor() as c:
        for file_name in file_names:
            file_path = os.path.join(os.path.dirname(__file__), file_name)
            with open(file_path) as fh:
                sql_statement = fh.read()
            c.execute(sql_statement)


class Migration(migrations.Migration):
    dependencies = [("flow", "0023_remove_entity_descriptor_and_more")]

    operations = [migrations.RunPython(load_triggers)]
