Commit
feat: Add reliable database migration system for Railway deployments
Commit details
Commit notes
This commit introduces a robust migration system that handles: - Fresh databases and databases set up with db:push - Automatic migration running on Railway deployments - Connection retries with exponential backoff - Clear diagnostics and logging
Changes: - Add scripts/migrate-deploy.ts: Deploy-safe migration script with retry logic - Add scripts/sync-migrations.ts: Tool to sync migrations with database state - Update scripts/check-migrations.ts: Better diagnostics and JSON output - Update railway.json: Run migrations before app starts - Update package.json: Add new migration commands - Update _journal.json: Add missing 0017_password_reset_tokens entry - Update RAILWAY.md: Document new migration workflow - Update LIVE_MIGRATION_STRATEGY.md: Document deploy migration script
New commands: - bun run db:migrate:deploy - Deploy-safe migration with retries - bun run db:sync status|mark-all|reset|introspect - Migration sync tools - bun run db:check --json|--verbose|--fix - Enhanced migration checking
Co-authored-by: armin.naimi <[email redacted]>
- Files changed
- 8
- Lines added
- +1,135
- Lines removed
- −47