Open maxim-s-barabash opened 4 years ago
Just run aerich init
I am having the same problem, but I think my problem is my own misunderstanding of what is needed in config. I have a fastapi app, with the file structure below. What am I doing wrong? Thank you
app
|-- main.py
|-- db
|-- models.py
|-- schemas.py
|-- auth
|-- users.py
Here is my config setup,(from main.py) I'm specifically unsure what is being represented under the apps key.
tortoise_config = {
"connections": {"default": "postgres://user:password@localhost:5432/mydb"},
"apps": {
#should this key be fastapi appname or my project folder
"app": {
#i've seen this key as modules or models, im not sure which is correct
"models": ["db.models", "aerich.models"],
"default_connection": "default",
},
},
}
register_tortoise(
app,
config=tortoise_config,
generate_schemas=True,
add_exception_handlers=True
)
Just manual update content in aerich.ini
or delete it and rerun aerich init -t tortoise_config_path
aerich 0.2.1 tortoise-orm 0.16.12
I accidentally specified the wrong module name and got an error
aerich.ini