Improve mako template for migrations.
This commit is contained in:
parent
ea83ca3610
commit
4b6c52dce6
@ -6,19 +6,27 @@ Create Date: ${create_date}
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = ${repr(up_revision)} # flake8: noqa
|
||||
down_revision = ${repr(down_revision)} # flake8: noqa
|
||||
branch_labels = ${repr(branch_labels)} # flake8: noqa
|
||||
depends_on = ${repr(depends_on)} # flake8: noqa
|
||||
# pylint: disable=no-member
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
# revision identifiers, used by Alembic.
|
||||
# pylint: disable=invalid-name
|
||||
revision = ${repr(up_revision)}
|
||||
down_revision = ${repr(down_revision)}
|
||||
branch_labels = ${repr(branch_labels)}
|
||||
depends_on = ${repr(depends_on)}
|
||||
# pylint: enable=invalid-name
|
||||
|
||||
# pylint: disable=wrong-import-position
|
||||
from alembic import op # noqa
|
||||
import sqlalchemy as sa # noqa
|
||||
${imports if imports else ""}
|
||||
# pylint: enable=wrong-import-position
|
||||
|
||||
def upgrade():
|
||||
"""Upgrades for revision ${up_revision}"""
|
||||
${upgrades if upgrades else "pass"}
|
||||
|
||||
|
||||
def downgrade():
|
||||
"""Downgrades for revision ${up_revision}"""
|
||||
${downgrades if downgrades else "pass"}
|
||||
|
Loading…
Reference in New Issue
Block a user