Migration: Allergene/Zusatzstoffe je Gericht, abschaltbarer Passwort-Login, Favicon
- dishes.allergens/additives (text[]): Kennzeichnung wieder pro Gericht statt nur global, referenziert weiterhin die globalen Listen - profiles.password_auth_enabled: Nutzer können die eigene Passwort-Anmeldung deaktivieren; Spalten-Grant + neue Policy "profiles_update_own" (ersetzt profiles_update_own_name) - settings.favicon_path fürs austauschbare Favicon - Lokale PostgreSQL-Kopie (Docker + nativ) auf den neuen Stand gebracht
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
-- =============================================================
|
||||
-- Allergene/Zusatzstoffe pro Gericht, Passwort-Login abschaltbar,
|
||||
-- austauschbares Favicon
|
||||
-- =============================================================
|
||||
|
||||
-- ---------- Allergene/Zusatzstoffe je Gericht ----------
|
||||
-- Referenziert Kürzel aus den globalen Listen (allergens/additives),
|
||||
-- die weiterhin unterhalb der Speisekarte als Legende dienen.
|
||||
alter table public.dishes
|
||||
add column allergens text[] not null default '{}',
|
||||
add column additives text[] not null default '{}';
|
||||
|
||||
-- ---------- Passwort-Login pro Benutzer abschaltbar ----------
|
||||
alter table public.profiles
|
||||
add column password_auth_enabled boolean not null default true;
|
||||
|
||||
-- Selbstverwaltung: Nutzer dürfen zusätzlich zum Namen (Migration 0003)
|
||||
-- jetzt auch dieses eine Flag für ihr eigenes Konto setzen. Weiterhin
|
||||
-- kein Zugriff auf "role" oder "email" über diesen Weg.
|
||||
grant update (password_auth_enabled) on public.profiles to authenticated;
|
||||
|
||||
-- Klarerer Name für die inzwischen zwei selbstverwaltbaren Spalten.
|
||||
drop policy "profiles_update_own_name" on public.profiles;
|
||||
create policy "profiles_update_own"
|
||||
on public.profiles for update
|
||||
to authenticated
|
||||
using (id = (select auth.uid()))
|
||||
with check (id = (select auth.uid()));
|
||||
|
||||
-- ---------- Austauschbares Favicon ----------
|
||||
alter table public.settings
|
||||
add column favicon_path text;
|
||||
Reference in New Issue
Block a user