Add bootstrap v2, preflight readiness and migration tooling
This commit is contained in:
Executable
+33
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
DB_FILE="/opt/appfactory/data/appfactory/appfactory.db"
|
||||
|
||||
python3 - "$DB_FILE" <<'PY'
|
||||
import sqlite3
|
||||
import sys
|
||||
|
||||
db = sqlite3.connect(sys.argv[1])
|
||||
|
||||
db.execute("""
|
||||
CREATE TABLE IF NOT EXISTS service_health (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
service_id TEXT NOT NULL,
|
||||
status TEXT NOT NULL,
|
||||
http_status INTEGER,
|
||||
response_time_ms INTEGER,
|
||||
error_text TEXT,
|
||||
checked_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
)
|
||||
""")
|
||||
|
||||
db.execute("""
|
||||
CREATE INDEX IF NOT EXISTS idx_service_health_service
|
||||
ON service_health(service_id, checked_at DESC)
|
||||
""")
|
||||
|
||||
db.commit()
|
||||
db.close()
|
||||
|
||||
print("Health migration completed")
|
||||
PY
|
||||
Reference in New Issue
Block a user