From 464f621f722e45a664c3a7a941647d605a990dbb Mon Sep 17 00:00:00 2001 From: yumoqing Date: Tue, 1 Sep 2026 17:30:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(create=5Ftables):=20DDL=E8=AF=AD=E5=8F=A5?= =?UTF-8?q?=E5=88=86=E5=89=B2=E5=85=88=E5=89=94=E9=99=A4=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E8=A1=8C=E2=80=94=E2=80=94=E5=A4=B4=E9=83=A8=E6=B3=A8=E9=87=8A?= =?UTF-8?q?=E4=B8=8E=E9=A6=96=E6=9D=A1CREATE=E7=B2=98=E8=BF=9E=E5=AF=BC?= =?UTF-8?q?=E8=87=B4llm=5Fvendor=E6=BC=8F=E5=BB=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/create_tables.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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)')