Add profile photo uploads and custom difficulty support

This commit is contained in:
2026-10-13 20:50:54 +05:00
parent 8c3de302e7
commit de812453ec
37 changed files with 1139 additions and 74 deletions

View File

@@ -0,0 +1,34 @@
alter table public.profiles
add column avatar_path text;
insert into storage.buckets(id, name, public, file_size_limit, allowed_mime_types)
values (
'minegeo-avatars',
'minegeo-avatars',
true,
5242880,
array['image/jpeg', 'image/png', 'image/webp']
)
on conflict (id) do update set
name = excluded.name,
public = excluded.public,
file_size_limit = excluded.file_size_limit,
allowed_mime_types = excluded.allowed_mime_types;
create policy "MineGeo users upload their own avatars"
on storage.objects
for insert
to authenticated
with check (
bucket_id = 'minegeo-avatars'
and (storage.foldername(name))[1] = (select auth.uid()::text)
);
create policy "MineGeo users delete their own avatars"
on storage.objects
for delete
to authenticated
using (
bucket_id = 'minegeo-avatars'
and (storage.foldername(name))[1] = (select auth.uid()::text)
);