docs: 新增迁移说明文档,reset_db.sh 添加 000114 基线检查
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m13s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 7m13s
This commit is contained in:
@@ -22,6 +22,15 @@ fi
|
||||
DB_DSN="postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable"
|
||||
ADMIN_DSN="postgres://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/postgres?sslmode=disable"
|
||||
|
||||
# 检查 squash 基线文件是否存在(发布前必须生成,参见 migrations/README.md)
|
||||
if [ ! -f "migrations/000114_squash_baseline.up.sql" ]; then
|
||||
echo "❌ 错误:migrations/000114_squash_baseline.up.sql 不存在!"
|
||||
echo ""
|
||||
echo "全新数据库需要 squash 基线文件才能通过 migrate up 建表。"
|
||||
echo "请参考 migrations/README.md 的「发布前必做」章节生成该文件。"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "警告:即将清空数据库 ${DB_NAME}(${DB_HOST}:${DB_PORT}),5 秒后继续..."
|
||||
echo "按 Ctrl+C 取消"
|
||||
sleep 5
|
||||
|
||||
Reference in New Issue
Block a user