tortoise / aerich

A database migrations tool for TortoiseORM, ready to production.
https://github.com/tortoise/aerich
Apache License 2.0
852 stars 101 forks source link

Version 0.7.2 DB configuration not initialised. #353

Open TJNo-1 opened 4 months ago

TJNo-1 commented 4 months ago

When I use aerich independently to migrate the database, the following error is reported.

tortoise.exceptions.ConfigurationError: DB configuration not initialised. Make sure to call Tortoise.init with a valid configuration before attempting to create connections.

This is a new problem in version 0.7.2. I can migrate smoothly after downgrading to version 0.7.1. Some details are in the attached pictures. This problem is already explained in a co 20240801144331 20240801144331 mment in the issue [stuck on init #324].

In addition, has the project considered cooperating with fastAPI to become the official ORM? If so, hopefully you can keep your ORM independent. Don’t make it difficult to use in a standalone project like the Django ORM is.

Thanks for following up. Wish all the best.

hany commented 3 months ago

I too am running into this issue on a newly setup aerich and Tortoise setup. aerich init -t settings.TORTOISE_ORM works fine, but I get an error on aerich init-db:

tortoise.exceptions.ConfigurationError: DB configuration not initialised. Make sure to call Tortoise.init with a valid configuration before attempting to create connections.

Can confirm that this issue does not appear in v0.7.1.