Fix board members 0-count, bulk email 0-recipients, 502 on cold start, and duplicate statuses
All checks were successful
Build and Push Docker Images / build-portal (push) Successful in 1m54s
Build and Push Docker Images / build-infra (docker/db, monacousa-db) (push) Successful in 59s
Build and Push Docker Images / build-infra (docker/kong, monacousa-kong) (push) Successful in 23s
Build and Push Docker Images / build-infra (docker/migrate, monacousa-migrate) (push) Successful in 59s

- Board members: switch to supabaseAdmin to bypass dues_payments RLS on members_with_dues view
- Bulk email: query members_with_dues view with status_name instead of nonexistent status column on members table
- 502 error: skip setupCheckHandle DB query for login/signup/public/static routes, increase cache TTL to 5min
- Duplicate statuses: add migration 026 to deduplicate Active/active entries, add defensive dedup in admin members loader

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-10 20:17:37 +01:00
parent 0e04d016da
commit 549ace87c6
5 changed files with 61 additions and 15 deletions

View File

@@ -0,0 +1,24 @@
-- Fix duplicate membership statuses
-- The database has both "Active" (capitalized name) and "active" (lowercase) entries.
-- The seed data only creates "active" - the "Active" entry was added manually.
-- We need to:
-- 1. Move any members pointing to the duplicate "Active" status to the original "active" status
-- 2. Delete the duplicate "Active" entry
-- First, update any members that reference the duplicate "Active" (capitalized) status
-- to point to the original "active" (lowercase) status
UPDATE public.members
SET membership_status_id = (
SELECT id FROM public.membership_statuses WHERE name = 'active' LIMIT 1
)
WHERE membership_status_id IN (
SELECT id FROM public.membership_statuses WHERE name = 'Active'
);
-- Delete the duplicate "Active" (capitalized) status entry
DELETE FROM public.membership_statuses WHERE name = 'Active';
-- Ensure the remaining "active" status has correct sort_order
UPDATE public.membership_statuses
SET sort_order = 2, display_name = 'Active', color = '#22c55e'
WHERE name = 'active';