Spaces:
Runtime error
Runtime error
| 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) | |