1
0
mirror of https://github.com/aquatix/digimarks.git synced 2025-12-06 23:05:10 +01:00

Make alembic comprehend/use sqlmodel

This commit is contained in:
2025-09-12 12:15:25 +02:00
parent 3a87485b9a
commit b6a81fded4
2 changed files with 3 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ from sqlalchemy.engine import Connection
from sqlalchemy.ext.asyncio import async_engine_from_config from sqlalchemy.ext.asyncio import async_engine_from_config
from sqlmodel import SQLModel from sqlmodel import SQLModel
# from app.models import Bookmark from src.digimarks.main import Bookmark, PublicTag, User
# this is the Alembic Config object, which provides # this is the Alembic Config object, which provides
# access to the values within the .ini file in use. # access to the values within the .ini file in use.
@@ -62,10 +62,7 @@ def do_run_migrations(connection: Connection) -> None:
async def run_async_migrations() -> None: async def run_async_migrations() -> None:
"""In this scenario we need to create an Engine """In this scenario we need to create an Engine and associate a connection with the context."""
and associate a connection with the context.
"""
connectable = async_engine_from_config( connectable = async_engine_from_config(
config.get_section(config.config_ini_section, {}), config.get_section(config.config_ini_section, {}),
prefix='sqlalchemy.', prefix='sqlalchemy.',

View File

@@ -9,6 +9,7 @@ from typing import Sequence, Union
from alembic import op from alembic import op
import sqlalchemy as sa import sqlalchemy as sa
import sqlmodel
${imports if imports else ""} ${imports if imports else ""}
# revision identifiers, used by Alembic. # revision identifiers, used by Alembic.