check tortoise add aerich.models
This commit is contained in:
parent
c09c878eaf
commit
125389461f
@ -9,6 +9,7 @@ ChangeLog
|
|||||||
- Fix default_connection when upgrade
|
- Fix default_connection when upgrade
|
||||||
- Find default app instead of default.
|
- Find default app instead of default.
|
||||||
- Diff MySQL ddl.
|
- Diff MySQL ddl.
|
||||||
|
- Check tortoise config.
|
||||||
|
|
||||||
0.1.8
|
0.1.8
|
||||||
-----
|
-----
|
||||||
|
@ -57,6 +57,8 @@ async def cli(ctx: Context, config, app, name):
|
|||||||
|
|
||||||
tortoise_config = get_tortoise_config(ctx, tortoise_orm)
|
tortoise_config = get_tortoise_config(ctx, tortoise_orm)
|
||||||
app = app or list(tortoise_config.get("apps").keys())[0]
|
app = app or list(tortoise_config.get("apps").keys())[0]
|
||||||
|
if "aerich.models" not in tortoise_config.get("apps").get(app).get("models"):
|
||||||
|
raise UsageError("Check your tortoise config and add aerich.models to it.", ctx=ctx)
|
||||||
ctx.obj["config"] = tortoise_config
|
ctx.obj["config"] = tortoise_config
|
||||||
ctx.obj["location"] = location
|
ctx.obj["location"] = location
|
||||||
ctx.obj["app"] = app
|
ctx.obj["app"] = app
|
||||||
|
Loading…
x
Reference in New Issue
Block a user