Aufraeumen: Schulcomputer Basis entfernt, Workspace-Liste mit Freigabe-Namen
Testprofile von Default Lab und WLAN-Test zeigen auf die Vorlagen Schulcomputer (Mint/Debian/Ubuntu) derselben Distro, die Basis-Workspaces entfallen (Migration 0054). fetch_workspaces() liefert die Namen der freigegebenen Kundengruppen/Organisationen fuer Anzeigen wie "Vorlage fuer Schulen". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1288097927
commit
f4c306e389
2 files changed
+43
-2
No files matched your search
@@ -0,0 +1,32 @@
|
||||
BEGIN;
|
||||
|
||||
-- Aufräumen (Nutzer-Entscheidung 07.10.2026): "Schulcomputer Basis
|
||||
-- (Mint/Debian/Ubuntu)" war nur der alte 3-Merkmale-Stand für die Testprofile
|
||||
-- von Default Lab und WLAN-Test (Migration 0052). Diese Profile zeigen jetzt
|
||||
-- auf die Vorlagen "Schulcomputer (…)" derselben Distro; danach entfallen die
|
||||
-- Basis-Workspaces. Test-Geräte dieser Profile bekommen beim nächsten
|
||||
-- Check-in den vollen Schulcomputer.
|
||||
UPDATE bereitstellungsvorlagen bv
|
||||
SET workspace_id = ziel.id, updated_at = now()
|
||||
FROM workspaces basis, workspaces ziel
|
||||
WHERE bv.workspace_id = basis.id
|
||||
AND basis.organization_id IS NULL AND basis.key LIKE 'schulcomputer-basis-%'
|
||||
AND ziel.organization_id IS NULL AND ziel.key = replace(basis.key, 'schulcomputer-basis-', 'schulcomputer-')
|
||||
AND ziel.backend_id = basis.backend_id;
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
IF EXISTS (
|
||||
SELECT 1 FROM bereitstellungsvorlagen bv JOIN workspaces w ON w.id = bv.workspace_id
|
||||
WHERE w.key LIKE 'schulcomputer-basis-%' AND w.organization_id IS NULL
|
||||
) OR EXISTS (
|
||||
SELECT 1 FROM organisationseinheiten oe JOIN workspaces w ON w.id = oe.workspace_id
|
||||
WHERE w.key LIKE 'schulcomputer-basis-%' AND w.organization_id IS NULL
|
||||
) THEN
|
||||
RAISE EXCEPTION 'Schulcomputer Basis wird noch verwendet';
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
DELETE FROM workspaces WHERE organization_id IS NULL AND key LIKE 'schulcomputer-basis-%';
|
||||
|
||||
COMMIT;
|
||||
Reference in new issue
Block a user