qnc-server-tob/deploy/script/gen_models.ps1

41 lines
1.1 KiB
PowerShell
Raw Normal View History

2025-04-11 13:10:17 +08:00
# 设置输出编码为UTF-8
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
# 数据库连接信息 - 修改了URL格式
$DB_URL = "qnc:5vg67b3UNHu8@(127.0.0.1:21001)/qnc"
$OUTPUT_DIR = "./model"
$TEMPLATE_DIR = "../template"
# 表名列表
$tables = @(
# "agent",
# "agent_active_stat",
# "agent_audit",
# "agent_closure",
# "agent_commission",
# "agent_commission_deduction",
# "agent_link",
# "agent_membership_config",
2025-04-22 02:11:56 +08:00
# "agent_membership_recharge_order"
2025-04-11 13:10:17 +08:00
# "agent_membership_user_config",
# "agent_order",
# "agent_platform_deduction",
# "agent_product_config",
# "agent_rewards",
# "agent_wallet",
# "agent_withdrawal",
# "feature",
# "global_notifications",
# "order",
# "product",
# "product_feature",
# "query",
2025-04-15 22:52:02 +08:00
# "user"
2025-04-11 13:10:17 +08:00
# "user_auth"
2025-04-22 02:11:56 +08:00
"example"
2025-04-11 13:10:17 +08:00
)
# 为每个表生成模型
foreach ($table in $tables) {
goctl model mysql datasource -url="qnc:5vg67b3UNHu8@tcp(127.0.0.1:21001)/qnc" -table="$table" -dir="./model" --home="../template" -cache=true --style=goZero
}