From 5258ed3f2a38c8f8879853f487d18b204d5d0b71 Mon Sep 17 00:00:00 2001 From: Alexis <35.alexis.pele@gmail.com> Date: Sun, 24 Nov 2024 15:30:50 +0100 Subject: [PATCH] Added server limit to event title and description --- supabase/migrations/202401_init.sql | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/supabase/migrations/202401_init.sql b/supabase/migrations/202401_init.sql index 5d34e3a..efb4546 100644 --- a/supabase/migrations/202401_init.sql +++ b/supabase/migrations/202401_init.sql @@ -88,6 +88,14 @@ create table public.calendar_events ( ); comment on table public.calendar_events is 'Events linked to a world'; +-- Calendar Events restrictions +alter table public.calendar_events + add constraint calendar_events_maxlen_check + check ( + char_length(title) <= 240 AND + (description IS NULL OR char_length(description) <= 1200) + ); + -- Link table for events - categories create table public.calendar_event_categories_links ( calendar_event_id bigint references public.calendar_events on delete cascade,