feat: enhance database migration handling and health check endpoint
- Updated migration logic in main.py to allow skipping migrations during local development with SKIP_DB_MIGRATE environment variable. - Improved error handling for migration failures, ensuring the application does not start if migrations are incomplete. - Added a new health check endpoint (/api/health/ready) to verify database connection and essential tables, aiding in production debugging. - Enhanced run_migrations.py to support ordered execution of migration files and improved transaction handling. - Updated requirements.txt to include sqlparse for SQL statement parsing when psql is unavailable.
This commit is contained in:
1 parent
159ac8fb71
commit
1f2c8ea0f1
6 files changed
+341
-88
No files matched your search
@@ -10,3 +10,4 @@ slowapi==0.1.9
|
||||
psycopg2-binary==2.9.9
|
||||
python-dateutil==2.9.0
|
||||
tzdata>=2024.1 # ZoneInfo (Europe/Berlin) auch unter Windows
|
||||
sqlparse>=0.5.0 # Migrationen: Statements splitten (Fallback ohne psql)
|
||||
Reference in new issue
Block a user