Migration: Übersetzungsspalten für Inhalte + Rezeptvorschläge-Tabelle

dishes/sections/allergens/additives bekommen _en/_pl-Spalten; die 14
EU-Allergene, 11 Zusatzstoff-Kennzeichnungen und 4 Bereiche sind direkt
mit Referenz-Übersetzungen befüllt. localized() liefert den Text zur
aktuellen Sprache mit Fallback auf Deutsch. Neue Tabelle
dish_suggestions (RLS: jeder darf einreichen, nur Staff/Admin lesen).
Lokale PostgreSQL-Kopie auf den neuen Stand gebracht.
This commit is contained in:
2026-07-18 02:08:01 +02:00
parent 33909c660b
commit 1cc19de221
4 changed files with 220 additions and 67 deletions
+62 -4
View File
@@ -22,6 +22,9 @@ 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;
@@ -106,7 +109,9 @@ SET default_table_access_method = heap;
CREATE TABLE public.additives (
code text NOT NULL,
name text NOT NULL,
sort integer DEFAULT 0 NOT NULL
sort integer DEFAULT 0 NOT NULL,
name_en text,
name_pl text
);
@@ -117,7 +122,21 @@ CREATE TABLE public.additives (
CREATE TABLE public.allergens (
code text NOT NULL,
name text NOT NULL,
sort integer DEFAULT 0 NOT NULL
sort integer DEFAULT 0 NOT NULL,
name_en text,
name_pl text
);
--
-- Name: dish_suggestions; Type: TABLE; Schema: public; Owner: -
--
CREATE TABLE public.dish_suggestions (
id uuid DEFAULT gen_random_uuid() NOT NULL,
name text NOT NULL,
description text,
created_at timestamp with time zone DEFAULT now() NOT NULL
);
@@ -132,7 +151,9 @@ CREATE TABLE public.dishes (
created_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
additives text[] DEFAULT '{}'::text[] NOT NULL,
name_en text,
name_pl text
);
@@ -173,7 +194,9 @@ CREATE TABLE public.sections (
key text NOT NULL,
label text NOT NULL,
time_range text NOT NULL,
sort integer NOT NULL
sort integer NOT NULL,
label_en text,
label_pl text
);
@@ -207,6 +230,14 @@ ALTER TABLE ONLY public.allergens
ADD CONSTRAINT allergens_pkey PRIMARY KEY (code);
--
-- Name: dish_suggestions dish_suggestions_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY public.dish_suggestions
ADD CONSTRAINT dish_suggestions_pkey PRIMARY KEY (id);
--
-- Name: dishes dishes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
--
@@ -340,6 +371,33 @@ CREATE POLICY allergens_public_read ON public.allergens FOR SELECT TO authentica
CREATE POLICY allergens_staff_write ON public.allergens TO authenticated USING ((public.app_role() = ANY (ARRAY['staff'::text, 'admin'::text]))) WITH CHECK ((public.app_role() = ANY (ARRAY['staff'::text, 'admin'::text])));
--
-- Name: dish_suggestions; Type: ROW SECURITY; Schema: public; Owner: -
--
ALTER TABLE public.dish_suggestions ENABLE ROW LEVEL SECURITY;
--
-- Name: dish_suggestions dish_suggestions_public_insert; Type: POLICY; Schema: public; Owner: -
--
CREATE POLICY dish_suggestions_public_insert ON public.dish_suggestions FOR INSERT TO authenticated, anon WITH CHECK (true);
--
-- Name: dish_suggestions dish_suggestions_staff_delete; Type: POLICY; Schema: public; Owner: -
--
CREATE POLICY dish_suggestions_staff_delete ON public.dish_suggestions FOR DELETE TO authenticated USING ((public.app_role() = ANY (ARRAY['staff'::text, 'admin'::text])));
--
-- Name: dish_suggestions dish_suggestions_staff_select; Type: POLICY; Schema: public; Owner: -
--
CREATE POLICY dish_suggestions_staff_select ON public.dish_suggestions FOR SELECT TO authenticated USING ((public.app_role() = ANY (ARRAY['staff'::text, 'admin'::text])));
--
-- Name: dishes; Type: ROW SECURITY; Schema: public; Owner: -
--
+66 -52
View File
@@ -2,7 +2,7 @@
-- PostgreSQL database dump
--
\restrict WmQEI7C1lM8AheyDeBFMpJzZHr1ZhZm5NphQHzcUeS7IAzg73qb94aso6w4qDad
\restrict m2Vnc4kNXrHeKWS4dSX5SqMU5nUOxMfipXDVyLuYabYYzEbAHutmaRS8m10Dsdh
-- Dumped from database version 17.6
-- Dumped by pg_dump version 17.10
@@ -27,18 +27,18 @@ SET SESSION AUTHORIZATION DEFAULT;
ALTER TABLE public.additives DISABLE TRIGGER ALL;
COPY public.additives (code, name, sort) FROM stdin;
1 mit Farbstoff 1
2 mit Konservierungsstoff 2
3 mit Antioxidationsmittel 3
4 mit Geschmacksverstärker 4
5 geschwefelt 5
6 geschwärzt 6
7 gewachst 7
8 mit Phosphat 8
9 mit Süßungsmittel(n) 9
10 enthält eine Phenylalaninquelle 10
11 koffeinhaltig 11
COPY public.additives (code, name, sort, name_en, name_pl) FROM stdin;
1 mit Farbstoff 1 with colouring z barwnikiem
2 mit Konservierungsstoff 2 with preservative z konserwantem
3 mit Antioxidationsmittel 3 with antioxidant z przeciwutleniaczem
4 mit Geschmacksverstärker 4 with flavour enhancer ze wzmacniaczem smaku
5 geschwefelt 5 sulphured siarkowany
6 geschwärzt 6 blackened barwiony na czarno
7 gewachst 7 waxed woskowany
8 mit Phosphat 8 with phosphate z fosforanem
9 mit Süßungsmittel(n) 9 with sweetener(s) ze słodzikiem/słodzikami
10 enthält eine Phenylalaninquelle 10 contains a source of phenylalanine zawiera źródło fenyloalaniny
11 koffeinhaltig 11 caffeinated zawiera kofeinę
\.
@@ -50,50 +50,64 @@ ALTER TABLE public.additives ENABLE TRIGGER ALL;
ALTER TABLE public.allergens DISABLE TRIGGER ALL;
COPY public.allergens (code, name, sort) FROM stdin;
A Glutenhaltiges Getreide 1
B Krebstiere 2
C Eier 3
D Fisch 4
E Erdnüsse 5
F Sojabohnen 6
G Milch (einschließlich Laktose) 7
H Schalenfrüchte (Nüsse) 8
I Sellerie 9
J Senf 10
K Sesamsamen 11
L Schwefeldioxid und Sulfite 12
M Lupinen 13
N Weichtiere 14
COPY public.allergens (code, name, sort, name_en, name_pl) FROM stdin;
A Glutenhaltiges Getreide 1 Cereals containing gluten Zboża zawierające gluten
B Krebstiere 2 Crustaceans Skorupiaki
C Eier 3 Eggs Jaja
D Fisch 4 Fish Ryby
E Erdnüsse 5 Peanuts Orzeszki ziemne
F Sojabohnen 6 Soybeans Soja
G Milch (einschließlich Laktose) 7 Milk (including lactose) Mleko (w tym laktoza)
H Schalenfrüchte (Nüsse) 8 Tree nuts Orzechy
I Sellerie 9 Celery Seler
J Senf 10 Mustard Gorczyca
K Sesamsamen 11 Sesame seeds Nasiona sezamu
L Schwefeldioxid und Sulfite 12 Sulphur dioxide and sulphites Dwutlenek siarki i siarczyny
M Lupinen 13 Lupin Łubin
N Weichtiere 14 Molluscs Mięczaki
\.
ALTER TABLE public.allergens ENABLE TRIGGER ALL;
--
-- Data for Name: dish_suggestions; Type: TABLE DATA; Schema: public; Owner: -
--
ALTER TABLE public.dish_suggestions DISABLE TRIGGER ALL;
COPY public.dish_suggestions (id, name, description, created_at) FROM stdin;
\.
ALTER TABLE public.dish_suggestions ENABLE TRIGGER ALL;
--
-- Data for Name: dishes; Type: TABLE DATA; Schema: public; Owner: -
--
ALTER TABLE public.dishes DISABLE TRIGGER ALL;
COPY public.dishes (id, name, price, created_at, updated_at, allergens, additives) FROM stdin;
bf612ae7-8cdd-4149-8b21-f651631ccc02 Hackfleischbaguette 3.20 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
81c58cc6-7298-4d4a-9997-71d17df5aedf Knusperhähnchen Wrap 3.70 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
cc7fb9d9-a9ab-4c4c-a376-a8fae0e801c9 Leberkäse im Brötchen 2.30 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
14ef6893-93a7-4649-afe3-d6b6bdf5903c Schnitzel Baguette 3.50 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
ec3c5e37-9cbc-4c92-ab05-1e3fb942c504 Penne mit Grünen Spargel und Garnelenspieße 5.90 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
dbe5ee6e-8b04-4bf7-99bb-f936f6564217 Bratkartoffel Gemüse Pfanne mit Hähnchenbrust und Dip 5.90 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
c0613fe7-e5c6-489e-afe5-6da2533b2bd4 Schweinefilet im Speckmantel dazu Rahmsoße und Butterspätzle 5.90 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
c5cfa5b4-e502-4b56-b579-b9fbbf817f25 Penne mit Grünen Spargel, get. Tomaten und Cherrytomaten 5.30 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
f8ba1844-1f23-4b23-9e03-f59148f8b2ed Spaghetti mit fruchtiger Tomatensauce und Parmesan 5.30 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
7a6fed05-e0f5-4e97-bdd4-a46c5ef1376a Gebackener Feta mit griechischen Bauernsalat und Baguette 5.30 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
ff40ea65-63bc-4d01-b626-e0c9e5d2acb3 Gemüse-Curry mit Basmatireis 4.90 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
ea26f18b-ddf3-4899-95e7-5dbd0878d90c Kartoffelcremesuppe 1.50 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
6222d5f4-05e3-4af4-a41c-3f8b4c9c5c78 Gulaschsuppe 2.50 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
3c8cf0c2-b0a9-43e3-8233-723d5718a157 Tomatensuppe mit Croutons 1.80 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
2dd85835-5425-4271-9fc0-e5215bbce476 Kürbiscremesuppe 1.80 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
06df753a-65ed-4bd0-a325-d32c78ec88fa Linseneintopf mit Würstchen 2.20 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {}
a987c96f-25a0-4e5e-b8a8-aab683a01feb Chili con Carne mit Brötchen 3.90 2026-07-17 15:17:02.979184+00 2026-07-17 22:21:35.276672+00 {A} {4}
COPY public.dishes (id, name, price, created_at, updated_at, allergens, additives, name_en, name_pl) FROM stdin;
bf612ae7-8cdd-4149-8b21-f651631ccc02 Hackfleischbaguette 3.20 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
81c58cc6-7298-4d4a-9997-71d17df5aedf Knusperhähnchen Wrap 3.70 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
cc7fb9d9-a9ab-4c4c-a376-a8fae0e801c9 Leberkäse im Brötchen 2.30 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
14ef6893-93a7-4649-afe3-d6b6bdf5903c Schnitzel Baguette 3.50 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
ec3c5e37-9cbc-4c92-ab05-1e3fb942c504 Penne mit Grünen Spargel und Garnelenspieße 5.90 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
dbe5ee6e-8b04-4bf7-99bb-f936f6564217 Bratkartoffel Gemüse Pfanne mit Hähnchenbrust und Dip 5.90 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
c0613fe7-e5c6-489e-afe5-6da2533b2bd4 Schweinefilet im Speckmantel dazu Rahmsoße und Butterspätzle 5.90 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
c5cfa5b4-e502-4b56-b579-b9fbbf817f25 Penne mit Grünen Spargel, get. Tomaten und Cherrytomaten 5.30 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
f8ba1844-1f23-4b23-9e03-f59148f8b2ed Spaghetti mit fruchtiger Tomatensauce und Parmesan 5.30 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
7a6fed05-e0f5-4e97-bdd4-a46c5ef1376a Gebackener Feta mit griechischen Bauernsalat und Baguette 5.30 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
ff40ea65-63bc-4d01-b626-e0c9e5d2acb3 Gemüse-Curry mit Basmatireis 4.90 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
ea26f18b-ddf3-4899-95e7-5dbd0878d90c Kartoffelcremesuppe 1.50 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
6222d5f4-05e3-4af4-a41c-3f8b4c9c5c78 Gulaschsuppe 2.50 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
3c8cf0c2-b0a9-43e3-8233-723d5718a157 Tomatensuppe mit Croutons 1.80 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
2dd85835-5425-4271-9fc0-e5215bbce476 Kürbiscremesuppe 1.80 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
06df753a-65ed-4bd0-a325-d32c78ec88fa Linseneintopf mit Würstchen 2.20 2026-07-17 15:17:02.979184+00 2026-07-17 15:17:02.979184+00 {} {} \N \N
a987c96f-25a0-4e5e-b8a8-aab683a01feb Chili con Carne mit Brötchen 3.90 2026-07-17 15:17:02.979184+00 2026-07-17 22:21:35.276672+00 {A} {4} \N \N
7ebdf56a-9482-4bde-bf60-e6e5424e397b Kürbisrisotto 0.00 2026-07-17 23:57:48.351754+00 2026-07-17 23:57:48.351754+00 {} {} \N \N
fd356340-e10f-42d7-ae5a-3521a9151bb8 Test 0.00 2026-07-17 23:58:04.141825+00 2026-07-17 23:58:19.411846+00 {} {} abc bca
\.
@@ -105,11 +119,11 @@ ALTER TABLE public.dishes ENABLE TRIGGER ALL;
ALTER TABLE public.sections DISABLE TRIGGER ALL;
COPY public.sections (key, label, time_range, sort) FROM stdin;
brotzeit Brotzeit 09:00 - 10:00 1
mittagessen Mittagessen 11:30 - 13:30 2
mittagessen_veg Mittagessen vegetarisch 11:30 - 13:30 3
suppe Suppe 11:30 - 13:30 4
COPY public.sections (key, label, time_range, sort, label_en, label_pl) FROM stdin;
brotzeit Brotzeit 09:00 - 10:00 1 Breakfast Śniadanie
mittagessen Mittagessen 11:30 - 13:30 2 Lunch Obiad
mittagessen_veg Mittagessen vegetarisch 11:30 - 13:30 3 Lunch (vegetarian) Obiad (wegetariański)
suppe Suppe 11:30 - 13:30 4 Soup Zupa
\.
@@ -194,5 +208,5 @@ ALTER TABLE public.settings ENABLE TRIGGER ALL;
-- PostgreSQL database dump complete
--
\unrestrict WmQEI7C1lM8AheyDeBFMpJzZHr1ZhZm5NphQHzcUeS7IAzg73qb94aso6w4qDad
\unrestrict m2Vnc4kNXrHeKWS4dSX5SqMU5nUOxMfipXDVyLuYabYYzEbAHutmaRS8m10Dsdh