FIX invalid link on user.fk_user

This commit is contained in:
Laurent Destailleur 2019-06-18 15:57:22 +02:00
parent 1d2c9c9df4
commit 6afda6a47a

View File

@ -199,6 +199,15 @@ delete from llx_element_element where sourcetype='commande' and fk_source not in
DELETE FROM llx_actioncomm_resources WHERE fk_actioncomm not in (select id from llx_actioncomm);
-- Fix link on parent that were removed
DROP table tmp_user;
CREATE TABLE tmp_user as (select * from llx_user);
UPDATE llx_user SET fk_user = NULL where fk_user NOT IN (select rowid from tmp_user);
update llx_user set fk_user = null where fk_user not in (select rowid from llx_user);
UPDATE llx_product SET canvas = NULL where canvas = 'default@product';
UPDATE llx_product SET canvas = NULL where canvas = 'service@product';