<@!107176742342402048> how to handle migrations be...
# help
y
@User how to handle migrations between ui/sql. I create my tables on the UI, worked on my project etc... Then I needed to make a change so I
supabase migration new <name>
and wrote my migration, but when I try to
supabase db push
it I get the following:
Copy code
ā–¶ supabase db push
\Applying unapplied migrations...
Error: ERROR: must be owner of table summoners (SQLSTATE 42501)
Now if I look at the initial "remote_commit" migration, it states the owner is
supabase_admin
but it also granted
ALL
on the table, so I'm confused šŸ¤·šŸ»ā€ā™‚ļø
Copy code
ALTER TABLE IF EXISTS public.summoners
    OWNER to supabase_admin;

ALTER TABLE IF EXISTS public.summoners
    ENABLE ROW LEVEL SECURITY;

GRANT ALL ON TABLE public.summoners TO anon;

GRANT ALL ON TABLE public.summoners TO authenticated;

GRANT ALL ON TABLE public.summoners TO postgres;

GRANT ALL ON TABLE public.summoners TO service_role;

GRANT ALL ON TABLE public.summoners TO supabase_admin;
If I run the query on the UI, and then do a
remote commit
I get a really weirdly generated migration so I'd like to avoid the unnecessary overhead from these:
Copy code
REVOKE ALL ON TABLE public.summoners FROM anon;
REVOKE ALL ON TABLE public.summoners FROM authenticated;
REVOKE ALL ON TABLE public.summoners FROM postgres;
REVOKE ALL ON TABLE public.summoners FROM service_role;
REVOKE ALL ON TABLE public.summoners FROM supabase_admin;
GRANT ALL ON TABLE public.summoners TO anon;

GRANT ALL ON TABLE public.summoners TO authenticated;

GRANT ALL ON TABLE public.summoners TO postgres;

GRANT ALL ON TABLE public.summoners TO service_role;

GRANT ALL ON TABLE public.summoners TO supabase_admin;
I managed to fix it, I ran the following on the Query Editor in the UI:
Copy code
ALTER TABLE IF EXISTS public.summoners
    OWNER to postgres;
But this lack of sync between local dev and the ui (which is pretty powerful and useful) is annoying. The issue should be considered imo šŸ™‚ Thanks!