Skip to content

Commit 751e217

Browse files
committed
include create_audit_ddl on api startup
1 parent bf37df9 commit 751e217

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
from db_config import (
2222
check_db_connection,
2323
create_db_and_tables,
24+
create_audit_ddl,
2425
DbContextManager,
2526
get_db,
2627
)
@@ -66,6 +67,8 @@ async def lifespan(application: FastAPI): # pylint: disable=unused-argument
6667
"""Executa as rotinas de inicialização da API."""
6768
try:
6869
await create_db_and_tables()
70+
if not TEST_ENVIRONMENT:
71+
await create_audit_ddl()
6972
await crud_auth.init_user_admin()
7073
except OperationalError as exception:
7174
logger.error("A inicialização do banco de dados falhou: %s", exception)

0 commit comments

Comments
 (0)