fix: database init
This commit is contained in:
+2
-6
@@ -24,16 +24,12 @@ class Database:
|
||||
},
|
||||
)
|
||||
|
||||
def init(self) -> typing.Self:
|
||||
def init(self) -> None:
|
||||
self.logger.info("Migrating database")
|
||||
tortoise.run_async(tortoise.migrations.api.migrate(config=self.config))
|
||||
self.logger.info("Database migrated")
|
||||
self.logger.info("Initializing database")
|
||||
tortoise.run_async(
|
||||
tortoise.Tortoise.init(config=self.config, _enable_global_fallback=True)
|
||||
)
|
||||
self.logger.info("Database ready")
|
||||
return self
|
||||
|
||||
def __enter__(self) -> typing.Self:
|
||||
|
||||
return self
|
||||
|
||||
Reference in New Issue
Block a user