File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed
nonebot_plugin_orm/templates Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,7 @@ async def run_migrations_online() -> None:
5959
6060 这种情况下,我们需要为 context 创建一个连接。
6161 """
62- async with engine .begin () as connection :
62+ async with engine .connect () as connection :
6363 await connection .run_sync (do_run_migrations )
6464
6565
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ def run_migrations_offline() -> None:
5252 # 使用 --sql 选项的情况下,将每个引擎的迁移写入到单独的 .sql 文件中。
5353
5454 for name , engine in engines .items ():
55+ config .print_stdout (f"迁移数据库 { name or '<default>' } 中 ..." )
5556 file_ = f"{ name } .sql"
5657 with open (file_ , "w" ) as buffer :
5758 context .configure (
@@ -62,9 +63,7 @@ def run_migrations_offline() -> None:
6263 dialect_opts = {"paramstyle" : "named" },
6364 ** plugin_config .alembic_context ,
6465 )
65- with context .begin_transaction (), config .status (
66- f"迁移数据库 { name or '<default>' } 中"
67- ):
66+ with context .begin_transaction ():
6867 context .run_migrations (name = name )
6968 config .print_stdout (f"将输出写入到 { file_ } " )
7069
You can’t perform that action at this time.
0 commit comments