c1a4d2d9af
Archive completed database initialization and recovery change.
27 lines
1.2 KiB
Markdown
27 lines
1.2 KiB
Markdown
## Why
|
|
|
|
The application currently fails to start when database tables are missing or migrations haven't been applied. This creates a poor deployment experience and requires manual intervention. We need automatic database initialization, migration management, and seed data handling to ensure the application starts reliably in any environment.
|
|
|
|
## What Changes
|
|
|
|
- **Auto-run migrations on startup** instead of requiring manual `alembic upgrade head`
|
|
- **Improve startup error handling** with clear error messages when DB is unavailable
|
|
- **Add database readiness checks** before attempting migrations or seeding
|
|
- **Seed data management** with proper handling of missing tables
|
|
- **Better database initialization** in Docker environments
|
|
|
|
## Capabilities
|
|
|
|
### New Capabilities
|
|
- `database-initialization`: Automatic database setup including migrations and seed data
|
|
|
|
### Modified Capabilities
|
|
- `docker-infrastructure`: Add database initialization scripts and health checks
|
|
|
|
## Impact
|
|
|
|
- `apps/api/src/main.py`: Add startup database initialization
|
|
- `apps/api/src/database.py`: Add connection health checks
|
|
- `apps/api/Dockerfile`: Add init scripts
|
|
- `docker-compose.yml` and `docker-compose.traefik.yml`: Update startup behavior
|