
START TRANSACTION;

INSERT INTO NODE (NODE_ORDER,ASCENDING,VISIBLE,CONTENT_ID,KEY_ROOT_DOMAIN_OBJECT,KEY_PARENT,KEY_CHILD,OJB_CONCRETE_CLASS) VALUES (2,1,1,'1b6d4c06-fdfb-4426-a4a1-c3a217e89977:be857be2-5be8-499d-9742-0df655adf9fc',1,1,2,'net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode')  ;

INSERT INTO EXECUTION_PATH (EXECUTION_PATH,CONTENT_ID,KEY_FUNCTIONALITY,KEY_ROOT_DOMAIN_OBJECT) VALUES ('/searchProfessorships.do?method=prepareForm','b349578e-3e9b-44a1-98e5-0650d1c6e601',3,1)  ;

INSERT INTO CONTENT (EXECUTION_PATH,VISIBLE,KEY_EXECUTION_PATH_VALUE,CONTENT_ID,CREATION_DATE,NAME,TITLE,BODY,DESCRIPTION,NORMALIZED_NAME,KEY_ROOT_DOMAIN_OBJECT,KEY_AVAILABILITY_POLICY,KEY_PORTAL,KEY_CREATOR,OJB_CONCRETE_CLASS) VALUES ('/searchProfessorships.do?method=prepareForm',null,4,'be857be2-5be8-499d-9742-0df655adf9fc','2008-03-19 17:07:15','pt40:Consulta de Corpo Docente por Disciplina',null,null,null,'pt40:consulta-de-corpo-docente-por-disciplina',1,null,null,null,'net.sourceforge.fenixedu.domain.functionalities.Functionality')  ;

UPDATE NODE SET NODE_ORDER=2,ASCENDING=1,VISIBLE=1,CONTENT_ID='1b6d4c06-fdfb-4426-a4a1-c3a217e89977:be857be2-5be8-499d-9742-0df655adf9fc',KEY_ROOT_DOMAIN_OBJECT=1,KEY_PARENT=5,KEY_CHILD=6,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '1b6d4c06-fdfb-4426-a4a1-c3a217e89977:be857be2-5be8-499d-9742-0df655adf9fc'  ;

UPDATE EXECUTION_PATH SET EXECUTION_PATH='/searchProfessorships.do?method=prepareForm',CONTENT_ID='b349578e-3e9b-44a1-98e5-0650d1c6e601',KEY_FUNCTIONALITY=7,KEY_ROOT_DOMAIN_OBJECT=1 WHERE CONTENT_ID = 'b349578e-3e9b-44a1-98e5-0650d1c6e601'  ;

UPDATE CONTENT SET EXECUTION_PATH='/searchProfessorships.do?method=prepareForm',VISIBLE=null,KEY_EXECUTION_PATH_VALUE=8,CONTENT_ID='be857be2-5be8-499d-9742-0df655adf9fc',CREATION_DATE='2008-03-19 17:07:15',NAME='pt40:Consulta de Corpo Docente por Disciplina',TITLE=null,BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt40:consulta-de-corpo-docente-por-disciplina',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 = 'be857be2-5be8-499d-9742-0df655adf9fc'  ;

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,'1b6d4c06-fdfb-4426-a4a1-c3a217e89977','1b6d4c06-fdfb-4426-a4a1-c3a217e89977:be857be2-5be8-499d-9742-0df655adf9fc') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(2,'be857be2-5be8-499d-9742-0df655adf9fc','1b6d4c06-fdfb-4426-a4a1-c3a217e89977:be857be2-5be8-499d-9742-0df655adf9fc') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(3,'be857be2-5be8-499d-9742-0df655adf9fc','b349578e-3e9b-44a1-98e5-0650d1c6e601') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(4,'b349578e-3e9b-44a1-98e5-0650d1c6e601','be857be2-5be8-499d-9742-0df655adf9fc') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(5,'1b6d4c06-fdfb-4426-a4a1-c3a217e89977','1b6d4c06-fdfb-4426-a4a1-c3a217e89977:be857be2-5be8-499d-9742-0df655adf9fc') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(6,'be857be2-5be8-499d-9742-0df655adf9fc','1b6d4c06-fdfb-4426-a4a1-c3a217e89977:be857be2-5be8-499d-9742-0df655adf9fc') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(7,'be857be2-5be8-499d-9742-0df655adf9fc','b349578e-3e9b-44a1-98e5-0650d1c6e601') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(8,'b349578e-3e9b-44a1-98e5-0650d1c6e601','be857be2-5be8-499d-9742-0df655adf9fc') ;
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;
