This commit is contained in:
vipg
2025-12-26 16:42:00 +08:00
parent 4c9868a5d9
commit 665758fe32
3 changed files with 3 additions and 31 deletions

View File

@@ -4,7 +4,7 @@
set -e # 遇到错误立即退出
# 定义表名变量,可以根据需要修改
TABLE_NAME="cn_pmi_records"
TABLE_NAME="cn_pmi_a_records"
echo "🚀 启动Python容器执行create_table.py..."
echo "📋 目标表名: ${TABLE_NAME}"

View File

@@ -7,8 +7,8 @@ create.py - 动态生成PostgreSQL建表SQL语句
import os
import re
# 1. 定义表名称变量,方便调整
table_name = "cn_pmi_records" # 可以根据需要修改表名
# 1. 从环境变量获取表名,如果没有设置则使用默认值
table_name = os.environ.get('TABLE_NAME', 'records')
# 2. 定义SQL模板
sql_template = f"""DO $$