garyaustin
02/13/2022, 3:47 PMYonben
02/13/2022, 4:05 PMsupabase migration new <name>
and wrote my migration, but when I try to supabase db push
it I get the following:
▶ 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 🤷🏻♂️
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:
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;
Yonben
02/13/2022, 4:35 PMPaul AKA TDI
02/13/2022, 6:45 PM> svelte-app@1.0.0 dev /Users/bob/Documents/dev/javascript/svelte/supabase-svelte
> rollup -c -w
sh: rollup: command not found
my rollup.config.js looks like thisatmanaut.eth
02/13/2022, 7:08 PMatmanaut.eth
02/13/2022, 7:09 PMatmanaut.eth
02/13/2022, 7:18 PMatmanaut.eth
02/13/2022, 7:18 PMatmanaut.eth
02/13/2022, 7:19 PMsilentworks
02/13/2022, 8:45 PMAmusedGrape
02/13/2022, 11:07 PMgaryaustin
02/13/2022, 11:29 PMAmusedGrape
02/13/2022, 11:29 PMjs
const { data, error } = await supabaseServer.from("moderation_actions").select('*').like('id::text', `%${id}%`).single();
i get an error:
operator does not exist: uuid ~~ unknown
i tried the same thing in the sql editor:
SELECT * FROM moderation_actions WHERE id::text LIKE '%b5dcc38d%'
that worked finegaryaustin
02/13/2022, 11:51 PM%${filter.val.toLowerCase()}%
)
THERE ARE ` around the %... not sure how to format hereAmusedGrape
02/14/2022, 12:00 AMAmusedGrape
02/14/2022, 12:01 AMmagicbyt3
02/14/2022, 8:31 AMsql
UPDATE profiles SET counter = CASE
WHEN memberships.level = 0 THEN counter + 1
WHEN memberships.level = 1 THEN counter + 3
WHEN memberships.level = 2 THEN counter + 6
WHEN memberships.level = 3 THEN counter + 9
END
however I get an error missing FROM-clause entry for table "memberships"
How would that work?
Thanks in advance.
/edit: solvedze
02/14/2022, 10:41 AMze
02/14/2022, 10:42 AMjavascript
export async function uploadLogo(logo) {
const id = uuid();
const { data, error } = await supabaseClient.storage.from('tmp').upload(`logos/${id}.png`, logo, {
// TODO should cache for logos be increased?
cacheControl: '3600',
upsert: false
});
if (error) {
throw error;
}
console.log('upload', data, error);
return id;
}
ze
02/14/2022, 10:44 AMFile
uploaded and converting it to arrayBuffer
(on the endpoint), since File
isn't supported by node-fetch, apparently.ze
02/14/2022, 10:45 AMsql
((bucket_id = 'tmp'::text) AND (lower((storage.foldername(name))[1]) = 'public'::text) AND (role() = 'anon'::text))
ze
02/14/2022, 10:45 AMze
02/14/2022, 10:47 AMze
02/14/2022, 10:48 AMze
02/14/2022, 10:49 AMvalentin ッ
02/14/2022, 3:12 PMvalentin ッ
02/14/2022, 3:12 PMvalentin ッ
02/14/2022, 3:13 PMstnmonroe
02/14/2022, 3:32 PMuser_id
of the user making the request to a row, ie created_by
, without having to add that id from the client every time? Thanks in advance!garyaustin
02/14/2022, 3:52 PM