-
-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
P1Critical — must be done firstCritical — must be done firstphase:2-orgsPhase 2: Multi-tenancy & OrganizationsPhase 2: Multi-tenancy & Organizations
Description
Description
Create a migration system that auto-runs pending migrations at app boot before app.listen().
Details
- New MongoDB collection
migrationstracking executed migrations (name,executedAt) - At boot: scan
modules/*/migrations/*.js, compare with DB, run pending ones in order - Each migration exports
up()(and optionallydown()) - Migrations are idempotent (safe to re-run if crashed mid-way)
- Ordered by date prefix in filename (e.g.
2026-03-10-organizations-init.js) - Blocks app startup until all migrations complete
Acceptance criteria
- Migration runner executes pending migrations at boot
- Executed migrations are tracked in DB
- Already-executed migrations are skipped
- Migration failure prevents app from starting (with clear error log)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P1Critical — must be done firstCritical — must be done firstphase:2-orgsPhase 2: Multi-tenancy & OrganizationsPhase 2: Multi-tenancy & Organizations