Skip to content

🔖 Release 0.2.0

Choose a tag to compare

@github-actions github-actions released this 15 Oct 19:09
· 94 commits to master since this release
a2d2d94

Notable Changes

单数据库模板 (generic)

--- a/migrations/env.py
+++ b/migrations/env.py
@@ -59,7 +59,7 @@ async def run_migrations_online() -> None:

     这种情况下,我们需要为 context 创建一个连接。
     """
-    async with engine.begin() as connection:
+    async with engine.connect() as connection:
         await connection.run_sync(do_run_migrations)

多数据库模板 (multidb)

--- a/migrations/env.py
+++ b/migrations/env.py
@@ -52,6 +52,7 @@ def run_migrations_offline() -> None:
     # 使用 --sql 选项的情况下,将每个引擎的迁移写入到单独的 .sql 文件中。

     for name, engine in engines.items():
+        config.print_stdout(f"迁移数据库 {name or '<default>'} 中 ...")
         file_ = f"{name}.sql"
         with open(file_, "w") as buffer:
             context.configure(
@@ -62,9 +63,7 @@ def run_migrations_offline() -> None:
                 dialect_opts={"paramstyle": "named"},
                 **plugin_config.alembic_context,
             )
-            with context.begin_transaction(), config.status(
-                f"迁移数据库 {name or '<default>'} 中"
-            ):
+            with context.begin_transaction():
                 context.run_migrations(name=name)
             config.print_stdout(f"将输出写入到 {file_}")
--- a/a.tree
+++ b/b.tree
@@ -1,8 +1,9 @@
 .
 └── nonebot_plugin
     ├── config.py
     ├── __init__.py
     └── migrations
         ├── 21e03401e435_.py
         ├── 595fd3d5f5b4_.py
-        └── e04c11aa30b7_.py
+        ├── e04c11aa30b7_.py
+        └── __init__.py

What's Changed

Full Changelog: v0.1.2...v0.2.0