feat: enhance database migration handling and health check endpoint
Deploy Development / deploy (push) Successful in 37s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Failing after 1m55s

- 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:
Lars committed 2026-04-29 12:29:39 +02:00
1 parent 159ac8fb71
commit 1f2c8ea0f1
6 files changed
+341 -88

No files matched your search

+34 -2
View File
@@ -1,7 +1,7 @@
# Shinkan Jinkendo Version Information
APP_VERSION = "0.8.0"
BUILD_DATE = "2026-04-28"
APP_VERSION = "0.8.4"
BUILD_DATE = "2026-04-27"
DB_SCHEMA_VERSION = "20260428031"
MODULE_VERSIONS = {
@@ -23,6 +23,38 @@ MODULE_VERSIONS = {
}
CHANGELOG = [
{
"version": "0.8.4",
"date": "2026-04-27",
"changes": [
"run_migrations: Warteschlange nach numerischem Präfix der Dateien (stabile Reihenfolge auch bei ungleich langen Zahlen wie 9 vs 10)",
],
},
{
"version": "0.8.3",
"date": "2026-04-28",
"changes": [
"Migrationen: Warteschlange aller fehlenden *.sql; idempotent über schema_migrations",
"Ausführung vorzugsweise psql -1 -f (eine Transaktion pro Datei); Fallback psycopg2 + sqlparse.split",
"requirements: sqlparse wenn kein psql im PATH",
],
},
{
"version": "0.8.2",
"date": "2026-04-28",
"changes": [
"main: run_migrations — Exit-Code auswerten; bei Fehler kein API-Start (verhindert Prod ohne Skill-Tabellen wie 022)",
"SKIP_DB_MIGRATE=1 optional für lokale Runs ohne Datenbank",
],
},
{
"version": "0.8.1",
"date": "2026-04-28",
"changes": [
"skills: JSONB keywords per psycopg2.extras.Json (verhindert 500 wenn keywords als Objekt/Array gesendet wird)",
"GET /api/health/ready: DB-Verbindung + Kern-Tabellen + schema_migrations_count (ohne Auth, für Prod-Debugging)",
],
},
{
"version": "0.8.0",
"date": "2026-04-28",