Files
drl_2/xuexiao/scripts/run_migrate.py

14 lines
390 B
Python
Raw Normal View History

2026-05-29 10:28:07 +08:00
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
from app import create_app
from utils import auto_migrate
from models import db
app = create_app()
with app.app_context():
auto_migrate()
rows = db.session.execute(db.text('SHOW COLUMNS FROM `courses`')).fetchall()
print('courses columns:', [r[0] for r in rows])