Purge database on startup
This commit is contained in:
parent
b98d19f9ec
commit
32304d0c7d
1 changed files with 1 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ from src.modules import data_connection
|
||||||
@asynccontextmanager
|
@asynccontextmanager
|
||||||
async def lifespan(app: FastAPI):
|
async def lifespan(app: FastAPI):
|
||||||
# Startup
|
# Startup
|
||||||
|
data_connection.delete_database()
|
||||||
data_connection.create_db_and_tables()
|
data_connection.create_db_and_tables()
|
||||||
yield
|
yield
|
||||||
# Shutdown
|
# Shutdown
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue