aerich icon indicating copy to clipboard operation
aerich copied to clipboard

Version 0.7.2 DB configuration not initialised.

Open TJNo-1 opened this issue 1 year ago • 1 comments

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.

TJNo-1 avatar Aug 01 '24 06:08 TJNo-1

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.

hany avatar Aug 29 '24 15:08 hany

@TJNo-1 I can not reproduce this bug with the following content of app_tests/models.py:

from tortoise import Model, fields


class A(Model):
    a = fields.BooleanField()
    # b = fields.BooleanField()

Cloud you show the steps to reproduce it?

waketzheng avatar Dec 27 '24 06:12 waketzheng