diff --git a/aerich/cli.py b/aerich/cli.py index 6ae35d6..8160e74 100644 --- a/aerich/cli.py +++ b/aerich/cli.py @@ -100,7 +100,7 @@ async def upgrade(ctx: Context): with open(file_path, "w") as f: content["migrate"] = True - json.dump(content, f, indent=4) + json.dump(content, f, indent=4, ensure_ascii=False) click.secho(f"Success upgrade {file}", fg=Color.green) @@ -127,7 +127,7 @@ async def downgrade(ctx: Context): continue with open(file_path, "w") as f: content["migrate"] = False - json.dump(content, f, indent=4) + json.dump(content, f, indent=4, ensure_ascii=False) return click.secho(f"Success downgrade {file}", fg=Color.green) diff --git a/aerich/migrate.py b/aerich/migrate.py index 57f0f40..d189ea3 100644 --- a/aerich/migrate.py +++ b/aerich/migrate.py @@ -80,7 +80,7 @@ class Migrate: "migrate": False, } with open(os.path.join(cls.migrate_location, filename), "w") as f: - json.dump(content, f, indent=4) + json.dump(content, f, indent=4, ensure_ascii=False) return filename @classmethod @@ -128,7 +128,7 @@ class Migrate: @classmethod def cp_models( - cls, app: str, model_files: List[str], old_model_file, + cls, app: str, model_files: List[str], old_model_file, ): """ cp currents models to old_model_files @@ -177,7 +177,7 @@ class Migrate: @classmethod def _diff_models( - cls, old_models: Dict[str, Type[Model]], new_models: Dict[str, Type[Model]], upgrade=True + cls, old_models: Dict[str, Type[Model]], new_models: Dict[str, Type[Model]], upgrade=True ): """ diff models and add operators