from piccolo.apps.migrations.auto.migration_manager import MigrationManager
{% for extra_import in extra_imports -%}
{{ extra_import }}
{% endfor %}


{% for extra_definition in extra_definitions -%}
{{ extra_definition }}
{% endfor %}


ID = '{{ migration_id }}'
VERSION = '{{ version }}'
DESCRIPTION = '{{ description }}'


async def forwards():
    manager = MigrationManager(migration_id=ID, app_name="{{ app_name }}", description=DESCRIPTION)
    {% if auto %}
    {% for alter_statement in alter_statements %}
    {{ alter_statement }}
    {% endfor %}
    {% else %}
    def run():
        print(f"running {ID}")

    manager.add_raw(run)
    {% endif %}
    return manager
