TYPE=TRIGGERS
triggers='CREATE TRIGGER `Before_dir_insert` BEFORE INSERT ON `customerdir` FOR EACH ROW begin
\n    set NEW.PATH =  concat(  (Select PATH from customer_path where dir = NEW.PARENT limit 1)  , \'/\' , NEW.name );
\nend' 'CREATE TRIGGER `Before_dir_update` BEFORE UPDATE ON `customerdir` FOR EACH ROW begin
\n    set NEW.PATH =  concat(  (Select PATH from customer_path where dir = NEW.PARENT limit 1)  , \'/\' , NEW.name );
\nend' 'CREATE TRIGGER `After_dir_update` AFTER UPDATE ON `customerdir` FOR EACH ROW begin
\n  update customer set dir = dir where dir = NEW.dir 
\n  or dir in (select a.dir from customerdir a where a.parent = NEW.dir
\n                or a.dir in (select b.dir from customerdir b where b.parent = NEW.dir
\n                               or b.dir in (select d.dir from customerdir d where d.parent = NEW.dir
\n                                     or d.dir in (select e.dir from customerdir e where e.parent = NEW.dir)
\n                                            )
\n                                ) 
\n                 );
\n  
\nend' 'CREATE TRIGGER `After_dir_delete` AFTER DELETE ON `customerdir` FOR EACH ROW begin
\n  delete from customer  where dir = OLD.dir ;end'
sql_modes=0 0 0 0
definers='root@' 'root@' 'root@' 'root@'
