Prerender solution for lovable
Step 1

DNsUpdat
-- Create bucket for lesson images
INSERT INTO storage.buckets (id, name, public, file_size_limit, allowed_mime_types)
VALUES ('lesson-images', 'lesson-images', true, 5242880, ARRAY['image/jpeg', 'image/png', 'image/gif', 'image/webp']);
-- Allow authenticated users to upload
CREATE POLICY "Authenticated users can upload lesson images"
ON storage.objects FOR INSERT TO authenticated
WITH CHECK (bucket_id = 'lesson-images');
-- Allow authenticated users to delete
CREATE POLICY "Authenticated users can delete lesson images"
ON storage.objects FOR DELETE TO authenticated
USING (bucket_id = 'lesson-images');
-- Public read access
CREATE POLICY "Public can view lesson images"
ON storage.objects FOR SELECT TO anon, authenticated
USING (bucket_id = 'lesson-images');
Chacehing Htom to Supbase

-- Create bucket for lesson images INSERT INTO storage.buckets (id, name, public, file_size_limit, allowed_mime_types) VALUES ('lesson-images', 'lesson-images', true, 5242880, ARRAY['image/jpeg', 'image/png', 'image/gif', 'image/webp']);
-- Allow authenticated users to upload CREATE POLICY "Authenticated users can upload lesson images" ON storage.objects FOR INSERT TO authenticated WITH CHECK (bucket_id = 'lesson-images');
-- Allow authenticated users to delete CREATE POLICY "Authenticated users can delete lesson images" ON storage.objects FOR DELETE TO authenticated USING (bucket_id = 'lesson-images');
-- Public read access CREATE POLICY "Public can view lesson images" ON storage.objects FOR SELECT TO anon, authenticated USING (bucket_id = 'lesson-images');
INSERT INTO storage.buckets (id, name, public, file_size_limit, allowed_mime_types)
VALUES ('lesson-images', 'lesson-images', true, 5242880, ARRAY['image/jpeg', 'image/png', 'image/gif', 'image/webp']);