-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Trigger de DELETE tda_sga_responsables_academicas
-- TRIGGER AFTER DELETE
-- Tabla: sga_responsables_academicas
-- Version 3.0.0
-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

-- DROP FUNCTION ftda_sga_responsables_academicas();
CREATE OR REPLACE FUNCTION ftda_sga_responsables_academicas() RETURNS TRIGGER AS $BODY$
  BEGIN
       -- Borro el registro en la tabla de entidades..
       DELETE FROM sga_g3entidades WHERE entidad = OLD.entidad;
       RETURN OLD;
  END;
$BODY$ LANGUAGE plpgsql;


-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- Trigger de DELETE sobre sga_responsables_academicas
-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-- DROP TRIGGER tda_sga_responsables_academicas ON sga_responsables_academicas RESTRICT;
CREATE TRIGGER tda_sga_responsables_academicas 
    AFTER DELETE ON sga_responsables_academicas
    FOR EACH ROW EXECUTE PROCEDURE ftda_sga_responsables_academicas();
