Files
accounted/supabase/migrations/20260420120000_logos_bucket.sql
T
admin e7f0070e84
masterplan-lock / check (push) Successful in 19s
ci / sonar (push) Failing after 21s
security / scan (push) Failing after 1m37s
fix(restore): återställ default branch-filer som raderades av docs-publiceringen (7e33543)
Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i
server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma
strängvärde byggs med konkatenering i stället för att matcha mönstret.
2026-11-10 09:37:22 +01:00

24 lines
928 B
SQL

-- Migration: Public `logos` storage bucket for company logos
--
-- Logos render on invoices, the invoice PDF, and the public invoice-action
-- page, so they need to be fetchable without signed URLs. The existing
-- `documents` bucket is private (WORM archive) and not appropriate for
-- this use case — `getPublicUrl()` on that bucket returns an unusable URL.
--
-- This bucket is world-readable; writes happen via the server route using
-- the service role, so we do not need user-scoped INSERT/UPDATE/DELETE
-- policies for authenticated clients.
INSERT INTO storage.buckets (id, name, public, file_size_limit, allowed_mime_types)
VALUES (
'logos',
'logos',
true,
2097152, -- 2 MB
ARRAY['image/png', 'image/jpeg', 'image/svg+xml', 'image/webp']
)
ON CONFLICT (id) DO UPDATE
SET public = EXCLUDED.public,
file_size_limit = EXCLUDED.file_size_limit,
allowed_mime_types = EXCLUDED.allowed_mime_types;