Update model file find method
This commit is contained in:
parent
b06da0223a
commit
bf194ca8ce
@ -4,6 +4,10 @@ ChangeLog
|
||||
|
||||
0.1
|
||||
===
|
||||
0.2.0
|
||||
-----
|
||||
- Update model file find method.
|
||||
|
||||
0.1.9
|
||||
-----
|
||||
- Fix default_connection when upgrade
|
||||
|
@ -3,6 +3,7 @@ import os
|
||||
import re
|
||||
from copy import deepcopy
|
||||
from datetime import datetime
|
||||
from importlib import import_module
|
||||
from typing import Dict, List, Tuple, Type
|
||||
|
||||
from tortoise import (
|
||||
@ -195,7 +196,7 @@ class Migrate:
|
||||
models = config.get("apps").get(app).get("models")
|
||||
for model in models:
|
||||
if model != "aerich.models":
|
||||
old_model_files.append(model.replace(".", "/") + ".py")
|
||||
old_model_files.append(import_module(model).__file__)
|
||||
|
||||
cls.cp_models(app, old_model_files, os.path.join(location, app, cls.get_old_model_file()))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user