Skip to content

importing sqlmodel into version file in case of using sqlmodel as ORM #1404

Discussion options

You must be logged in to vote

My script.py.mako file after update.

"""${message}

Revision ID: ${up_revision}
Revises: ${down_revision | comma,n}
Create Date: ${create_date}

"""
from typing import Sequence, Union

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

# revision identifiers, used by Alembic.
revision: str = ${repr(up_revision)}
down_revision: Union[str, None] = ${repr(down_revision)}
branch_labels: Union[str, Sequence[str], None] = ${repr(branch_labels)}
depends_on: Union[str, Sequence[str], None] = ${repr(depends_on)}


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


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

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@serge-eric-kalaga
Comment options

@CaselIT
Comment options

@serge-eric-kalaga
Comment options

@serge-eric-kalaga
Comment options

Answer selected by CaselIT
@CaselIT
Comment options

@serge-eric-kalaga
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants