10 lines
500 B
SQL
10 lines
500 B
SQL
-- Create bucket for invoices
|
|
INSERT INTO storage.buckets (id, name, public)
|
|
VALUES ('invoices', 'invoices', true)
|
|
ON CONFLICT (id) DO NOTHING;
|
|
|
|
-- Policies for invoices bucket
|
|
-- Allow public access to invoices (simplified for this demo, usually should be restricted)
|
|
CREATE POLICY "Public Access" ON storage.objects FOR SELECT USING (bucket_id = 'invoices');
|
|
CREATE POLICY "Authenticated Upload" ON storage.objects FOR INSERT WITH CHECK (bucket_id = 'invoices' AND auth.role() = 'authenticated');
|