-- Profile rows are created only by the auth trigger or the server-side claim action.
drop policy if exists "profiles_insert_own" on public.profiles;
revoke insert on table public.profiles from anon, authenticated;

-- Profile and hosted-image URLs are intentionally public; repair existing bucket config.
update storage.buckets
set public = true
where id in ('media', 'image-host') and public is distinct from true;

update storage.buckets
set file_size_limit = 10485760,
	allowed_mime_types = array['image/png', 'image/jpeg', 'image/gif', 'image/webp', 'image/avif']
where id = 'image-host';