袁聪的第二次提交,项目已完整

This commit is contained in:
2026-09-11 16:57:47 +08:00
parent 5907fcd6d2
commit fd9598efdf
190 changed files with 31513 additions and 680 deletions
+10 -2
View File
@@ -17,9 +17,17 @@ VERSIONS_DIR = ROOT / "alembic" / "versions"
def expected_tables() -> set[str]:
text = SQL_FILE.read_text(encoding="utf-8")
tables = set(re.findall(r"CREATE TABLE `?([A-Za-z0-9_]+)`?", text))
tables = set(re.findall(
r"CREATE TABLE\s+(?:IF NOT EXISTS\s+)?`?([A-Za-z0-9_]+)`?",
text,
flags=re.IGNORECASE,
))
for path in VERSIONS_DIR.glob("*.py"):
tables.update(re.findall(r"CREATE TABLE `?([A-Za-z0-9_]+)`?", path.read_text(encoding="utf-8")))
tables.update(re.findall(
r"CREATE TABLE\s+(?:IF NOT EXISTS\s+)?`?([A-Za-z0-9_]+)`?",
path.read_text(encoding="utf-8"),
flags=re.IGNORECASE,
))
return tables