BEGIN; -- Phase 5 des Self-Service-ISO-Plans: gespeicherte Installationsmedium- -- Konfiguration je Organisation (WLAN-Zugangsdaten, gewaehlte -- Bereitstellungsvorlage, Enrollment-Session-Parameter). Wie -- benutzer.organization_id bewusst ohne Foreign Key - Kundenplattform hat -- eine eigene, von provisioning-server getrennte Datenbank (siehe -- ADR-0011). Ein Datensatz je Organisation reicht (organization_id ist -- Primary Key statt eigener id-Spalte) - es gibt genau eine "aktuelle" -- Konfiguration, keine Historie. -- -- wifi_psk_encrypted: echte WLAN-Zugangsdaten, kein Passwort-Hash-Fall - -- muss entschluesselbar bleiben (wird beim ISO-Bau im Klartext an -- build_customer_iso.sh durchgereicht, siehe encryption.py), daher -- Fernet-verschluesselt statt gehasht. -- -- enrollment_session_id/iso_build_id verweisen auf provisioning-server- -- Ressourcen (ebenfalls ohne Foreign Key, andere Datenbank). Beide sind -- nullable, bis das erste Installationsmedium erstellt wurde. CREATE TABLE installationsmedium_konfiguration ( organization_id UUID PRIMARY KEY, wifi_ssid TEXT, wifi_psk_encrypted BYTEA, bereitstellungsvorlage_id UUID, max_devices INTEGER NOT NULL DEFAULT 20, validity_days INTEGER NOT NULL DEFAULT 30, enrollment_session_id UUID, iso_build_id UUID, updated_at TIMESTAMPTZ NOT NULL DEFAULT CURRENT_TIMESTAMP ); COMMIT;