Files
accounted/supabase/migrations/20260812193500_company_settings_mileage_enabled.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

20 lines
1002 B
SQL

-- Körjournal (mileage log) sidebar visibility toggle.
--
-- Adds the per-company UI toggle that surfaces the Körjournal nav row and the
-- /mileage page entry point. UI-visibility only, NEVER load-bearing for
-- correctness: trips written via API/MCP are validated and bookable regardless
-- of this flag, and the nav row also shows whenever the company already has
-- mileage_trips rows (same hybrid gate as webshop orders), so agent-created
-- trips can never become invisible underlag. Mirrors dimensions_enabled
-- (20260702100000).
--
-- pg-test: skip (plain column addition, no trigger/RPC/RLS)
ALTER TABLE public.company_settings
ADD COLUMN mileage_enabled boolean NOT NULL DEFAULT false;
COMMENT ON COLUMN public.company_settings.mileage_enabled IS
'UI-visibility toggle for the Körjournal (mileage log) nav row. Never load-bearing for correctness: trips created via API/MCP work regardless, and the nav row also shows when mileage_trips rows exist.';
NOTIFY pgrst, 'reload schema';