Files
accounted/supabase/migrations/20260305161912_fix_vat_account_names.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

16 lines
789 B
SQL

-- Migration 52: Fix incorrect VAT account names for existing users
--
-- Migration 009 seeded accounts 2610/2611/2612 with wrong names:
-- 2610 → "Utgaende moms 25%" (should not exist; 2611 is the correct account)
-- 2611 → "Utgaende moms 12%" (WRONG — 2611 is 25%, 2621 is 12%)
-- 2612 → "Utgaende moms 6%" (WRONG — 2612 doesn't exist in BAS, 2631 is 6%)
--
-- Migration 021 fixed the seed function for new users but didn't fix existing data.
-- This migration corrects the account_name for any existing rows.
-- Fix 2611: was incorrectly labeled as 12%, should be 25%
UPDATE public.chart_of_accounts
SET account_name = 'Utgaende moms forsaljning 25%', updated_at = now()
WHERE account_number = '2611'
AND account_name IN ('Utgaende moms 12%', 'Utgående moms 12%');