-- Create storage bucket for order photos
-- Run in Supabase SQL Editor
INSERT INTO storage.buckets (id, name, public)
VALUES ('order-photos', 'order-photos', true)
ON CONFLICT (id) DO NOTHING;

-- Allow authenticated users to upload
CREATE POLICY "Authenticated users can upload order photos"
ON storage.objects FOR INSERT
TO authenticated
WITH CHECK (bucket_id = 'order-photos');

-- Allow authenticated users to delete own uploads
CREATE POLICY "Authenticated users can delete order photos"
ON storage.objects FOR DELETE
TO authenticated
USING (bucket_id = 'order-photos');

-- Public read
CREATE POLICY "Public read order photos"
ON storage.objects FOR SELECT
USING (bucket_id = 'order-photos');
