File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 44import logging
55from typing import Any
66from asyncio import gather
7+ from argparse import Namespace
78from operator import methodcaller
89from collections .abc import AsyncGenerator
910from functools import wraps , partial , lru_cache
7475async def init_orm () -> None :
7576 _init_orm ()
7677
77- with migrate .AlembicConfig (stdout = StreamToLogger ()) as alembic_config :
78+ cmd_opts = Namespace ()
79+ with migrate .AlembicConfig (
80+ stdout = StreamToLogger (), cmd_opts = cmd_opts
81+ ) as alembic_config :
7882 if plugin_config .alembic_startup_check :
83+ cmd_opts .cmd = (migrate .check , [], [])
7984 try :
8085 await greenlet_spawn (migrate .check , alembic_config )
8186 except click .UsageError :
8287 logger .error ("启动检查失败" )
8388 raise
8489 else :
8590 logger .warning ("跳过启动检查, 正在同步数据库模式..." )
91+ cmd_opts .cmd = (migrate .sync , ["revision" ], [])
8692 await greenlet_spawn (migrate .sync , alembic_config )
8793
8894
You can’t perform that action at this time.
0 commit comments