-- ** TITULO      : Crear función de trigger func_refresh_view_m_schedule_spaces.
-- ** OBJETIVO    : Crear función que permite refrescar la vista materializada de los espacios de agenda.


-- View: public.func_refresh_view_m_schedule_spaces
DROP FUNCTION IF EXISTS func_refresh_view_m_schedule_spaces();

CREATE function func_refresh_view_m_schedule_spaces() returns trigger
    LANGUAGE plpgsql AS
$$
BEGIN
	
		
	REFRESH MATERIALIZED VIEW CONCURRENTLY schedule_spaces_view_m;
	
	RETURN NULL;
	
END
$$;

