importing sqlmodel into version file in case of using sqlmodel as ORM #1404
Answered
by
serge-eric-kalaga
serge-eric-kalaga
asked this question in
Usage Questions
-
In case of using sqlmodel as ORM, add sqlmodel import in version file Exemple : from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
import sqlmodel
# revision identifiers, used by Alembic.
revision: str = '002aaeee1534'
down_revision: Union[str, None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
op.add_column('task', sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=True)) |
Beta Was this translation helpful? Give feedback.
Answered by
serge-eric-kalaga
Jan 22, 2024
Replies: 1 comment 6 replies
-
Hi, Is there a question there? Sorry but I could not find one. If you are asking if you can import sqlmodel in the revision file I don't see why not |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
My
script.py.mako
file after update.