-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreset_db.py
More file actions
24 lines (20 loc) · 739 Bytes
/
reset_db.py
File metadata and controls
24 lines (20 loc) · 739 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import os
from seed import seed_data
DB_NAME = "veritender.db"
def reset_database():
"""Deletes and re-initializes the database for clean testing/development."""
if os.path.exists(DB_NAME):
try:
os.remove(DB_NAME)
print(f"🗑️ Deleted old database: {DB_NAME}")
except PermissionError:
print("❌ Error: Close the database (or stop the server) before resetting!")
return
else:
print("No existing database found.")
# Re-create database with default users and tenders
print("🌱 Initializing fresh database...")
seed_data()
print("✅ RESET COMPLETE. You can now run 'python main.py'")
if __name__ == "__main__":
reset_database()