dolor3v / reset.py
David Prince
Initial dolor3v backend
69381eb
Raw
History Blame Contribute Delete
410 Bytes
import os, sqlite3
from app import app
from models import db
db_path = '/data/data/com.termux/files/home/dolor.db'
# Delete old db
if os.path.exists(db_path):
os.remove(db_path)
print("Deleted old DB")
# Create fresh with all tables
with app.app_context():
db.create_all()
from sqlalchemy import inspect
tables = inspect(db.engine).get_table_names()
print("Tables created:", tables)