"""${message}

Revision ID: ${up_revision}
Revises: ${down_revision}
Create Date: ${create_date}

"""

# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}

from alembic import op
import sqlalchemy as sa
${imports if imports else ""}

def upgrade():
    ${upgrades if upgrades else "pass"}


def downgrade():
    ${downgrades if downgrades else "pass"}

"""${message}

Revision ID: ${up_revision}
Revises: ${down_revision}
Create Date: ${create_date}

"""

from alembic import op
import sqlalchemy as sa
${imports if imports else ""}

# revision identifiers, used by Alembic.
revision = ${repr(up_revision)}
down_revision = ${repr(down_revision)}
branch_labels = ${repr(branch_labels)}


def upgrade():
    ${upgrades if upgrades else "pass"}


def downgrade():
    ${downgrades if downgrades else "pass"}

Fix pep8 error in migrations template
Fix pep8 error in migrations template

script.py.mako is used as a template for new migration scripts, but
previously did not conform to the pep8 tool's expectations. In
particular, the imports should have been at the top of the module.
script.py.mako is not itself checked by pep8 (and can't be, since the
templating language is not valid python), but the generated scripts are,
and it was generating scripts that would fail the pep8 checks.

The template has been modified to generate scripts closer to pep8
compliance, but note that alembic still does things like generate very
long lines, which can't be fixed in the template.
