14 lines
453 B
Python
14 lines
453 B
Python
import os
|
|
from flask import Flask
|
|
from flask_sqlalchemy import SQLAlchemy
|
|
|
|
# Create a minimal Flask app just for clearing the database
|
|
app = Flask(__name__)
|
|
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///instance/dashboard.db'
|
|
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
|
|
db = SQLAlchemy(app)
|
|
|
|
with app.app_context():
|
|
db.reflect() # This loads all tables from the database
|
|
db.drop_all()
|
|
print("Dropped all tables successfully.") |