Terminplan: Dauer aus Stunden und Besetzung, Auslastung je Woche (0.12.0)
Some checks failed
Prüfung / tests (push) Has been cancelled
Prüfung / container (push) Has been cancelled

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AmyPfuNc4sCRfaF3oURXZz
This commit is contained in:
Claude
2026-10-20 07:12:26 +00:00
parent dd57169e9a
commit d5f861318b
16 changed files with 402 additions and 30 deletions

View File

@@ -33,7 +33,9 @@ export async function speichereStand(c: Client, s: Stand): Promise<Record<string
// so passt eine ältere Sicherung auch nach einer Migration
const vorhanden = new Set((await c.query<{ column_name: string }>(
"select column_name from information_schema.columns where table_schema = current_schema() and table_name = $1", [t.name])).rows.map((r) => r.column_name));
for (const z of zeilen) {
for (const zeile of zeilen) {
// T15: Vorgänge aus einer Sicherung von vor 0.12 behalten ihre Dauer
const z = t.name === "vorgang" && !("dauer_fest" in zeile) ? { ...zeile, dauer_fest: true } : zeile;
const spalten = Object.keys(z).filter((k) => vorhanden.has(k)).join(", ");
await c.query(`insert into ${t.name} (${spalten}) select ${spalten} from json_populate_record(null::${t.name}, $1::json)`, [JSON.stringify(z)]);
}