Fixed unnecessary import. (#113)

This commit is contained in:
long2ice 2020-12-29 19:12:36 +08:00
parent 78a15f9f19
commit 530e7cfce5
4 changed files with 7 additions and 4 deletions

View File

@ -2,6 +2,10 @@
## 0.4
### 0.4.4
- Fixed unnecessary import. (#113)
### 0.4.3
- Replace migrations separator to sql standard comment.

View File

@ -1 +1 @@
__version__ = "0.4.3"
__version__ = "0.4.4"

View File

@ -3,7 +3,6 @@ from typing import List, Optional
from ddlparse import DdlParse
from tortoise import BaseDBAsyncClient
from tortoise.backends.mysql.client import MySQLSchemaGenerator
class InspectDb:
@ -24,7 +23,7 @@ class InspectDb:
self.DIALECT = conn.schema_generator.DIALECT
async def show_create_tables(self):
if self.DIALECT == MySQLSchemaGenerator.DIALECT:
if self.DIALECT == "mysql":
if not self.tables:
sql_tables = f"SELECT table_name FROM information_schema.tables WHERE table_schema = '{self.conn.database}';" # nosec: B608
ret = await self.conn.execute_query(sql_tables)

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "aerich"
version = "0.4.3"
version = "0.4.4"
description = "A database migrations tool for Tortoise ORM."
authors = ["long2ice <long2ice@gmail.com>"]
license = "Apache-2.0"