sio-2425/delivery1/server/database/setup_db.py

13 lines
335 B
Python
Raw Normal View History

import os
from database import Base, engine
from models import Organization, User, File
def setup_db():
db_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "database.db")
if os.path.exists(db_path):
os.remove(db_path)
Base.metadata.create_all(bind=engine)
if __name__ == "__main__":
setup_db()