fix(backend): تشغيل الهجرات على dist المترجَم بدل ts-node في صورة الإنتاج
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,9 @@ docker compose up -d --build # يبني ويشغّل: postgres/postgis, redis,
|
||||
```bash
|
||||
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
|
||||
|
||||
@@ -9,10 +9,11 @@
|
||||
"start:dev": "nest start --watch",
|
||||
"start:prod": "node dist/main.js",
|
||||
"worker": "node dist/worker.js",
|
||||
"typeorm": "typeorm-ts-node-commonjs -d src/config/data-source.ts",
|
||||
"migration:generate": "npm run typeorm -- migration:generate",
|
||||
"typeorm": "typeorm -d dist/config/data-source.js",
|
||||
"typeorm:dev": "typeorm-ts-node-commonjs -d src/config/data-source.ts",
|
||||
"migration:run": "npm run typeorm -- migration:run",
|
||||
"migration:revert": "npm run typeorm -- migration:revert",
|
||||
"migration:generate": "npm run typeorm:dev -- migration:generate",
|
||||
"lint": "eslint \"src/**/*.ts\" --fix",
|
||||
"test": "jest"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user