xephyr
04/29/2022, 3:38 AMERROR: must be member of role "supabase_admin"
when trying to supabase db push
to my production instance after having worked off a dev
instance for the past day or so. Have been through the usual Google searches but all threads I've read are talking about the Supabase Studio SQL editor, not running commands locally. What do I have to do locally to be a member of the supabase_admin
role?Needle
04/29/2022, 3:38 AM/title
command!
We have solved your problem?
Click the button below to archive it.xephyr
04/29/2022, 3:39 AMxephyr
04/29/2022, 3:40 AMsql
-- This script was generated by the Schema Diff utility in pgAdmin 4
-- For the circular dependencies, the order in which Schema Diff writes the objects is not very sophisticated
-- and may require manual changes to the script to ensure changes are applied in the correct order.
-- Please report an issue for any failure with the reproduction steps.
CREATE TABLE IF NOT EXISTS public.user_avatars
(
id uuid NOT NULL DEFAULT uuid_generate_v4(),
created_at timestamp with time zone DEFAULT now(),
user_id uuid NOT NULL,
path text COLLATE pg_catalog."default",
CONSTRAINT user_avatars_pkey PRIMARY KEY (id),
CONSTRAINT user_avatars_user_id_fkey FOREIGN KEY (user_id)
REFERENCES auth.users (id) MATCH SIMPLE
ON UPDATE NO ACTION
ON DELETE NO ACTION
)
TABLESPACE pg_default;
ALTER TABLE IF EXISTS public.user_avatars
OWNER to supabase_admin;
ALTER TABLE IF EXISTS public.user_avatars
ENABLE ROW LEVEL SECURITY;
GRANT ALL ON TABLE public.user_avatars TO anon;
GRANT ALL ON TABLE public.user_avatars TO postgres;
GRANT ALL ON TABLE public.user_avatars TO supabase_admin;
GRANT ALL ON TABLE public.user_avatars TO authenticated;
GRANT ALL ON TABLE public.user_avatars TO service_role;
CREATE POLICY "Enable DELETE for current user"
ON public.user_avatars
AS PERMISSIVE
FOR DELETE
TO public
USING ((auth.uid() = user_id));
CREATE POLICY "Enable INSERT for current user"
ON public.user_avatars
AS PERMISSIVE
FOR INSERT
TO public
WITH CHECK ((auth.uid() = user_id));
CREATE POLICY "Enable SELECT for all users"
ON public.user_avatars
AS PERMISSIVE
FOR SELECT
TO public
USING (true);
CREATE POLICY "Enable UPDATE for current user"
ON public.user_avatars
AS PERMISSIVE
FOR UPDATE
TO public
USING ((auth.uid() = user_id))
WITH CHECK ((auth.uid() = user_id));
REVOKE ALL ON TABLE public.competitions FROM authenticated;
REVOKE ALL ON TABLE public.competitions FROM postgres;
REVOKE ALL ON TABLE public.competitions FROM service_role;
GRANT ALL ON TABLE public.competitions TO authenticated;
GRANT ALL ON TABLE public.competitions TO postgres;
GRANT ALL ON TABLE public.competitions TO service_role;
REVOKE ALL ON TABLE public.user_settings FROM authenticated;
REVOKE ALL ON TABLE public.user_settings FROM postgres;
REVOKE ALL ON TABLE public.user_settings FROM service_role;
GRANT ALL ON TABLE public.user_settings TO authenticated;
GRANT ALL ON TABLE public.user_settings TO postgres;
GRANT ALL ON TABLE public.user_settings TO service_role;
garyaustin
04/29/2022, 4:06 AMNeedle
04/29/2022, 4:06 AMxephyr
04/29/2022, 4:08 AMsupabase db push
runs as postgres
? I had assumed it would run as the user that I've logged in with via supabase login
as I'm running it locally for now :/xephyr
04/29/2022, 4:10 AMxephyr
04/29/2022, 4:12 AMsupabase
cli stuff is still very WIP, lots of pain points at the moment 😬xephyr
04/29/2022, 4:12 AMgaryaustin
04/29/2022, 4:15 AM