Browse Source

Fix TypeORM entity paths for production environment

wui 6 months ago
parent
commit
73a3f3273f
1 changed files with 10 additions and 0 deletions
  1. 10 0
      deploy.sh

+ 10 - 0
deploy.sh

@@ -48,6 +48,7 @@ handle_git_operations() {
     
     if git pull origin main; then
         echo "✅ 代码更新成功"
+        echo "📝 当前提交: $(git log --oneline -1)"
     else
         echo "❌ Git 拉取失败"
         echo "是否继续部署(跳过代码拉取)?(y/N)"
@@ -92,6 +93,15 @@ fi
 
 echo "✅ 构建成功,文件存在: dist/server.js"
 
+# 显示关键文件内容用于调试
+echo "🔍 检查 database.ts 配置..."
+if [ -f "dist/config/database.js" ]; then
+    echo "📄 dist/config/database.js 存在"
+    grep -A 10 -B 5 "entities" dist/config/database.js || echo "未找到 entities 配置"
+else
+    echo "❌ dist/config/database.js 不存在"
+fi
+
 # 替换配置文件
 cp .env.production dist/.env
 cp package.json dist/package.json