{"id":"68fe9063acff61c93e9e3b3f","title":"2025 10 26","path":"how-to/committee/release-notes/2025-10-26","contentMarkdown":"# 26th October 2024 — Server-side database migration system [#68](https://github.com/nbarrett/ngx-ramblers/issues/68)\n## [build 333](https://github.com/nbarrett/ngx-ramblers/actions/runs/18823789797) — [refs #68](https://github.com/nbarrett/ngx-ramblers/issues/68) — [commit 52ec96f](https://github.com/nbarrett/ngx-ramblers/commit/52ec96f)\n\nA comprehensive server-side migration management system using [migrate-mongo](https://github.com/seppevs/migrate-mongo), allowing administrators to simulate, monitor, and control database migrations through the admin interface with persistent simulation mode, real-time WebSocket progress tracking, and protective route guards.\n\n**Where to Find It**\n\n- **Admin → Maintenance**: Migration management interface with simulation controls\n- **Route Protection**: Automatic access blocking when migrations are pending or failed\n\n**Benefits**\n- **Safe Testing**: Simulation mode allows testing migrations without affecting production data\n- **Real-Time Monitoring**: WebSocket integration provides live updates during execution\n- **Automatic Protection**: Route guards prevent system access during migration issues\n- **Persistent State**: Simulation state persists across server restarts for reliable testing\n- **Health Integration**: System health checks reflect migration status\n\n\n_View of successfully applied database migrations_\n\n\n![](https://ngx-ramblers.org.uk/api/aws/s3/site-content/b5864df5-8051-4d58-84c4-2966ddd29c89.jpeg)\n\n_View of simulation of failed database migrations_\n\n\n![](https://ngx-ramblers.org.uk/api/aws/s3/site-content/282130a5-6da1-4091-9b20-9a1b30ab1412.jpeg)\n\n_View of maintenance page from non-logged in  perspective_\n\n\n![](https://ngx-ramblers.org.uk/api/aws/s3/site-content/f3c36638-e801-4e2c-aa6b-bbe297834429.jpeg)\n\n\n## Centralise environment variables (refs [#68](https://github.com/nbarrett/ngx-ramblers/issues/68)) ([b93c69b](https://github.com/nbarrett/ngx-ramblers/commit/b93c69b))\n\nEnvironment configuration refactored with type-safe enum, migration system enhancements for database-driven status, and improved health monitoring. Migration file detection now excludes TypeScript declaration files and provides consistent status across all environments.\n\n**Benefits**\n\n- **Type Safety**: Environment variables use TypeScript enums with IDE autocomplete\n- **Deployment Reliability**: Server starts even when NODE_ENV not explicitly set (defaults to \"development\")\n- **Consistent Migration Display**: Database-driven status shows same files locally and in production\n- **Improved Monitoring**: Health checks accurately reflect migration state for automated alerts\n- **Cleaner Logs**: TypeScript declaration files no longer incorrectly identified as migrations\n- **Better Maintainability**: Centralised environment variable definitions\n- **Database-Driven Status**: Migration state purely from database, independent of environment\n- **Improved File Detection**: Filters exclude .d.ts and .d.js files, normalise .ts/.js handling\n","contentHtml":"<h1>26th October 2024 — Server-side database migration system <a href=\"https://github.com/nbarrett/ngx-ramblers/issues/68\">#68</a></h1>\n<h2><a href=\"https://github.com/nbarrett/ngx-ramblers/actions/runs/18823789797\">build 333</a> — <a href=\"https://github.com/nbarrett/ngx-ramblers/issues/68\">refs #68</a> — <a href=\"https://github.com/nbarrett/ngx-ramblers/commit/52ec96f\">commit 52ec96f</a></h2>\n<p>A comprehensive server-side migration management system using <a href=\"https://github.com/seppevs/migrate-mongo\">migrate-mongo</a>, allowing administrators to simulate, monitor, and control database migrations through the admin interface with persistent simulation mode, real-time WebSocket progress tracking, and protective route guards.</p>\n<p><strong>Where to Find It</strong></p>\n<ul>\n<li><strong>Admin → Maintenance</strong>: Migration management interface with simulation controls</li>\n<li><strong>Route Protection</strong>: Automatic access blocking when migrations are pending or failed</li>\n</ul>\n<p><strong>Benefits</strong></p>\n<ul>\n<li><strong>Safe Testing</strong>: Simulation mode allows testing migrations without affecting production data</li>\n<li><strong>Real-Time Monitoring</strong>: WebSocket integration provides live updates during execution</li>\n<li><strong>Automatic Protection</strong>: Route guards prevent system access during migration issues</li>\n<li><strong>Persistent State</strong>: Simulation state persists across server restarts for reliable testing</li>\n<li><strong>Health Integration</strong>: System health checks reflect migration status</li>\n</ul>\n<p><em>View of successfully applied database migrations</em></p>\n<p><img src=\"https://ngx-ramblers.org.uk/api/aws/s3/site-content/b5864df5-8051-4d58-84c4-2966ddd29c89.jpeg\" alt=\"\"></p>\n<p><em>View of simulation of failed database migrations</em></p>\n<p><img src=\"https://ngx-ramblers.org.uk/api/aws/s3/site-content/282130a5-6da1-4091-9b20-9a1b30ab1412.jpeg\" alt=\"\"></p>\n<p><em>View of maintenance page from non-logged in  perspective</em></p>\n<p><img src=\"https://ngx-ramblers.org.uk/api/aws/s3/site-content/f3c36638-e801-4e2c-aa6b-bbe297834429.jpeg\" alt=\"\"></p>\n<h2>Centralise environment variables (refs <a href=\"https://github.com/nbarrett/ngx-ramblers/issues/68\">#68</a>) (<a href=\"https://github.com/nbarrett/ngx-ramblers/commit/b93c69b\">b93c69b</a>)</h2>\n<p>Environment configuration refactored with type-safe enum, migration system enhancements for database-driven status, and improved health monitoring. Migration file detection now excludes TypeScript declaration files and provides consistent status across all environments.</p>\n<p><strong>Benefits</strong></p>\n<ul>\n<li><strong>Type Safety</strong>: Environment variables use TypeScript enums with IDE autocomplete</li>\n<li><strong>Deployment Reliability</strong>: Server starts even when NODE_ENV not explicitly set (defaults to &quot;development&quot;)</li>\n<li><strong>Consistent Migration Display</strong>: Database-driven status shows same files locally and in production</li>\n<li><strong>Improved Monitoring</strong>: Health checks accurately reflect migration state for automated alerts</li>\n<li><strong>Cleaner Logs</strong>: TypeScript declaration files no longer incorrectly identified as migrations</li>\n<li><strong>Better Maintainability</strong>: Centralised environment variable definitions</li>\n<li><strong>Database-Driven Status</strong>: Migration state purely from database, independent of environment</li>\n<li><strong>Improved File Detection</strong>: Filters exclude .d.ts and .d.js files, normalise .ts/.js handling</li>\n</ul>\n"}