When I run alembic revision -m '...'
, Alembic generates a new .py script with the default body looking like this:
from alembic import op
# revision identifiers, used by Alembic.
revision = '1ce7873ac4ced2'
down_revision = '1cea0ac4ced2'
branch_labels = None
depends_on = None
def upgrade():
pass
def downgrade():
pass
Is it possible for me to specify my own template for those two functions' body, upgrade
and downgrade
? I know that I could always write some sort of wrapper for this alembic revision
command which would also substitute my desired function body for those two pass
keywords, but I was wondering if there's an "alembic" way to do that.