fixed comments

This commit is contained in:
c-d-p
2025-04-26 12:43:19 +02:00
parent 10e5a3c489
commit 22a4fc50a5
49 changed files with 165 additions and 148 deletions

View File

@@ -18,16 +18,13 @@ def cleardb(hard: bool):
db = SessionLocal()
if hard:
# Drop and recreate all tables
Base.metadata.drop_all(bind=engine)
Base.metadata.create_all(bind=engine)
db.commit()
return {"message": "Database reset (HARD)"}
else:
# Delete data from tables except users
tables = Base.metadata.tables.keys()
for table_name in tables:
# delete all tables that isn't the users table
if table_name != "users":
table = Base.metadata.tables[table_name]
print(f"Deleting table: {table_name}")