Files
accounted/supabase/migrations/20240101000035_fix_push_notifications.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

29 lines
1.1 KiB
SQL

-- Migration 035: Fix push notifications
-- 1. Expand notification_log notification_type CHECK constraint to include new event types
-- 2. Add per-event enabled columns to notification_settings
-- Drop and recreate the CHECK constraint with new types
alter table public.notification_log
drop constraint if exists notification_log_notification_type_check;
alter table public.notification_log
add constraint notification_log_notification_type_check
check (notification_type in (
'tax_deadline',
'invoice_due',
'invoice_overdue',
'period_locked',
'period_year_closed',
'invoice_sent',
'receipt_extracted',
'receipt_matched'
));
-- Add new per-event enabled columns to notification_settings
alter table public.notification_settings
add column if not exists period_locked_enabled boolean default true,
add column if not exists period_year_closed_enabled boolean default true,
add column if not exists invoice_sent_enabled boolean default false,
add column if not exists receipt_extracted_enabled boolean default true,
add column if not exists receipt_matched_enabled boolean default true;