diff --git a/scripts/create_tables.py b/scripts/create_tables.py index cf2b5c0..8825129 100644 --- a/scripts/create_tables.py +++ b/scripts/create_tables.py @@ -350,11 +350,13 @@ async def main(): _llm_ddl_path = os.path.join(ROOT_DIR, 'pkgs', 'pipeline-llm', 'mysql.ddl.sql') if os.path.isfile(_llm_ddl_path): with open(_llm_ddl_path, 'r', encoding='utf-8') as _f: - _llm_ddl = _f.read() + # 先剔除注释行(-- 开头),避免头部注释与首条 CREATE 粘连被整段跳过 + _llm_ddl = '\n'.join( + _l for _l in _f.read().splitlines() if not _l.strip().startswith('--')) _n = 0 for _stmt in _llm_ddl.split(';'): _stmt = _stmt.strip() - if _stmt and not _stmt.startswith('--'): + if _stmt: await sor.execute(_stmt, {}) _n += 1 print(f' tables: pipeline-llm ensured ({_n} statements, idempotent)')