Skip to content

Commit

Permalink
Nichtschueler = null und Klasse mit Update
Browse files Browse the repository at this point in the history
  • Loading branch information
hmt committed Aug 17, 2021
1 parent 16aa016 commit f3bc76d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Einstellungen.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@
.map((v) => `(${v.id}, '${v.kurs_lehrer || ""}', '${v.kurs || ""}')`)
.join(",");
const query = [
sql`DELETE FROM schueler WHERE NOT nichtschueler AND NOT EXISTS ( SELECT * FROM ausleihe WHERE ausleihe.schueler_id = schueler.id)`,
sql`DELETE FROM schueler WHERE nichtschueler IS NULL AND NOT EXISTS ( SELECT * FROM ausleihe WHERE ausleihe.schueler_id = schueler.id)`,
sql`INSERT INTO schueler (schild_id, jahr, klasse, name, vorname) VALUES ${schueler_values}
ON CONFLICT (schild_id) DO UPDATE SET jahr = ${jahr}`,
ON CONFLICT (schild_id) DO UPDATE SET jahr = excluded.jahr, klasse = excluded.klasse`,
sql`DELETE FROM kurszugehoerigkeit`,
sql`INSERT INTO kurszugehoerigkeit (schild_id, kurs_lehrer, kurs) VALUES ${kurszugehoerigkeit_values}`,
];
Expand Down

0 comments on commit f3bc76d

Please sign in to comment.