Tablett zuornung update
Build und Push Docker Image / build-and-push (push) Successful in 11s

This commit is contained in:
2026-11-05 08:53:55 +01:00
parent 4f6a4952d9
commit c954696d56
9 changed files with 291 additions and 62 deletions
+15
View File
@@ -99,5 +99,20 @@ def migrate():
'"erstellt_am" bigint, '
'"zuletzt_gesehen" bigint)'
)
# Änderungsverlauf der Tablet-Zuordnungen (wer/was/wann)
cur.execute(
'CREATE TABLE IF NOT EXISTS "Tablet_Verlauf" ('
'"id" serial PRIMARY KEY, "zeitpunkt" bigint NOT NULL, "tablet_id" integer, "kennung" text, '
'"tablet_name" text, "aktion" text NOT NULL, "details" text, "von_ip" text)'
)
# Ziel "Maschinen-Auswahl" wurde entfernt: betroffene Tablets sind wieder unzugeordnet.
cur.execute(
'INSERT INTO "Tablet_Verlauf" (zeitpunkt, tablet_id, kennung, tablet_name, aktion, details) '
"SELECT %s, id, kennung, name, 'Zuordnung entfernt', "
"'Ziel \"Maschinen-Auswahl\" gibt es nicht mehr: Tablet ist wieder nicht zugeordnet' "
'FROM "Tablets" WHERE ziel_typ = \'auswahl\'',
(int(time.time()),),
)
cur.execute('UPDATE "Tablets" SET ziel_typ = NULL, maschine_id = NULL WHERE ziel_typ = \'auswahl\'')
cur.execute('CREATE TABLE IF NOT EXISTS "Einstellungen" ("schluessel" text PRIMARY KEY, "wert" text)')
log.info("Schema-Migration geprüft/angewendet.")