diff --git a/src/ohmyapi/core/runtime.py b/src/ohmyapi/core/runtime.py index 1cc1773..fdb811a 100644 --- a/src/ohmyapi/core/runtime.py +++ b/src/ohmyapi/core/runtime.py @@ -127,7 +127,9 @@ class Project: # Get a fresh copy of the config (without aerich.models anywhere) tortoise_cfg = self.build_tortoise_config(db_url=db_url) + # Prevent leaking other app's models to Aerich. tortoise_cfg["apps"] = {app_label: tortoise_cfg["apps"][app_label]} + # Append aerich.models to the models list of the target app only tortoise_cfg["apps"][app_label]["models"].append("aerich.models")