
START TRANSACTION;

INSERT INTO EXECUTION_PATH (EXECUTION_PATH,CONTENT_ID,KEY_FUNCTIONALITY,KEY_ROOT_DOMAIN_OBJECT) VALUES ('/exportAssiduousness.do?method=prepareExportADISTEmployees&action=exportADISTEmployees','c8912351-53c5-47ea-ab41-abbbb31e3678',1,1)  ;

UPDATE EXECUTION_PATH SET EXECUTION_PATH='/exportAssiduousness.do?method=prepareExportADISTEmployees&action=exportADISTEmployees',CONTENT_ID='c8912351-53c5-47ea-ab41-abbbb31e3678',KEY_FUNCTIONALITY=2,KEY_ROOT_DOMAIN_OBJECT=1 WHERE CONTENT_ID = 'c8912351-53c5-47ea-ab41-abbbb31e3678'  ;

UPDATE CONTENT SET EXECUTION_PATH='/exportAssiduousness.do?method=prepareExportADISTEmployees&action=exportADISTEmployees',VISIBLE=null,KEY_EXECUTION_PATH_VALUE=3,CONTENT_ID='5423673f-c9c0-4124-996b-cb3c07d36c83',CREATION_DATE='2008-02-13 11:05:07',NAME='pt14:Exportar ADIST',TITLE=null,BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt14:exportar-adist',KEY_ROOT_DOMAIN_OBJECT=1,KEY_AVAILABILITY_POLICY=null,KEY_PORTAL=null,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.functionalities.Functionality' WHERE CONTENT_ID = '5423673f-c9c0-4124-996b-cb3c07d36c83'  ;

DELETE FROM EXECUTION_PATH WHERE CONTENT_ID = 'bca75161-0bc0-48f7-b385-bb5ec51d8035' ;

CREATE TEMPORARY TABLE UUID_TEMP_TABLE(COUNTER integer, UUID varchar(255), FROM_UUID varchar(255));

INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(1,'5423673f-c9c0-4124-996b-cb3c07d36c83','c8912351-53c5-47ea-ab41-abbbb31e3678') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(2,'5423673f-c9c0-4124-996b-cb3c07d36c83','c8912351-53c5-47ea-ab41-abbbb31e3678') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(3,'c8912351-53c5-47ea-ab41-abbbb31e3678','5423673f-c9c0-4124-996b-cb3c07d36c83') ;
ALTER TABLE UUID_TEMP_TABLE ADD INDEX (COUNTER), ADD INDEX (UUID), ADD INDEX (FROM_UUID); 


UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PARENT=CT.ID_INTERNAL WHERE T.KEY_PARENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE NODE T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CHILD=CT.ID_INTERNAL WHERE T.KEY_CHILD=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_INITIAL_CONTENT=CT.ID_INTERNAL WHERE T.KEY_INITIAL_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, EXECUTION_PATH CT set T.KEY_EXECUTION_PATH_VALUE=CT.ID_INTERNAL WHERE T.KEY_EXECUTION_PATH_VALUE=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_PORTAL=CT.ID_INTERNAL WHERE T.KEY_PORTAL=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE CONTENT T, UUID_TEMP_TABLE UIT, AVAILABILITY_POLICY CT set T.KEY_AVAILABILITY_POLICY=CT.ID_INTERNAL WHERE T.KEY_AVAILABILITY_POLICY=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE AVAILABILITY_POLICY T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_CONTENT=CT.ID_INTERNAL WHERE T.KEY_CONTENT=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
UPDATE EXECUTION_PATH T, UUID_TEMP_TABLE UIT, CONTENT CT set T.KEY_FUNCTIONALITY=CT.ID_INTERNAL WHERE T.KEY_FUNCTIONALITY=UIT.COUNTER AND T.CONTENT_ID = UIT.FROM_UUID AND CT.CONTENT_ID=UIT.UUID;
DROP TABLE UUID_TEMP_TABLE;



COMMIT;
