彻底优化数据库字段

This commit is contained in:
yml
2026-05-24 20:49:37 +08:00
parent 80e01dc6d9
commit 5f6a4afcbb
28 changed files with 295 additions and 302 deletions
+6 -5
View File
@@ -57,6 +57,12 @@ wait_container_healthy() {
}
init_database() {
if [[ "${DEV_RESET_DB:-0}" == "1" ]]; then
log "DEV_RESET_DB=1,重建开发数据库..."
docker exec hfb-mysql mysql -uroot -prootsecret -e \
"DROP DATABASE IF EXISTS hfb_sys; CREATE DATABASE hfb_sys CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
fi
local table_count
table_count="$(
docker exec hfb-mysql mysql -uhfb -psecret -N -s -e \
@@ -69,11 +75,6 @@ init_database() {
else
log "数据库结构已存在,跳过迁移"
fi
if [[ -f "${ROOT_DIR}/backend/migrations/000002_order_payment_stepwise.sql" ]]; then
log "应用订单支付增量迁移..."
docker exec -i hfb-mysql mysql -uhfb -psecret hfb_sys < "${ROOT_DIR}/backend/migrations/000002_order_payment_stepwise.sql"
fi
}
load_env_file() {