chore(deploy): 上线门禁迁移基线扩至 103–106

This commit is contained in:
yml2213
2026-10-28 14:05:17 +08:00
parent 915ce017f3
commit 814b357d46
2 changed files with 11 additions and 10 deletions
+4 -4
View File
@@ -337,15 +337,15 @@ preflight() {
detect_network
local migrations
migrations="$(psql_scalar "SELECT (EXISTS (SELECT 1 FROM schema_migrations WHERE COALESCE(filename, name) ~ '^103_'))::int + (EXISTS (SELECT 1 FROM schema_migrations WHERE COALESCE(filename, name) ~ '^104_'))::int + (EXISTS (SELECT 1 FROM schema_migrations WHERE COALESCE(filename, name) ~ '^105_'))::int" | tr -d '[:space:]')"
if [[ "$migrations" != "3" ]]; then
fail "迁移 103–105 未全部应用(当前 ${migrations}/3):先确认 deploy/ubuntu-deploy.sh 成功、backend 日志无迁移错误"
migrations="$(psql_scalar "SELECT (EXISTS (SELECT 1 FROM schema_migrations WHERE COALESCE(filename, name) ~ '^103_'))::int + (EXISTS (SELECT 1 FROM schema_migrations WHERE COALESCE(filename, name) ~ '^104_'))::int + (EXISTS (SELECT 1 FROM schema_migrations WHERE COALESCE(filename, name) ~ '^105_'))::int + (EXISTS (SELECT 1 FROM schema_migrations WHERE COALESCE(filename, name) ~ '^106_'))::int" | tr -d '[:space:]')"
if [[ "$migrations" != "4" ]]; then
fail "迁移 103–106 未全部应用(当前 ${migrations}/4):先确认 deploy/ubuntu-deploy.sh 成功、backend 日志无迁移错误"
fi
PENDING_REVENUE="$(psql_scalar "SELECT count(*) FROM order_items WHERE revenue_basis = 'unknown'" | tr -d '[:space:]')"
PENDING_FULFILLMENT="$(psql_scalar "SELECT count(*) FROM order_items WHERE fulfillment_mode IS NULL" | tr -d '[:space:]')"
log " postgres 运行中 / 迁移 103–105 已应用"
log " postgres 运行中 / 迁移 103–106 已应用"
log " 待回填收入项:${PENDING_REVENUE} 行;待回填履约方式:${PENDING_FULFILLMENT} 行"
log " 工具镜像:${TOOLS_IMAGE}(services=${HAS_TOOLS_SERVICE}, network=${NETWORK})"
}