mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 09:50:01 +00:00
183fe0a93c
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
15 lines
611 B
PL/PgSQL
15 lines
611 B
PL/PgSQL
CREATE OR REPLACE FUNCTION public.get_cross_association_blocked_dates(_association_ids uuid[])
|
|
RETURNS TABLE(id uuid, start_date timestamptz, end_date timestamptz, all_day boolean)
|
|
LANGUAGE sql
|
|
STABLE
|
|
SECURITY DEFINER
|
|
SET search_path = public
|
|
AS $$
|
|
SELECT ce.id, ce.start_date, ce.end_date, ce.all_day
|
|
FROM public.calendar_events ce
|
|
WHERE ce.association_id IS NOT NULL
|
|
AND NOT (ce.association_id = ANY(COALESCE(_association_ids, ARRAY[]::uuid[])))
|
|
AND ce.start_date >= (now() - interval '60 days')
|
|
$$;
|
|
|
|
GRANT EXECUTE ON FUNCTION public.get_cross_association_blocked_dates(uuid[]) TO authenticated; |