From 530e7cfce5e9857ecebbd397c02d2a058fd52fa6 Mon Sep 17 00:00:00 2001 From: long2ice Date: Tue, 29 Dec 2020 19:12:36 +0800 Subject: [PATCH] Fixed unnecessary import. (#113) --- CHANGELOG.md | 4 ++++ aerich/__init__.py | 2 +- aerich/inspectdb.py | 3 +-- pyproject.toml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdb4b72..cc491e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## 0.4 +### 0.4.4 + +- Fixed unnecessary import. (#113) + ### 0.4.3 - Replace migrations separator to sql standard comment. diff --git a/aerich/__init__.py b/aerich/__init__.py index f6b7e26..cd1ee63 100644 --- a/aerich/__init__.py +++ b/aerich/__init__.py @@ -1 +1 @@ -__version__ = "0.4.3" +__version__ = "0.4.4" diff --git a/aerich/inspectdb.py b/aerich/inspectdb.py index 05035e2..423da90 100644 --- a/aerich/inspectdb.py +++ b/aerich/inspectdb.py @@ -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) diff --git a/pyproject.toml b/pyproject.toml index 95ea4a1..1058492 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 "] license = "Apache-2.0"