Fix default_connection when upgrade

This commit is contained in:
long2ice 2020-05-25 23:44:42 +08:00
parent 6ffca1a0c7
commit 881f70f748
2 changed files with 7 additions and 1 deletions

View File

@ -4,6 +4,9 @@ ChangeLog
0.1 0.1
=== ===
0.1.9
-----
- Fix default_connection when upgrade
0.1.8 0.1.8
----- -----

View File

@ -174,7 +174,10 @@ class Migrate:
temp_config = deepcopy(config) temp_config = deepcopy(config)
path = os.path.join(location, app, cls.old_models) path = os.path.join(location, app, cls.old_models)
path = path.replace("/", ".").lstrip(".") path = path.replace("/", ".").lstrip(".")
temp_config["apps"][cls.diff_app] = {"models": [path]} temp_config["apps"][cls.diff_app] = {
"models": [path],
"default_connection": config.get("apps").get(app).get("default_connection","default"),
}
return temp_config return temp_config
@classmethod @classmethod