Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
long2ice committed Nov 28, 2020
1 parent 0bbc471 commit c707f7e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion aerich/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.0"
__version__ = "0.4.1"
2 changes: 0 additions & 2 deletions aerich/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def wrapper(*args, **kwargs):
loop = asyncio.get_event_loop()
ctx = args[0]
loop.run_until_complete(f(*args, **kwargs))
loop.run_until_complete(Tortoise.close_connections())
app = ctx.obj.get("app")
if app:
Migrate.remove_old_model_file(app, ctx.obj["location"])
Expand Down Expand Up @@ -113,7 +112,6 @@ async def upgrade(ctx: Context):
file_path = os.path.join(Migrate.migrate_location, version_file)
content = get_version_content_from_file(file_path)
upgrade_query_list = content.get("upgrade")
print(upgrade_query_list)
for upgrade_query in upgrade_query_list:
await conn.execute_script(upgrade_query)
await Aerich.create(
Expand Down
2 changes: 1 addition & 1 deletion aerich/migrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ async def init_with_old_models(cls, config: dict, app: str, location: str):
await Tortoise.init(config=migrate_config)

connection = get_app_connection(config, app)
cls.dialect = connection.schema_generator.DIALECT
if cls.dialect == "mysql":
from aerich.ddl.mysql import MysqlDDL

Expand All @@ -106,7 +107,6 @@ async def init_with_old_models(cls, config: dict, app: str, location: str):
from aerich.ddl.postgres import PostgresDDL

cls.ddl = PostgresDDL(connection)
cls.dialect = cls.ddl.DIALECT
await cls._get_db_version(connection)

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "aerich"
version = "0.4.0"
version = "0.4.1"
description = "A database migrations tool for Tortoise ORM."
authors = ["long2ice <[email protected]>"]
license = "Apache-2.0"
Expand Down

0 comments on commit c707f7e

Please sign in to comment.