
START TRANSACTION;

INSERT INTO CONTENT (ENABLED,MODIFICATION_DATE,MAXIMIZABLE,PREFIX,KEY_INITIAL_CONTENT,CONTENT_ID,CREATION_DATE,NAME,TITLE,BODY,DESCRIPTION,NORMALIZED_NAME,KEY_PORTAL,KEY_AVAILABILITY_POLICY,KEY_ROOT_DOMAIN_OBJECT,KEY_CREATOR,OJB_CONCRETE_CLASS) VALUES (null,null,null,null,null,'1071ab2d-da9d-4b94-9e62-d7d3375291d8','2008-08-11 14:50:40','pt3:TEx',null,null,null,'pt3:tex',null,null,1,null,'net.sourceforge.fenixedu.domain.Section')  ;

INSERT INTO NODE (NODE_ORDER,ASCENDING,VISIBLE,CONTENT_ID,KEY_CHILD,KEY_PARENT,KEY_ROOT_DOMAIN_OBJECT,OJB_CONCRETE_CLASS) VALUES (14,1,1,'4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8',1,2,1,'net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode')  ;

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,'1071ab2d-da9d-4b94-9e62-d7d3375291d8','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(2,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
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_FUNCTIONALITY=CT.ID_INTERNAL WHERE T.KEY_FUNCTIONALITY=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_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, 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;

UPDATE CONTENT SET ENABLED=null,MODIFICATION_DATE=null,MAXIMIZABLE=0,PREFIX=null,KEY_INITIAL_CONTENT=null,CONTENT_ID='1071ab2d-da9d-4b94-9e62-d7d3375291d8',CREATION_DATE='2008-08-11 14:50:40',NAME='pt23:Trabalho Extraordinário',TITLE=null,BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt23:trabalho-extraordinario',KEY_PORTAL=null,KEY_AVAILABILITY_POLICY=null,KEY_ROOT_DOMAIN_OBJECT=1,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.Section' WHERE CONTENT_ID = '1071ab2d-da9d-4b94-9e62-d7d3375291d8'  ;

UPDATE NODE SET NODE_ORDER=8,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8',KEY_CHILD=3,KEY_PARENT=4,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8'  ;

UPDATE NODE SET NODE_ORDER=14,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158',KEY_CHILD=5,KEY_PARENT=6,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158'  ;

UPDATE NODE SET NODE_ORDER=11,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa',KEY_CHILD=7,KEY_PARENT=8,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa'  ;

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(3,'1071ab2d-da9d-4b94-9e62-d7d3375291d8','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(4,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(5,'ffd5b9b4-3154-48a5-b642-82279e266158','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(6,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(7,'8146f25be0b5adb1ddac714896938cfa','4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(8,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa') ;
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_FUNCTIONALITY=CT.ID_INTERNAL WHERE T.KEY_FUNCTIONALITY=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_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, 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;

UPDATE CONTENT SET ENABLED=null,MODIFICATION_DATE=null,MAXIMIZABLE=0,PREFIX=null,KEY_INITIAL_CONTENT=null,CONTENT_ID='1071ab2d-da9d-4b94-9e62-d7d3375291d8',CREATION_DATE='2008-08-11 14:50:40',NAME='pt23:Trabalho Extraordinário',TITLE=null,BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt23:trabalho-extraordinario',KEY_PORTAL=null,KEY_AVAILABILITY_POLICY=null,KEY_ROOT_DOMAIN_OBJECT=1,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.Section' WHERE CONTENT_ID = '1071ab2d-da9d-4b94-9e62-d7d3375291d8'  ;

UPDATE NODE SET NODE_ORDER=11,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8',KEY_CHILD=9,KEY_PARENT=10,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8'  ;

UPDATE NODE SET NODE_ORDER=15,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158',KEY_CHILD=11,KEY_PARENT=12,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158'  ;

UPDATE NODE SET NODE_ORDER=12,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa',KEY_CHILD=13,KEY_PARENT=14,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa'  ;

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(9,'1071ab2d-da9d-4b94-9e62-d7d3375291d8','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(10,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(11,'ffd5b9b4-3154-48a5-b642-82279e266158','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(12,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(13,'8146f25be0b5adb1ddac714896938cfa','4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(14,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa') ;
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_FUNCTIONALITY=CT.ID_INTERNAL WHERE T.KEY_FUNCTIONALITY=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_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, 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;

UPDATE CONTENT SET ENABLED=null,MODIFICATION_DATE=null,MAXIMIZABLE=1,PREFIX=null,KEY_INITIAL_CONTENT=null,CONTENT_ID='224d0802ac2abb73bbe35408af631e4b',CREATION_DATE='2008-01-14 20:40:18',NAME='pt23:Trabalho Extraordinário',TITLE=null,BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt23:trabalho-extraordinario',KEY_PORTAL=null,KEY_AVAILABILITY_POLICY=15,KEY_ROOT_DOMAIN_OBJECT=1,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.Section' WHERE CONTENT_ID = '224d0802ac2abb73bbe35408af631e4b'  ;

UPDATE NODE SET NODE_ORDER=16,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158',KEY_CHILD=16,KEY_PARENT=17,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158'  ;

UPDATE NODE SET NODE_ORDER=15,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b',KEY_CHILD=18,KEY_PARENT=19,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b'  ;

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(15,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(16,'ffd5b9b4-3154-48a5-b642-82279e266158','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(17,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(18,'224d0802ac2abb73bbe35408af631e4b','4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(19,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b') ;
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_FUNCTIONALITY=CT.ID_INTERNAL WHERE T.KEY_FUNCTIONALITY=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_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, 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;

UPDATE CONTENT SET ENABLED=null,MODIFICATION_DATE=null,MAXIMIZABLE=0,PREFIX=null,KEY_INITIAL_CONTENT=null,CONTENT_ID='224d0802ac2abb73bbe35408af631e4b',CREATION_DATE='2008-01-14 20:40:18',NAME='pt23:Trabalho Extraordinário',TITLE=null,BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt23:trabalho-extraordinario',KEY_PORTAL=null,KEY_AVAILABILITY_POLICY=20,KEY_ROOT_DOMAIN_OBJECT=1,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.Section' WHERE CONTENT_ID = '224d0802ac2abb73bbe35408af631e4b'  ;

UPDATE NODE SET NODE_ORDER=12,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8',KEY_CHILD=21,KEY_PARENT=22,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8'  ;

UPDATE NODE SET NODE_ORDER=17,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158',KEY_CHILD=23,KEY_PARENT=24,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158'  ;

UPDATE NODE SET NODE_ORDER=8,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b',KEY_CHILD=25,KEY_PARENT=26,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b'  ;

UPDATE NODE SET NODE_ORDER=13,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa',KEY_CHILD=27,KEY_PARENT=28,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa'  ;

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(20,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(21,'1071ab2d-da9d-4b94-9e62-d7d3375291d8','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(22,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(23,'ffd5b9b4-3154-48a5-b642-82279e266158','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(24,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(25,'224d0802ac2abb73bbe35408af631e4b','4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(26,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(27,'8146f25be0b5adb1ddac714896938cfa','4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(28,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa') ;
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_FUNCTIONALITY=CT.ID_INTERNAL WHERE T.KEY_FUNCTIONALITY=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_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, 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;

UPDATE CONTENT SET ENABLED=null,MODIFICATION_DATE=null,MAXIMIZABLE=0,PREFIX=null,KEY_INITIAL_CONTENT=null,CONTENT_ID='1071ab2d-da9d-4b94-9e62-d7d3375291d8',CREATION_DATE='2008-08-11 14:50:40',NAME='pt23:Trabalho Extraordinário',TITLE=null,BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt23:trabalho-extraordinario',KEY_PORTAL=null,KEY_AVAILABILITY_POLICY=null,KEY_ROOT_DOMAIN_OBJECT=1,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.Section' WHERE CONTENT_ID = '1071ab2d-da9d-4b94-9e62-d7d3375291d8'  ;

UPDATE NODE SET NODE_ORDER=8,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8',KEY_CHILD=29,KEY_PARENT=30,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8'  ;

UPDATE NODE SET NODE_ORDER=18,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158',KEY_CHILD=31,KEY_PARENT=32,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158'  ;

UPDATE NODE SET NODE_ORDER=9,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b',KEY_CHILD=33,KEY_PARENT=34,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b'  ;

UPDATE NODE SET NODE_ORDER=14,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa',KEY_CHILD=35,KEY_PARENT=36,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa'  ;

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(29,'1071ab2d-da9d-4b94-9e62-d7d3375291d8','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(30,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(31,'ffd5b9b4-3154-48a5-b642-82279e266158','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(32,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(33,'224d0802ac2abb73bbe35408af631e4b','4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(34,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(35,'8146f25be0b5adb1ddac714896938cfa','4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(36,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa') ;
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_FUNCTIONALITY=CT.ID_INTERNAL WHERE T.KEY_FUNCTIONALITY=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_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, 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;

INSERT INTO NODE (NODE_ORDER,ASCENDING,VISIBLE,CONTENT_ID,KEY_CHILD,KEY_PARENT,KEY_ROOT_DOMAIN_OBJECT,OJB_CONCRETE_CLASS) VALUES (0,1,1,'1071ab2d-da9d-4b94-9e62-d7d3375291d8:224d0802ac2abb73bbe35408af631e4b',37,38,1,'net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode')  ;

UPDATE NODE SET NODE_ORDER=1,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:90853396807ee1c33c30f536a898437e',KEY_CHILD=39,KEY_PARENT=40,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:90853396807ee1c33c30f536a898437e'  ;

UPDATE NODE SET NODE_ORDER=7,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8',KEY_CHILD=41,KEY_PARENT=42,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8'  ;

UPDATE NODE SET NODE_ORDER=4,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:937f03acb2dbc4f14f2f2e4fc96da900',KEY_CHILD=43,KEY_PARENT=44,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:937f03acb2dbc4f14f2f2e4fc96da900'  ;

UPDATE NODE SET NODE_ORDER=9,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158',KEY_CHILD=45,KEY_PARENT=46,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158'  ;

UPDATE NODE SET NODE_ORDER=6,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:47be71e08fbae9e0f618d6676dbd4795',KEY_CHILD=47,KEY_PARENT=48,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:47be71e08fbae9e0f618d6676dbd4795'  ;

UPDATE NODE SET NODE_ORDER=2,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:a21411a5-f2d0-4c53-a4ab-8157f26ebb30',KEY_CHILD=49,KEY_PARENT=50,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:a21411a5-f2d0-4c53-a4ab-8157f26ebb30'  ;

UPDATE NODE SET NODE_ORDER=5,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:004b472cf566a3fac5c49bf07809d810',KEY_CHILD=51,KEY_PARENT=52,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:004b472cf566a3fac5c49bf07809d810'  ;

UPDATE NODE SET NODE_ORDER=3,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:5354372706fb2f105e582052e1a47a71',KEY_CHILD=53,KEY_PARENT=54,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:5354372706fb2f105e582052e1a47a71'  ;

UPDATE NODE SET NODE_ORDER=8,ASCENDING=1,VISIBLE=1,CONTENT_ID='4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa',KEY_CHILD=55,KEY_PARENT=56,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa'  ;

DELETE FROM NODE WHERE CONTENT_ID = '4101ca37aed1cd725fb24f2a2748caf9:224d0802ac2abb73bbe35408af631e4b' ;

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(37,'224d0802ac2abb73bbe35408af631e4b','1071ab2d-da9d-4b94-9e62-d7d3375291d8:224d0802ac2abb73bbe35408af631e4b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(38,'1071ab2d-da9d-4b94-9e62-d7d3375291d8','1071ab2d-da9d-4b94-9e62-d7d3375291d8:224d0802ac2abb73bbe35408af631e4b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(39,'90853396807ee1c33c30f536a898437e','4101ca37aed1cd725fb24f2a2748caf9:90853396807ee1c33c30f536a898437e') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(40,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:90853396807ee1c33c30f536a898437e') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(41,'1071ab2d-da9d-4b94-9e62-d7d3375291d8','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(42,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:1071ab2d-da9d-4b94-9e62-d7d3375291d8') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(43,'937f03acb2dbc4f14f2f2e4fc96da900','4101ca37aed1cd725fb24f2a2748caf9:937f03acb2dbc4f14f2f2e4fc96da900') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(44,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:937f03acb2dbc4f14f2f2e4fc96da900') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(45,'ffd5b9b4-3154-48a5-b642-82279e266158','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(46,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:ffd5b9b4-3154-48a5-b642-82279e266158') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(47,'47be71e08fbae9e0f618d6676dbd4795','4101ca37aed1cd725fb24f2a2748caf9:47be71e08fbae9e0f618d6676dbd4795') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(48,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:47be71e08fbae9e0f618d6676dbd4795') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(49,'4101ca37aed1cd725fb24f2a2748caf9:a21411a5-f2d0-4c53-a4ab-8157f26ebb30','4101ca37aed1cd725fb24f2a2748caf9:a21411a5-f2d0-4c53-a4ab-8157f26ebb30') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(50,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:a21411a5-f2d0-4c53-a4ab-8157f26ebb30') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(51,'004b472cf566a3fac5c49bf07809d810','4101ca37aed1cd725fb24f2a2748caf9:004b472cf566a3fac5c49bf07809d810') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(52,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:004b472cf566a3fac5c49bf07809d810') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(53,'5354372706fb2f105e582052e1a47a71','4101ca37aed1cd725fb24f2a2748caf9:5354372706fb2f105e582052e1a47a71') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(54,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:5354372706fb2f105e582052e1a47a71') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(55,'8146f25be0b5adb1ddac714896938cfa','4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(56,'4101ca37aed1cd725fb24f2a2748caf9','4101ca37aed1cd725fb24f2a2748caf9:8146f25be0b5adb1ddac714896938cfa') ;
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_FUNCTIONALITY=CT.ID_INTERNAL WHERE T.KEY_FUNCTIONALITY=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_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, 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;

UPDATE CONTENT SET ENABLED=null,MODIFICATION_DATE=null,MAXIMIZABLE=1,PREFIX=null,KEY_INITIAL_CONTENT=null,CONTENT_ID='224d0802ac2abb73bbe35408af631e4b',CREATION_DATE='2008-01-14 20:40:18',NAME='pt23:Trabalho Extraordinário',TITLE=null,BODY=null,DESCRIPTION=null,NORMALIZED_NAME='pt23:trabalho-extraordinario',KEY_PORTAL=null,KEY_AVAILABILITY_POLICY=57,KEY_ROOT_DOMAIN_OBJECT=1,KEY_CREATOR=null,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.Section' WHERE CONTENT_ID = '224d0802ac2abb73bbe35408af631e4b'  ;

UPDATE NODE SET NODE_ORDER=0,ASCENDING=1,VISIBLE=1,CONTENT_ID='1071ab2d-da9d-4b94-9e62-d7d3375291d8:224d0802ac2abb73bbe35408af631e4b',KEY_CHILD=58,KEY_PARENT=59,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '1071ab2d-da9d-4b94-9e62-d7d3375291d8:224d0802ac2abb73bbe35408af631e4b'  ;

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(57,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(58,'224d0802ac2abb73bbe35408af631e4b','1071ab2d-da9d-4b94-9e62-d7d3375291d8:224d0802ac2abb73bbe35408af631e4b') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(59,'1071ab2d-da9d-4b94-9e62-d7d3375291d8','1071ab2d-da9d-4b94-9e62-d7d3375291d8:224d0802ac2abb73bbe35408af631e4b') ;
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_FUNCTIONALITY=CT.ID_INTERNAL WHERE T.KEY_FUNCTIONALITY=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_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, 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;

INSERT INTO CONTENT (KEY_FUNCTIONALITY,CONTENT_ID,CREATION_DATE,NAME,TITLE,BODY,DESCRIPTION,NORMALIZED_NAME,KEY_PORTAL,KEY_AVAILABILITY_POLICY,KEY_ROOT_DOMAIN_OBJECT,KEY_CREATOR,OJB_CONCRETE_CLASS) VALUES (60,'bd579d5f-afa1-4bc4-80b9-e0e37695b055','2008-08-11 14:55:23',null,null,null,null,null,null,null,1,null,'net.sourceforge.fenixedu.domain.contents.FunctionalityCall')  ;

INSERT INTO NODE (NODE_ORDER,ASCENDING,VISIBLE,CONTENT_ID,KEY_CHILD,KEY_PARENT,KEY_ROOT_DOMAIN_OBJECT,OJB_CONCRETE_CLASS) VALUES (7,1,1,'224d0802ac2abb73bbe35408af631e4b:bd579d5f-afa1-4bc4-80b9-e0e37695b055',61,62,1,'net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode')  ;

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(60,'a21411a5-f2d0-4c53-a4ab-8157f26ebb30','bd579d5f-afa1-4bc4-80b9-e0e37695b055') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(61,'bd579d5f-afa1-4bc4-80b9-e0e37695b055','224d0802ac2abb73bbe35408af631e4b:bd579d5f-afa1-4bc4-80b9-e0e37695b055') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(62,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b:bd579d5f-afa1-4bc4-80b9-e0e37695b055') ;
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_FUNCTIONALITY=CT.ID_INTERNAL WHERE T.KEY_FUNCTIONALITY=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_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, 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;

UPDATE NODE SET NODE_ORDER=8,ASCENDING=1,VISIBLE=1,CONTENT_ID='224d0802ac2abb73bbe35408af631e4b:8bfd0487-1129-485f-a6a0-8002cdb5f482',KEY_CHILD=63,KEY_PARENT=64,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '224d0802ac2abb73bbe35408af631e4b:8bfd0487-1129-485f-a6a0-8002cdb5f482'  ;

UPDATE NODE SET NODE_ORDER=7,ASCENDING=1,VISIBLE=1,CONTENT_ID='224d0802ac2abb73bbe35408af631e4b:682b2768-8c48-49e0-bc99-fa83512b766c',KEY_CHILD=65,KEY_PARENT=66,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '224d0802ac2abb73bbe35408af631e4b:682b2768-8c48-49e0-bc99-fa83512b766c'  ;

UPDATE NODE SET NODE_ORDER=1,ASCENDING=1,VISIBLE=1,CONTENT_ID='224d0802ac2abb73bbe35408af631e4b:bd579d5f-afa1-4bc4-80b9-e0e37695b055',KEY_CHILD=67,KEY_PARENT=68,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '224d0802ac2abb73bbe35408af631e4b:bd579d5f-afa1-4bc4-80b9-e0e37695b055'  ;

UPDATE NODE SET NODE_ORDER=5,ASCENDING=1,VISIBLE=1,CONTENT_ID='224d0802ac2abb73bbe35408af631e4b:3db87525-428c-4997-9d4f-73ca21f249e0',KEY_CHILD=69,KEY_PARENT=70,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '224d0802ac2abb73bbe35408af631e4b:3db87525-428c-4997-9d4f-73ca21f249e0'  ;

UPDATE NODE SET NODE_ORDER=4,ASCENDING=1,VISIBLE=1,CONTENT_ID='224d0802ac2abb73bbe35408af631e4b:e794ccad-6427-4065-988d-d9cbbd008dbd',KEY_CHILD=71,KEY_PARENT=72,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '224d0802ac2abb73bbe35408af631e4b:e794ccad-6427-4065-988d-d9cbbd008dbd'  ;

UPDATE NODE SET NODE_ORDER=3,ASCENDING=1,VISIBLE=1,CONTENT_ID='224d0802ac2abb73bbe35408af631e4b:89d46288-56e6-4f1a-af68-58a0ffe801bf',KEY_CHILD=73,KEY_PARENT=74,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '224d0802ac2abb73bbe35408af631e4b:89d46288-56e6-4f1a-af68-58a0ffe801bf'  ;

UPDATE NODE SET NODE_ORDER=6,ASCENDING=1,VISIBLE=1,CONTENT_ID='224d0802ac2abb73bbe35408af631e4b:ca266592-dbd5-41f5-9e0e-7e7a403d2358',KEY_CHILD=75,KEY_PARENT=76,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '224d0802ac2abb73bbe35408af631e4b:ca266592-dbd5-41f5-9e0e-7e7a403d2358'  ;

UPDATE NODE SET NODE_ORDER=2,ASCENDING=1,VISIBLE=1,CONTENT_ID='224d0802ac2abb73bbe35408af631e4b:6f116dc6-199f-4815-b2fd-9c4609fa317c',KEY_CHILD=77,KEY_PARENT=78,KEY_ROOT_DOMAIN_OBJECT=1,OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode' WHERE CONTENT_ID = '224d0802ac2abb73bbe35408af631e4b:6f116dc6-199f-4815-b2fd-9c4609fa317c'  ;

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(63,'224d0802ac2abb73bbe35408af631e4b:8bfd0487-1129-485f-a6a0-8002cdb5f482','224d0802ac2abb73bbe35408af631e4b:8bfd0487-1129-485f-a6a0-8002cdb5f482') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(64,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b:8bfd0487-1129-485f-a6a0-8002cdb5f482') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(65,'224d0802ac2abb73bbe35408af631e4b:682b2768-8c48-49e0-bc99-fa83512b766c','224d0802ac2abb73bbe35408af631e4b:682b2768-8c48-49e0-bc99-fa83512b766c') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(66,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b:682b2768-8c48-49e0-bc99-fa83512b766c') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(67,'bd579d5f-afa1-4bc4-80b9-e0e37695b055','224d0802ac2abb73bbe35408af631e4b:bd579d5f-afa1-4bc4-80b9-e0e37695b055') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(68,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b:bd579d5f-afa1-4bc4-80b9-e0e37695b055') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(69,'224d0802ac2abb73bbe35408af631e4b:3db87525-428c-4997-9d4f-73ca21f249e0','224d0802ac2abb73bbe35408af631e4b:3db87525-428c-4997-9d4f-73ca21f249e0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(70,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b:3db87525-428c-4997-9d4f-73ca21f249e0') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(71,'224d0802ac2abb73bbe35408af631e4b:e794ccad-6427-4065-988d-d9cbbd008dbd','224d0802ac2abb73bbe35408af631e4b:e794ccad-6427-4065-988d-d9cbbd008dbd') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(72,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b:e794ccad-6427-4065-988d-d9cbbd008dbd') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(73,'224d0802ac2abb73bbe35408af631e4b:89d46288-56e6-4f1a-af68-58a0ffe801bf','224d0802ac2abb73bbe35408af631e4b:89d46288-56e6-4f1a-af68-58a0ffe801bf') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(74,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b:89d46288-56e6-4f1a-af68-58a0ffe801bf') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(75,'224d0802ac2abb73bbe35408af631e4b:ca266592-dbd5-41f5-9e0e-7e7a403d2358','224d0802ac2abb73bbe35408af631e4b:ca266592-dbd5-41f5-9e0e-7e7a403d2358') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(76,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b:ca266592-dbd5-41f5-9e0e-7e7a403d2358') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(77,'224d0802ac2abb73bbe35408af631e4b:6f116dc6-199f-4815-b2fd-9c4609fa317c','224d0802ac2abb73bbe35408af631e4b:6f116dc6-199f-4815-b2fd-9c4609fa317c') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(78,'224d0802ac2abb73bbe35408af631e4b','224d0802ac2abb73bbe35408af631e4b:6f116dc6-199f-4815-b2fd-9c4609fa317c') ;
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_FUNCTIONALITY=CT.ID_INTERNAL WHERE T.KEY_FUNCTIONALITY=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_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, 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;
