You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`src/database/escrow-fk-integrity.integration.spec.ts` — **integration** test against a real Postgres (requires `DATABASE_URL`, not mocked): the exactly-one-parent CHECK constraint on `escrows`, and that sponsor dashboard figures survive a parent bounty/milestone being deleted.
265
267
266
-
`DATABASE_SYNCHRONIZE=true` (set in development) will auto-create tables from entities for fast local iteration. A real migration workflow (`typeorm migration:generate`) is recommended before deploying to production (see Roadmap).
268
+
`DATABASE_SYNCHRONIZE=true` (set in development) will auto-create tables from entities for fast local iteration. Real deployments should run migrations instead — see `src/database/migrations/` and the `migration:*` npm scripts below.
269
+
270
+
### Migrations
271
+
272
+
Schema changes are tracked as TypeORM migrations under `src/database/migrations/`, driven by the `DataSource` in `src/database/data-source.ts`:
273
+
274
+
```bash
275
+
# Generate a migration from entity changes (requires DATABASE_URL pointed at a real DB to diff against)
276
+
npm run migration:generate -- src/database/migrations/SomeChange
277
+
278
+
# Run all pending migrations
279
+
npm run migration:run
280
+
281
+
# Revert the most recently applied migration
282
+
npm run migration:revert
283
+
```
267
284
268
285
## Roadmap
269
286
270
-
-[ ]Wire up TypeORM migrations (currently relies on `synchronize` for local dev only).
287
+
-[x]~~Wire up TypeORM migrations (currently relies on `synchronize` for local dev only).~~ See `src/database/migrations/` and the Migrations section above.
271
288
-[ ] Move GitHub sync from a static PAT to a GitHub App installation-token flow for multi-org, least-privilege access.
272
289
-[ ] Deploy the real escrow contract from `mergefi-contracts` and drop the Soroban dry-run fallback.
273
290
-[ ] Replace the single `TREASURY_SECRET` signer with a proper signing service (KMS / multi-sig) before handling real funds.
0 commit comments