andrewblake1 / WorksManagement

Project/Works management system for Northpower's Westcoast Energy
0 stars 3 forks source link

Deleted subassembly being undeleted - unsure what is triggering this #469

Closed hawea closed 10 years ago

hawea commented 10 years ago

Go to this id: dev.melbourne.wcewm.co.nz/SubAssembly/admin?parent_assembly_id=1544

There is a subassembly id 2022 which I have deleted numerous times, however the deleted value keeps changing back from 1 to 0. I haven't yet determined what is triggering the deleted value to change. It takes about 5-10 minutes and is then happening.

andrewblake1 commented 10 years ago

cant imagine time being something to do with as no scheduled tasks. Therefore looking for either, trigger, or stored procedure or something in code that does this. In other words, something you are doing is probably causing this - not that you are doing anything wrong, just that time is probably not significant.

Try to duplicate the problem so I know where to start looking or look at triggers of joined tables etc

andrewblake1 commented 10 years ago

I think in tbl_assembly_AUPD should be changed to:

BEGIN IF NEW.deleted THEN .... END IF; END

Please check and apply in database .. drop trigger, create trigger if you think I am correct.

Also could you please run through all the other tables in workbench and check triggers for similar statements where I have assumed that altering a parent deleted should by copied by child when in reality it is only the action of deleting that should by propegated to children. -- Take not of any that are wrong as I need to change them in the master version of workbench.

hawea commented 10 years ago

Trigger updated