From 0d23297f46f0bb562183c23ef84fc2f8f4cdb6e5 Mon Sep 17 00:00:00 2001 From: long2ice Date: Wed, 24 Jun 2020 15:17:30 +0800 Subject: [PATCH] Fix bug in windows. --- CHANGELOG.rst | 5 +++++ aerich/migrate.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 693a619..fd0caa6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,11 @@ ChangeLog ========= 0.2 === + +0.2.1 +----- +- Fix bug in windows. + 0.2.0 ----- - Update model file find method. diff --git a/aerich/migrate.py b/aerich/migrate.py index b973bbe..2f80ae4 100644 --- a/aerich/migrate.py +++ b/aerich/migrate.py @@ -172,7 +172,7 @@ class Migrate: """ temp_config = deepcopy(config) path = os.path.join(location, app, cls.old_models) - path = path.replace("/", ".").lstrip(".") + path = path.replace(os.sep, ".").lstrip(".") temp_config["apps"][cls.diff_app] = { "models": [path], "default_connection": config.get("apps").get(app).get("default_connection", "default"),