I am trying to automatic deletion data system in supabase, but it doesn't work.
The default value of 'deleted_at' in 'comments' table is null, if a value not null is inputted, the trigger works a function.
The function deletes data 10 seconds after input, and the code is as follows.
BEGIN
IF NEW.deleted_at IS NOT NULL THEN
NEW.delete_time := NOW() + INTERVAL '10 seconds';
PERFORM pg_notify('delete_comment_row_schedule', NEW.comment_id::text);
END IF;
RETURN NEW;
END;
Trigger events is set to after update.
Please help me!!