Using get_bind to get connection in the template
This commit is contained in:
parent
7e1bcd40a7
commit
562a025ac4
|
@ -6,7 +6,7 @@ Create Date: ${create_date}
|
||||||
|
|
||||||
"""
|
"""
|
||||||
from alembic import op
|
from alembic import op
|
||||||
import sqlalchemy as sa
|
from sqlalchemy.sql import text
|
||||||
${imports if imports else ""}
|
${imports if imports else ""}
|
||||||
|
|
||||||
# revision identifiers, used by Alembic.
|
# revision identifiers, used by Alembic.
|
||||||
|
@ -17,8 +17,8 @@ depends_on = ${repr(depends_on)}
|
||||||
|
|
||||||
|
|
||||||
def upgrade() -> None:
|
def upgrade() -> None:
|
||||||
${upgrades if upgrades else "pass"}
|
${upgrades if upgrades else "conn = op.get_bind()"}
|
||||||
|
|
||||||
|
|
||||||
def downgrade() -> None:
|
def downgrade() -> None:
|
||||||
${downgrades if downgrades else "pass"}
|
${downgrades if downgrades else "conn = op.get_bind()"}
|
||||||
|
|
Reference in a new issue