fix(backend): تشغيل الهجرات على dist المترجَم بدل ts-node في صورة الإنتاج

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-16 15:37:07 +03:00
co-authored by Claude Opus 4.8
parent 95fea546f5
commit 951f6d80e1
2 changed files with 6 additions and 2 deletions
+3
View File
@@ -13,6 +13,9 @@ docker compose up -d --build # يبني ويشغّل: postgres/postgis, redis,
```bash ```bash
docker compose exec api npm run migration:run docker compose exec api npm run migration:run
``` ```
> الهجرات تعمل على النسخة المترجمة `dist/config/data-source.js` (صورة الإنتاج بلا ts-node).
> لو ما رفعت آخر نسخة بعد، شغّل مباشرة:
> `docker compose exec api node_modules/.bin/typeorm migration:run -d dist/config/data-source.js`
## فحص سريع ## فحص سريع
```bash ```bash
+3 -2
View File
@@ -9,10 +9,11 @@
"start:dev": "nest start --watch", "start:dev": "nest start --watch",
"start:prod": "node dist/main.js", "start:prod": "node dist/main.js",
"worker": "node dist/worker.js", "worker": "node dist/worker.js",
"typeorm": "typeorm-ts-node-commonjs -d src/config/data-source.ts", "typeorm": "typeorm -d dist/config/data-source.js",
"migration:generate": "npm run typeorm -- migration:generate", "typeorm:dev": "typeorm-ts-node-commonjs -d src/config/data-source.ts",
"migration:run": "npm run typeorm -- migration:run", "migration:run": "npm run typeorm -- migration:run",
"migration:revert": "npm run typeorm -- migration:revert", "migration:revert": "npm run typeorm -- migration:revert",
"migration:generate": "npm run typeorm:dev -- migration:generate",
"lint": "eslint \"src/**/*.ts\" --fix", "lint": "eslint \"src/**/*.ts\" --fix",
"test": "jest" "test": "jest"
}, },