# -*- mode: python; -*- import os from app import create_app, db app = create_app() DB_NAME = "mdl.db" app.config["SQLALCHEMY_DATABASE_URI"] = "sqlite:///" + DB_NAME db_path = f"app/{DB_NAME}" if os.path.exists(db_path): os.remove(db_path) print(f"Existing database {db_path} has been deleted successfully.") else: print(f"Database {db_path} does not exist yet, creating now.") with app.app_context(): print(f"Creating database {db_path}...") db.create_all() print(f"Database {db_path} created successfully.")