TeamVis Self-Host-Bundle v0.46.1
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
-- ====================================================================
|
||||
-- 0066_push_preferences — Push pro Ereignisart schaltbar
|
||||
-- ====================================================================
|
||||
-- Bisher war Push ein Alles-oder-nichts-Schalter pro Gerät: wer ihn
|
||||
-- aktivierte, bekam Leads, Terminanfragen, Buchungen und Empfangs-Besuche.
|
||||
-- Diese Tabelle hält pro Mitarbeiter:in, welche Ereignisarten überhaupt
|
||||
-- eine Mitteilung auslösen — geräteübergreifend (Web-Push wie native App),
|
||||
-- denn die Auswahl ist eine inhaltliche Entscheidung, keine Geräte-Frage.
|
||||
--
|
||||
-- Fehlende Zeile = alles aktiviert. Damit ändert sich für Bestandsnutzer
|
||||
-- nichts, solange sie nichts abwählen; lib/push.ts liest den Default so.
|
||||
--
|
||||
-- Zugriff ausschließlich über Service-Role (Portal-Actions und
|
||||
-- /api/portal/*, jeweils employeeId-gescoped) — kein anon-Zugriff.
|
||||
|
||||
create table if not exists public.push_preferences (
|
||||
employee_id uuid primary key references public.employees(id) on delete cascade,
|
||||
leads boolean not null default true,
|
||||
appointments boolean not null default true,
|
||||
bookings boolean not null default true,
|
||||
reception boolean not null default true,
|
||||
updated_at timestamptz not null default now()
|
||||
);
|
||||
|
||||
alter table public.push_preferences enable row level security;
|
||||
revoke all on public.push_preferences from anon;
|
||||
Reference in New Issue
Block a user