Using get_bind to get connection in the template

This commit is contained in:
LoRiot 2022-10-22 15:11:11 +03:00
parent 7e1bcd40a7
commit 562a025ac4

View file

@ -6,7 +6,7 @@ Create Date: ${create_date}
"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.sql import text
${imports if imports else ""}
# revision identifiers, used by Alembic.
@ -17,8 +17,8 @@ depends_on = ${repr(depends_on)}
def upgrade() -> None:
${upgrades if upgrades else "pass"}
${upgrades if upgrades else "conn = op.get_bind()"}
def downgrade() -> None:
${downgrades if downgrades else "pass"}
${downgrades if downgrades else "conn = op.get_bind()"}