Files
accounted/supabase/migrations/20260721162121_expand_invoice_font_support.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

38 lines
1.1 KiB
SQL

-- Add bundled and company-uploaded invoice fonts. Custom font files live in a
-- dedicated private bucket. The server embeds each font into the generated PDF,
-- so customer font files never need public URLs.
ALTER TABLE public.company_settings
ADD COLUMN IF NOT EXISTS invoice_custom_font_path TEXT NULL,
ADD COLUMN IF NOT EXISTS invoice_custom_font_name TEXT NULL;
ALTER TABLE public.company_settings
DROP CONSTRAINT IF EXISTS company_settings_invoice_font_check;
ALTER TABLE public.company_settings
ADD CONSTRAINT company_settings_invoice_font_check
CHECK (
invoice_font_family IN (
'Helvetica',
'Times-Roman',
'Courier',
'Source Sans 3',
'Source Serif 4',
'Custom'
)
);
INSERT INTO storage.buckets (id, name, public, file_size_limit, allowed_mime_types)
VALUES (
'invoice-fonts',
'invoice-fonts',
false,
5242880,
ARRAY['font/ttf', 'font/woff']
)
ON CONFLICT (id) DO UPDATE
SET public = EXCLUDED.public,
file_size_limit = EXCLUDED.file_size_limit,
allowed_mime_types = EXCLUDED.allowed_mime_types;
NOTIFY pgrst, 'reload schema';