From d59b20d4ba0140854c3cb2dd5703e2611e187da8 Mon Sep 17 00:00:00 2001 From: Florian Wilde Date: Fri, 17 Jul 2026 19:16:53 +0200 Subject: [PATCH] Lokale DB-Kopie: Schema-Dump auf Migration 0003 aktualisieren --- supabase/local/10_schema.sql | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/supabase/local/10_schema.sql b/supabase/local/10_schema.sql index 18127d2..0ec2cac 100644 --- a/supabase/local/10_schema.sql +++ b/supabase/local/10_schema.sql @@ -68,6 +68,21 @@ end; $$; +-- +-- Name: handle_user_email_change(); Type: FUNCTION; Schema: public; Owner: - +-- + +CREATE FUNCTION public.handle_user_email_change() RETURNS trigger + LANGUAGE plpgsql SECURITY DEFINER + SET search_path TO 'public' + AS $$ +begin + update public.profiles set email = new.email where id = new.id; + return new; +end; +$$; + + -- -- Name: touch_updated_at(); Type: FUNCTION; Schema: public; Owner: - -- @@ -376,6 +391,13 @@ ALTER TABLE public.profiles ENABLE ROW LEVEL SECURITY; CREATE POLICY profiles_select_own_or_admin ON public.profiles FOR SELECT TO authenticated USING (((id = ( SELECT auth.uid() AS uid)) OR (public.app_role() = 'admin'::text))); +-- +-- Name: profiles profiles_update_own_name; 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))); + + -- -- Name: sections; Type: ROW SECURITY; Schema: public; Owner: - --