bug fix
This commit is contained in:
parent
0bbc471e00
commit
c707f7ecb2
@ -1 +1 @@
|
|||||||
__version__ = "0.4.0"
|
__version__ = "0.4.1"
|
||||||
|
@ -33,7 +33,6 @@ def coro(f):
|
|||||||
loop = asyncio.get_event_loop()
|
loop = asyncio.get_event_loop()
|
||||||
ctx = args[0]
|
ctx = args[0]
|
||||||
loop.run_until_complete(f(*args, **kwargs))
|
loop.run_until_complete(f(*args, **kwargs))
|
||||||
loop.run_until_complete(Tortoise.close_connections())
|
|
||||||
app = ctx.obj.get("app")
|
app = ctx.obj.get("app")
|
||||||
if app:
|
if app:
|
||||||
Migrate.remove_old_model_file(app, ctx.obj["location"])
|
Migrate.remove_old_model_file(app, ctx.obj["location"])
|
||||||
@ -113,7 +112,6 @@ async def upgrade(ctx: Context):
|
|||||||
file_path = os.path.join(Migrate.migrate_location, version_file)
|
file_path = os.path.join(Migrate.migrate_location, version_file)
|
||||||
content = get_version_content_from_file(file_path)
|
content = get_version_content_from_file(file_path)
|
||||||
upgrade_query_list = content.get("upgrade")
|
upgrade_query_list = content.get("upgrade")
|
||||||
print(upgrade_query_list)
|
|
||||||
for upgrade_query in upgrade_query_list:
|
for upgrade_query in upgrade_query_list:
|
||||||
await conn.execute_script(upgrade_query)
|
await conn.execute_script(upgrade_query)
|
||||||
await Aerich.create(
|
await Aerich.create(
|
||||||
|
@ -94,6 +94,7 @@ class Migrate:
|
|||||||
await Tortoise.init(config=migrate_config)
|
await Tortoise.init(config=migrate_config)
|
||||||
|
|
||||||
connection = get_app_connection(config, app)
|
connection = get_app_connection(config, app)
|
||||||
|
cls.dialect = connection.schema_generator.DIALECT
|
||||||
if cls.dialect == "mysql":
|
if cls.dialect == "mysql":
|
||||||
from aerich.ddl.mysql import MysqlDDL
|
from aerich.ddl.mysql import MysqlDDL
|
||||||
|
|
||||||
@ -106,7 +107,6 @@ class Migrate:
|
|||||||
from aerich.ddl.postgres import PostgresDDL
|
from aerich.ddl.postgres import PostgresDDL
|
||||||
|
|
||||||
cls.ddl = PostgresDDL(connection)
|
cls.ddl = PostgresDDL(connection)
|
||||||
cls.dialect = cls.ddl.DIALECT
|
|
||||||
await cls._get_db_version(connection)
|
await cls._get_db_version(connection)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "aerich"
|
name = "aerich"
|
||||||
version = "0.4.0"
|
version = "0.4.1"
|
||||||
description = "A database migrations tool for Tortoise ORM."
|
description = "A database migrations tool for Tortoise ORM."
|
||||||
authors = ["long2ice <long2ice@gmail.com>"]
|
authors = ["long2ice <long2ice@gmail.com>"]
|
||||||
license = "Apache-2.0"
|
license = "Apache-2.0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user