Files
accounted/supabase/migrations/20260709140000_add_customer_number_to_customers.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

17 lines
695 B
SQL

-- Customer number (kundnummer) on customers, shown on the invoice (issue #914).
--
-- Nullable free text set by the user. Deliberately NO unique constraint in v1:
-- existing rows, register imports, and provider syncs must not start failing
-- on duplicates. Auto-numbering and uniqueness can be layered on later.
--
-- No RLS changes needed: customers already has company-scoped policies and a
-- plain column add inherits them.
ALTER TABLE public.customers
ADD COLUMN IF NOT EXISTS customer_number text;
COMMENT ON COLUMN public.customers.customer_number IS
'User-assigned customer number (kundnummer) printed on invoices. Free text, not unique in v1.';
NOTIFY pgrst, 'reload schema';