17 lines
613 B
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# 生成 pipeline-opportunity 的 MySQL DDLjson2ddl 需要 sqlor + appPublic 在 PYTHONPATH
# 路径以脚本位置推导2026-09-11 修:原写死 /home/ymq/work/pipeline 旧路径失效)
set -e
R=$(cd "$(dirname "$0")/../.." && pwd)
export PYTHONPATH="$R/xls2ddl:$R/sqlor:$R/apppublic"
python3 - "$R" <<'PYEOF'
import sys
from xls2ddl.json2ddl import model2ddl
R = sys.argv[1]
s = model2ddl(R + '/pipeline-opportunity/models', 'mysql')
out = R + '/pipeline-opportunity/mysql.ddl.sql'
with open(out, 'w', encoding='utf-8') as f:
f.write(s)
print('written', out, len(s), 'chars')
PYEOF