feat: add shared notification, communication, and export services for bookings, courses, and events; introduce btree_gist extension and new booking atomic function
This commit is contained in:
@@ -21,12 +21,12 @@ CREATE INDEX IF NOT EXISTS ix_event_registrations_member
|
||||
-- Backfill: match existing registrations to members by email within the same account
|
||||
UPDATE public.event_registrations er
|
||||
SET member_id = m.id
|
||||
FROM public.events e
|
||||
JOIN public.members m ON m.account_id = e.account_id
|
||||
FROM public.events e, public.members m
|
||||
WHERE e.id = er.event_id
|
||||
AND m.account_id = e.account_id
|
||||
AND lower(m.email) = lower(er.email)
|
||||
AND m.email IS NOT NULL AND m.email != ''
|
||||
AND m.status IN ('active', 'inactive', 'pending')
|
||||
WHERE e.id = er.event_id
|
||||
AND er.member_id IS NULL
|
||||
AND er.email IS NOT NULL AND er.email != '';
|
||||
|
||||
@@ -35,7 +35,7 @@ CREATE OR REPLACE FUNCTION public.transfer_member(
|
||||
p_member_id uuid,
|
||||
p_target_account_id uuid,
|
||||
p_reason text DEFAULT NULL,
|
||||
p_keep_sepa boolean DEFAULT false
|
||||
p_keep_sepa boolean DEFAULT true
|
||||
)
|
||||
RETURNS uuid
|
||||
LANGUAGE plpgsql
|
||||
|
||||
Reference in New Issue
Block a user