Files
NextEdu/webtest/check_schema.py
SpecialX d884c6d513
Some checks failed
CI / scheduled-backup (push) Failing after 36s
CI / backup-verify (push) Has been skipped
CI / weekly-dr-drill (push) Failing after 0s
CI / build-deploy (push) Has been cancelled
CI / security-scan (push) Has been cancelled
test: update and add E2E, integration, visual, and webapp tests
- Update E2E tests: announcements, auth, auth-business-flow, full-route-regression, grades, navigation, smoke-auth, teacher-web-test

- Update integration tests: api-ai-chat, api-onboarding-complete, api-onboarding-status, proxy-guard, integration setup

- Update visual regression tests: admin-dashboard, homepage, student-dashboard, teacher-dashboard, visual config, helpers

- Update webapp tests: admin, parent, student full tests and debug scripts

- Add new webapp tests: announcements_messages, settings_profile, debug scripts

- Add webtest directory with test plans, screenshots, and diagnostic scripts
2026-06-23 17:39:40 +08:00

72 lines
1.8 KiB
Python

"""检查备课模块相关的数据库表"""
import mysql.connector
conn = mysql.connector.connect(
host="mysql.eazygame.cn",
port=14013,
user="root",
password="wx1998WX",
database="next_edu"
)
cursor = conn.cursor()
# 检查 class_subject_teachers 表
try:
cursor.execute("DESCRIBE class_subject_teachers")
cols = cursor.fetchall()
print("=== class_subject_teachers 表结构 ===")
for c in cols:
print(f" {c[0]}: {c[1]}")
except Exception as e:
print(f"❌ class_subject_teachers 表不存在: {e}")
# 检查教师的 class_subject_teachers 数据
try:
cursor.execute("""
SELECT * FROM class_subject_teachers
WHERE teacher_id = 'user_T_C1'
""")
rows = cursor.fetchall()
print(f"\n=== 教师 T_C1 的 class_subject_teachers 数据 ({len(rows)} 行) ===")
for r in rows:
print(f" {r}")
except Exception as e:
print(f"❌ 查询失败: {e}")
# 检查 lesson_plans 表结构
try:
cursor.execute("DESCRIBE lesson_plans")
cols = cursor.fetchall()
print("\n=== lesson_plans 表结构 ===")
for c in cols:
print(f" {c[0]}: {c[1]}")
except Exception as e:
print(f"❌ lesson_plans 表不存在: {e}")
# 检查 lesson_plans 数据
try:
cursor.execute("""
SELECT id, title, status, creator_id, subject_id, grade_id
FROM lesson_plans
LIMIT 10
""")
rows = cursor.fetchall()
print(f"\n=== lesson_plans 数据 ({len(rows)} 行) ===")
for r in rows:
print(f" {r}")
except Exception as e:
print(f"❌ 查询失败: {e}")
# 检查 subjects 表
try:
cursor.execute("SELECT * FROM subjects")
rows = cursor.fetchall()
print(f"\n=== subjects 数据 ({len(rows)} 行) ===")
for r in rows:
print(f" {r}")
except Exception as e:
print(f"❌ 查询失败: {e}")
cursor.close()
conn.close()