aerich
aerich copied to clipboard
init-db said "Inited models already" even if error has occured before
So if I forgot to add "aerich.models" to models config or the importing of the app's models failed because of something, and then run aerich init-db
, it failes with error tortoise.exceptions.ConfigurationError: No DB associated to model
Then I made some changes and run the command again, it said Inited models already
even if error occured before.
just delete migrations/{app} dir, maybe we should catch any exceptions to avoid that.
Yeah, I think init-db
must be atomic or so.
just adding to this, neither trying to init again (aerich init-db
), migrate (migrate
), or upgrading (upgrade
) solves the issue.
I don't know much about Aerich's codebase, but creating the migrations/models folder only after this step solve the issue?