diff --git a/Makefile b/Makefile index 59102b7..d6efb00 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ MYSQL_PORT ?= 3306 MYSQL_PASS ?= "123456" POSTGRES_HOST ?= "127.0.0.1" POSTGRES_PORT ?= 5432 -POSTGRES_PAS ?= "123456" +POSTGRES_PASS ?= "123456" help: @echo "Aerich development makefile" diff --git a/aerich/cli.py b/aerich/cli.py index ae50eb5..38b0211 100644 --- a/aerich/cli.py +++ b/aerich/cli.py @@ -262,7 +262,9 @@ async def init_db(ctx: Context, safe): os.mkdir(dirname) click.secho(f"Success create app migrate location {dirname}", fg=Color.green) else: - return click.secho(f"Inited {app} already", fg=Color.yellow) + return click.secho( + f"Inited {app} already, or delete {dirname} and try again.", fg=Color.yellow + ) await Tortoise.init(config=config) connection = get_app_connection(config, app) diff --git a/aerich/migrate.py b/aerich/migrate.py index 98d67c4..60d23aa 100644 --- a/aerich/migrate.py +++ b/aerich/migrate.py @@ -312,7 +312,11 @@ class Migrate: else: is_rename = diff_key in cls._rename_new if is_rename: - if cls.dialect == "mysql" and cls._db_version.major == 5: + if ( + cls.dialect == "mysql" + and cls._db_version + and cls._db_version.major == 5 + ): cls._add_operator( cls._change_field(new_model, old_field, new_field), upgrade,