Spaces:
Runtime error
Runtime error
File size: 410 Bytes
69381eb | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | 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)
|