temp
This commit is contained in:
25
deploy/script/gen_models.ps1
Normal file
25
deploy/script/gen_models.ps1
Normal file
@@ -0,0 +1,25 @@
|
||||
# 设置输出编码为UTF-8
|
||||
[Console]::OutputEncoding = [System.Text.Encoding]::UTF8
|
||||
# 数据库连接信息 - 修改了URL格式
|
||||
$DB_URL = "tyc:5vg67b3UNHu8@(127.0.0.1:20001)/tyc"
|
||||
$OUTPUT_DIR = "./model"
|
||||
$TEMPLATE_DIR = "../template"
|
||||
|
||||
# 表名列表
|
||||
$tables = @(
|
||||
"example",
|
||||
"feature",
|
||||
"global_notifications",
|
||||
"order",
|
||||
"product",
|
||||
"product_feature",
|
||||
"product_render",
|
||||
"query",
|
||||
"user",
|
||||
"user_auth"
|
||||
)
|
||||
|
||||
# 为每个表生成模型
|
||||
foreach ($table in $tables) {
|
||||
goctl model mysql datasource -url="tyc:5vg67b3UNHu8@tcp(127.0.0.1:20001)/tyc" -table="$table" -dir="./model" --home="../template" -cache=true --style=goZero
|
||||
}
|
||||
Reference in New Issue
Block a user