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:
2026-07-18 00:46:38 +02:00
parent 4e4abed0ca
commit 29ca8e1227
4 changed files with 79 additions and 34 deletions
+9 -6
View File
@@ -2,6 +2,7 @@
-- PostgreSQL database dump
--
-- Dumped from database version 17.6
-- Dumped by pg_dump version 17.10
@@ -21,9 +22,6 @@ SET row_security = off;
-- Name: public; Type: SCHEMA; Schema: -; Owner: -
--
-- Das "public"-Schema existiert im offiziellen postgres-Image bereits;
-- CREATE SCHEMA würde dort mit ON_ERROR_STOP=1 das komplette Init-Skript
-- abbrechen.
CREATE SCHEMA IF NOT EXISTS public;
@@ -132,7 +130,9 @@ CREATE TABLE public.dishes (
name text NOT NULL,
price numeric(6,2) DEFAULT 0 NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
updated_at timestamp with time zone DEFAULT now() NOT NULL
updated_at timestamp with time zone DEFAULT now() NOT NULL,
allergens text[] DEFAULT '{}'::text[] NOT NULL,
additives text[] DEFAULT '{}'::text[] NOT NULL
);
@@ -160,6 +160,7 @@ CREATE TABLE public.profiles (
full_name text DEFAULT ''::text NOT NULL,
role text DEFAULT 'staff'::text NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL,
password_auth_enabled boolean DEFAULT true NOT NULL,
CONSTRAINT profiles_role_check CHECK ((role = ANY (ARRAY['admin'::text, 'staff'::text])))
);
@@ -185,6 +186,7 @@ CREATE TABLE public.settings (
colors jsonb DEFAULT '{}'::jsonb NOT NULL,
logo_path text,
updated_at timestamp with time zone DEFAULT now() NOT NULL,
favicon_path text,
CONSTRAINT settings_id_check CHECK ((id = 1))
);
@@ -392,10 +394,10 @@ CREATE POLICY profiles_select_own_or_admin ON public.profiles FOR SELECT TO auth
--
-- Name: profiles profiles_update_own_name; Type: POLICY; Schema: public; Owner: -
-- Name: profiles profiles_update_own; Type: POLICY; Schema: public; Owner: -
--
CREATE POLICY profiles_update_own_name ON public.profiles FOR UPDATE TO authenticated USING ((id = ( SELECT auth.uid() AS uid))) WITH CHECK ((id = ( SELECT auth.uid() AS uid)));
CREATE POLICY profiles_update_own ON public.profiles FOR UPDATE TO authenticated USING ((id = ( SELECT auth.uid() AS uid))) WITH CHECK ((id = ( SELECT auth.uid() AS uid)));
--
@@ -435,3 +437,4 @@ CREATE POLICY settings_public_read ON public.settings FOR SELECT TO authenticate
-- PostgreSQL database dump complete
--