TeamVis Self-Host-Bundle v0.31.0

This commit is contained in:
TeamVis Release
2026-06-25 16:38:31 +02:00
commit 717325742d
68 changed files with 3762 additions and 0 deletions
@@ -0,0 +1,31 @@
-- Vertretungen können auch Personen sein.
-- ====================================================================
-- Bisher: deputies.deputy_position_id (NOT NULL) — eine Stelle vertritt
-- eine andere Stelle.
--
-- Erweiterung: deputy_employee_id (nullable) — eine Stelle wird von
-- einer konkreten Person vertreten, ohne dass diese Person eine eigene
-- Stelle haben muss. Anwendungsfall: Mitarbeiter wie P. Schmid stehen
-- offiziell auf "Strom-Netz", vertreten aber die Leitung Strom-Netz.
--
-- CHECK-Constraint stellt sicher: genau eines von beiden ist gesetzt.
alter table public.deputies
add column if not exists deputy_employee_id uuid
references public.employees(id) on delete cascade;
alter table public.deputies
alter column deputy_position_id drop not null;
alter table public.deputies
drop constraint if exists deputies_target_check;
alter table public.deputies
add constraint deputies_target_check
check (
(deputy_position_id is not null)::int
+ (deputy_employee_id is not null)::int = 1
);
create index if not exists deputies_deputy_employee_idx
on public.deputies (deputy_employee_id);