继续尝试修复环境变量问题

This commit is contained in:
2026-07-31 22:47:42 +08:00
parent 4dd658c0a7
commit 2629b696c2
3 changed files with 78 additions and 15 deletions
+3 -1
View File
@@ -820,7 +820,9 @@ def init_database():
# 执行 DDL
conn = get_pg_connection()
try:
with open("schema.sql", "r", encoding="utf-8") as f:
import os as _os
schema_path = _os.path.join(_os.path.dirname(_os.path.abspath(__file__)), "schema.sql")
with open(schema_path, "r", encoding="utf-8") as f:
ddl_sql = f.read()
# 按分号分割,逐条执行 (忽略被注释掉的分区表DDL)