This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace function mutation_comments_trigger() returns trigger as $$ | |
declare | |
c record; | |
parent_type text; | |
begin | |
if (tg_op = 'DELETE') then | |
if old.parent_type = 'task' then | |
delete from data.task_comment where id = old.id; | |
if not found then return null; end if; | |
elsif old.parent_type = 'project' then |