
START TRANSACTION;

UPDATE NODE SET OID=3551938001452,NODE_ORDER=7,ASCENDING=1,VISIBLE=1,CONTENT_ID='333ed836-75a1-42b9-82ca-bd73ddc696bb:6c6c707b-3a07-4f8c-b76e-7bfdce694324',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=1,OID_CHILD=8590028918,KEY_PARENT=2,OID_PARENT=1198295970038,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '333ed836-75a1-42b9-82ca-bd73ddc696bb:6c6c707b-3a07-4f8c-b76e-7bfdce694324'  ;

UPDATE NODE SET OID=3551938009028,NODE_ORDER=0,ASCENDING=1,VISIBLE=1,CONTENT_ID='854389a2a6f2d93c2bd30d882043916b:c9b302443e96556fcb575fcd79cfb719',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=3,OID_CHILD=403727020399,KEY_PARENT=4,OID_PARENT=403727020398,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '854389a2a6f2d93c2bd30d882043916b:c9b302443e96556fcb575fcd79cfb719'  ;

UPDATE NODE SET OID=3551938001582,NODE_ORDER=6,ASCENDING=1,VISIBLE=0,CONTENT_ID='333ed836-75a1-42b9-82ca-bd73ddc696bb:0b58f724-6282-48fb-9de7-b84c852a940c',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=5,OID_CHILD=1198295970051,KEY_PARENT=6,OID_PARENT=1198295970038,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '333ed836-75a1-42b9-82ca-bd73ddc696bb:0b58f724-6282-48fb-9de7-b84c852a940c'  ;

UPDATE NODE SET OID=3551938001577,NODE_ORDER=4,ASCENDING=1,VISIBLE=0,CONTENT_ID='333ed836-75a1-42b9-82ca-bd73ddc696bb:10e32908-a524-47df-8a36-f6ab0d48462c',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=7,OID_CHILD=1198295970046,KEY_PARENT=8,OID_PARENT=1198295970038,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '333ed836-75a1-42b9-82ca-bd73ddc696bb:10e32908-a524-47df-8a36-f6ab0d48462c'  ;

UPDATE NODE SET OID=3551938001319,NODE_ORDER=5,ASCENDING=1,VISIBLE=1,CONTENT_ID='333ed836-75a1-42b9-82ca-bd73ddc696bb:50ab74d4-5050-4975-b88c-91b0c39ed493',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=9,OID_CHILD=8590028785,KEY_PARENT=10,OID_PARENT=1198295970038,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '333ed836-75a1-42b9-82ca-bd73ddc696bb:50ab74d4-5050-4975-b88c-91b0c39ed493'  ;

UPDATE NODE SET OID=3551938001305,NODE_ORDER=3,ASCENDING=1,VISIBLE=1,CONTENT_ID='333ed836-75a1-42b9-82ca-bd73ddc696bb:0cac3f6f-6be4-4476-8681-7b980edbccee',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=11,OID_CHILD=8590028771,KEY_PARENT=12,OID_PARENT=1198295970038,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '333ed836-75a1-42b9-82ca-bd73ddc696bb:0cac3f6f-6be4-4476-8681-7b980edbccee'  ;

UPDATE NODE SET OID=3551938009026,NODE_ORDER=1,ASCENDING=1,VISIBLE=1,CONTENT_ID='7a7f91fc348bc0eb115e797487be440b:c8f900f18f344f60a56dbd324e52d425',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=13,OID_CHILD=403727020397,KEY_PARENT=14,OID_PARENT=403727020396,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:c8f900f18f344f60a56dbd324e52d425'  ;

DELETE FROM CONTENT WHERE CONTENT_ID = 'd10a4165-b657-4225-8b47-8c67e32ffeb5' ;

DELETE FROM EXECUTION_PATH WHERE CONTENT_ID = '7b1f1a12-101d-4ec0-934a-7055f35e83ef' ;

DELETE FROM CONTENT WHERE CONTENT_ID = 'e17b65a4-159c-499a-b1bb-6778fe117ba3' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '40ba1134-f17d-4836-b629-748f6b8a6072' ;

DELETE FROM EXECUTION_PATH WHERE CONTENT_ID = '80a68f83-1172-4a70-b3bf-f1c87988c497' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:80a68f83-1172-4a70-b3bf-f1c87988c497' ;

DELETE FROM NODE WHERE CONTENT_ID = '6e47111a-6408-46b1-918b-11a61f109037:8955f704-9ea8-4165-b7a2-3ac88d1de037' ;

DELETE FROM NODE WHERE CONTENT_ID = '59e0a4d6-3e45-4ca0-8313-0bf62b898b15:e4ad482f-f854-4c33-ace1-1f976efec758' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '59e0a4d6-3e45-4ca0-8313-0bf62b898b15' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '1ee76765-996b-4663-8a70-d690e6f1ae75' ;

DELETE FROM NODE WHERE CONTENT_ID = '6e47111a-6408-46b1-918b-11a61f109037:d10a4165-b657-4225-8b47-8c67e32ffeb5' ;

DELETE FROM EXECUTION_PATH WHERE CONTENT_ID = 'e4ad482f-f854-4c33-ace1-1f976efec758' ;

DELETE FROM CONTENT WHERE CONTENT_ID = 'cd8c3820-211e-4ef1-8205-aa1ce6731d44' ;

DELETE FROM NODE WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:1ee76765-996b-4663-8a70-d690e6f1ae75' ;

DELETE FROM NODE WHERE CONTENT_ID = 'eab12044-ffdb-4024-9a65-66a8f1584899:40ba1134-f17d-4836-b629-748f6b8a6072' ;

DELETE FROM NODE WHERE CONTENT_ID = '333ed836-75a1-42b9-82ca-bd73ddc696bb:59e0a4d6-3e45-4ca0-8313-0bf62b898b15' ;

DELETE FROM NODE WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:a6c9fbe3-77ea-4187-981d-7ada15a348fa' ;

DELETE FROM NODE WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:7b1f1a12-101d-4ec0-934a-7055f35e83ef' ;

DELETE FROM NODE WHERE CONTENT_ID = '59e0a4d6-3e45-4ca0-8313-0bf62b898b15:80a68f83-1172-4a70-b3bf-f1c87988c497' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '854389a2a6f2d93c2bd30d882043916b:70ad8d57-a202-4cd8-9a96-9c420b777704' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '7b1f1a12-101d-4ec0-934a-7055f35e83ef' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '6e47111a-6408-46b1-918b-11a61f109037' ;

DELETE FROM EXECUTION_PATH WHERE CONTENT_ID = 'cd8c3820-211e-4ef1-8205-aa1ce6731d44' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:a6c9fbe3-77ea-4187-981d-7ada15a348fa' ;

DELETE FROM NODE WHERE CONTENT_ID = 'c9b302443e96556fcb575fcd79cfb719:8955f704-9ea8-4165-b7a2-3ac88d1de037' ;

DELETE FROM NODE WHERE CONTENT_ID = '59e0a4d6-3e45-4ca0-8313-0bf62b898b15:eab12044-ffdb-4024-9a65-66a8f1584899' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '854389a2a6f2d93c2bd30d882043916b:cd8c3820-211e-4ef1-8205-aa1ce6731d44' ;

DELETE FROM NODE WHERE CONTENT_ID = '40ba1134-f17d-4836-b629-748f6b8a6072:70ad8d57-a202-4cd8-9a96-9c420b777704' ;

DELETE FROM CONTENT WHERE CONTENT_ID = 'a6c9fbe3-77ea-4187-981d-7ada15a348fa' ;

DELETE FROM CONTENT WHERE CONTENT_ID = 'c9b302443e96556fcb575fcd79cfb719:8955f704-9ea8-4165-b7a2-3ac88d1de037' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '70ad8d57-a202-4cd8-9a96-9c420b777704' ;

DELETE FROM EXECUTION_PATH WHERE CONTENT_ID = '70ad8d57-a202-4cd8-9a96-9c420b777704' ;

DELETE FROM NODE WHERE CONTENT_ID = '40ba1134-f17d-4836-b629-748f6b8a6072:6e47111a-6408-46b1-918b-11a61f109037' ;

DELETE FROM EXECUTION_PATH WHERE CONTENT_ID = 'e17b65a4-159c-499a-b1bb-6778fe117ba3' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:e4ad482f-f854-4c33-ace1-1f976efec758' ;

DELETE FROM NODE WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:80a68f83-1172-4a70-b3bf-f1c87988c497' ;

DELETE FROM NODE WHERE CONTENT_ID = '59e0a4d6-3e45-4ca0-8313-0bf62b898b15:1ee76765-996b-4663-8a70-d690e6f1ae75' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '8955f704-9ea8-4165-b7a2-3ac88d1de037' ;

DELETE FROM NODE WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:e4ad482f-f854-4c33-ace1-1f976efec758' ;

DELETE FROM NODE WHERE CONTENT_ID = '59e0a4d6-3e45-4ca0-8313-0bf62b898b15:a6c9fbe3-77ea-4187-981d-7ada15a348fa' ;

DELETE FROM NODE WHERE CONTENT_ID = '40ba1134-f17d-4836-b629-748f6b8a6072:e17b65a4-159c-499a-b1bb-6778fe117ba3' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '80a68f83-1172-4a70-b3bf-f1c87988c497' ;

DELETE FROM NODE WHERE CONTENT_ID = '854389a2a6f2d93c2bd30d882043916b:cd8c3820-211e-4ef1-8205-aa1ce6731d44' ;

DELETE FROM EXECUTION_PATH WHERE CONTENT_ID = '8955f704-9ea8-4165-b7a2-3ac88d1de037' ;

DELETE FROM CONTENT WHERE CONTENT_ID = 'e4ad482f-f854-4c33-ace1-1f976efec758' ;

DELETE FROM EXECUTION_PATH WHERE CONTENT_ID = '1ee76765-996b-4663-8a70-d690e6f1ae75' ;

DELETE FROM NODE WHERE CONTENT_ID = '40ba1134-f17d-4836-b629-748f6b8a6072:cd8c3820-211e-4ef1-8205-aa1ce6731d44' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '854389a2a6f2d93c2bd30d882043916b:e17b65a4-159c-499a-b1bb-6778fe117ba3' ;

DELETE FROM EXECUTION_PATH WHERE CONTENT_ID = 'd10a4165-b657-4225-8b47-8c67e32ffeb5' ;

DELETE FROM EXECUTION_PATH WHERE CONTENT_ID = 'a6c9fbe3-77ea-4187-981d-7ada15a348fa' ;

DELETE FROM NODE WHERE CONTENT_ID = 'c9b302443e96556fcb575fcd79cfb719:d10a4165-b657-4225-8b47-8c67e32ffeb5' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:1ee76765-996b-4663-8a70-d690e6f1ae75' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:7b1f1a12-101d-4ec0-934a-7055f35e83ef' ;

DELETE FROM CONTENT WHERE CONTENT_ID = 'c9b302443e96556fcb575fcd79cfb719:d10a4165-b657-4225-8b47-8c67e32ffeb5' ;

DELETE FROM NODE WHERE CONTENT_ID = '59e0a4d6-3e45-4ca0-8313-0bf62b898b15:7b1f1a12-101d-4ec0-934a-7055f35e83ef' ;

DELETE FROM NODE WHERE CONTENT_ID = '854389a2a6f2d93c2bd30d882043916b:e17b65a4-159c-499a-b1bb-6778fe117ba3' ;

DELETE FROM NODE WHERE CONTENT_ID = '854389a2a6f2d93c2bd30d882043916b:70ad8d57-a202-4cd8-9a96-9c420b777704' ;

DELETE FROM CONTENT WHERE CONTENT_ID = 'eab12044-ffdb-4024-9a65-66a8f1584899' ;

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,'6c6c707b-3a07-4f8c-b76e-7bfdce694324','333ed836-75a1-42b9-82ca-bd73ddc696bb:6c6c707b-3a07-4f8c-b76e-7bfdce694324') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(2,'333ed836-75a1-42b9-82ca-bd73ddc696bb','333ed836-75a1-42b9-82ca-bd73ddc696bb:6c6c707b-3a07-4f8c-b76e-7bfdce694324') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(3,'c9b302443e96556fcb575fcd79cfb719','854389a2a6f2d93c2bd30d882043916b:c9b302443e96556fcb575fcd79cfb719') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(4,'854389a2a6f2d93c2bd30d882043916b','854389a2a6f2d93c2bd30d882043916b:c9b302443e96556fcb575fcd79cfb719') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(5,'0b58f724-6282-48fb-9de7-b84c852a940c','333ed836-75a1-42b9-82ca-bd73ddc696bb:0b58f724-6282-48fb-9de7-b84c852a940c') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(6,'333ed836-75a1-42b9-82ca-bd73ddc696bb','333ed836-75a1-42b9-82ca-bd73ddc696bb:0b58f724-6282-48fb-9de7-b84c852a940c') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(7,'10e32908-a524-47df-8a36-f6ab0d48462c','333ed836-75a1-42b9-82ca-bd73ddc696bb:10e32908-a524-47df-8a36-f6ab0d48462c') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(8,'333ed836-75a1-42b9-82ca-bd73ddc696bb','333ed836-75a1-42b9-82ca-bd73ddc696bb:10e32908-a524-47df-8a36-f6ab0d48462c') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(9,'50ab74d4-5050-4975-b88c-91b0c39ed493','333ed836-75a1-42b9-82ca-bd73ddc696bb:50ab74d4-5050-4975-b88c-91b0c39ed493') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(10,'333ed836-75a1-42b9-82ca-bd73ddc696bb','333ed836-75a1-42b9-82ca-bd73ddc696bb:50ab74d4-5050-4975-b88c-91b0c39ed493') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(11,'0cac3f6f-6be4-4476-8681-7b980edbccee','333ed836-75a1-42b9-82ca-bd73ddc696bb:0cac3f6f-6be4-4476-8681-7b980edbccee') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(12,'333ed836-75a1-42b9-82ca-bd73ddc696bb','333ed836-75a1-42b9-82ca-bd73ddc696bb:0cac3f6f-6be4-4476-8681-7b980edbccee') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(13,'c8f900f18f344f60a56dbd324e52d425','7a7f91fc348bc0eb115e797487be440b:c8f900f18f344f60a56dbd324e52d425') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(14,'7a7f91fc348bc0eb115e797487be440b','7a7f91fc348bc0eb115e797487be440b:c8f900f18f344f60a56dbd324e52d425') ;
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 OID=3551938009017,NODE_ORDER=2,ASCENDING=1,VISIBLE=1,CONTENT_ID='2e4c8afd4e6603be60e680efd140e8fb:e046e45719e698af8638fb0ab3001a90',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=15,OID_CHILD=403727020388,KEY_PARENT=16,OID_PARENT=403727020387,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '2e4c8afd4e6603be60e680efd140e8fb:e046e45719e698af8638fb0ab3001a90'  ;

UPDATE NODE SET OID=3551938009308,NODE_ORDER=3,ASCENDING=1,VISIBLE=1,CONTENT_ID='2e4c8afd4e6603be60e680efd140e8fb:6c6c707b-3a07-4f8c-b76e-7bfdce694324',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=17,OID_CHILD=3749506657656,KEY_PARENT=18,OID_PARENT=403727020387,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '2e4c8afd4e6603be60e680efd140e8fb:6c6c707b-3a07-4f8c-b76e-7bfdce694324'  ;

DELETE FROM NODE WHERE CONTENT_ID = '854389a2a6f2d93c2bd30d882043916b:c9b302443e96556fcb575fcd79cfb719' ;

DELETE FROM CONTENT WHERE CONTENT_ID = 'c8f900f18f344f60a56dbd324e52d425' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '854389a2a6f2d93c2bd30d882043916b' ;

DELETE FROM NODE WHERE CONTENT_ID = '2e4c8afd4e6603be60e680efd140e8fb:7a7f91fc348bc0eb115e797487be440b' ;

DELETE FROM NODE WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:c8f900f18f344f60a56dbd324e52d425' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b' ;

DELETE FROM CONTENT WHERE CONTENT_ID = 'c9b302443e96556fcb575fcd79cfb719' ;

DELETE FROM NODE WHERE CONTENT_ID = 'c8f900f18f344f60a56dbd324e52d425:854389a2a6f2d93c2bd30d882043916b' ;

DELETE FROM CONTENT WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:fe00b1c9-b931-489c-9398-21ddf806a638' ;

DELETE FROM NODE WHERE CONTENT_ID = '7a7f91fc348bc0eb115e797487be440b:fe00b1c9-b931-489c-9398-21ddf806a638' ;

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,'e046e45719e698af8638fb0ab3001a90','2e4c8afd4e6603be60e680efd140e8fb:e046e45719e698af8638fb0ab3001a90') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(16,'2e4c8afd4e6603be60e680efd140e8fb','2e4c8afd4e6603be60e680efd140e8fb:e046e45719e698af8638fb0ab3001a90') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(17,'2e4c8afd4e6603be60e680efd140e8fb:6c6c707b-3a07-4f8c-b76e-7bfdce694324','2e4c8afd4e6603be60e680efd140e8fb:6c6c707b-3a07-4f8c-b76e-7bfdce694324') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(18,'2e4c8afd4e6603be60e680efd140e8fb','2e4c8afd4e6603be60e680efd140e8fb:6c6c707b-3a07-4f8c-b76e-7bfdce694324') ;
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 (OID,KEY_FUNCTIONALITY,OID_FUNCTIONALITY,CONTENT_ID,CREATION_DATE,NAME,TITLE,BODY,DESCRIPTION,NORMALIZED_NAME,OJB_CONCRETE_CLASS,KEY_PORTAL,OID_PORTAL,KEY_AVAILABILITY_POLICY,OID_AVAILABILITY_POLICY,KEY_ROOT_DOMAIN_OBJECT,OID_ROOT_DOMAIN_OBJECT,KEY_CREATOR,OID_CREATOR) VALUES (3749507145101,19,8590028774,'6a9c2a30-45c7-4c01-8c30-a117458edb41','2009-06-04 12:59:57',null,null,null,null,null,'net.sourceforge.fenixedu.domain.contents.FunctionalityCall',null,null,null,null,1,1035087118337,null,null)  ;

INSERT INTO NODE (OID,NODE_ORDER,ASCENDING,VISIBLE,CONTENT_ID,OJB_CONCRETE_CLASS,KEY_CHILD,OID_CHILD,KEY_PARENT,OID_PARENT,KEY_ROOT_DOMAIN_OBJECT,OID_ROOT_DOMAIN_OBJECT) VALUES (3551963252029,4,1,1,'2e4c8afd4e6603be60e680efd140e8fb:6a9c2a30-45c7-4c01-8c30-a117458edb41','net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',20,3749507145101,21,403727020387,1,1035087118337)  ;

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(19,'fe00b1c9-b931-489c-9398-21ddf806a638','6a9c2a30-45c7-4c01-8c30-a117458edb41') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(20,'6a9c2a30-45c7-4c01-8c30-a117458edb41','2e4c8afd4e6603be60e680efd140e8fb:6a9c2a30-45c7-4c01-8c30-a117458edb41') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(21,'2e4c8afd4e6603be60e680efd140e8fb','2e4c8afd4e6603be60e680efd140e8fb:6a9c2a30-45c7-4c01-8c30-a117458edb41') ;
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 OID=3551938009017,NODE_ORDER=4,ASCENDING=1,VISIBLE=1,CONTENT_ID='2e4c8afd4e6603be60e680efd140e8fb:e046e45719e698af8638fb0ab3001a90',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=22,OID_CHILD=403727020388,KEY_PARENT=23,OID_PARENT=403727020387,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '2e4c8afd4e6603be60e680efd140e8fb:e046e45719e698af8638fb0ab3001a90'  ;

UPDATE NODE SET OID=3551938009308,NODE_ORDER=5,ASCENDING=1,VISIBLE=1,CONTENT_ID='2e4c8afd4e6603be60e680efd140e8fb:6c6c707b-3a07-4f8c-b76e-7bfdce694324',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=24,OID_CHILD=3749506657656,KEY_PARENT=25,OID_PARENT=403727020387,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '2e4c8afd4e6603be60e680efd140e8fb:6c6c707b-3a07-4f8c-b76e-7bfdce694324'  ;

UPDATE NODE SET OID=3551938009029,NODE_ORDER=1,ASCENDING=1,VISIBLE=1,CONTENT_ID='2e4c8afd4e6603be60e680efd140e8fb:a2dbd965ff55ac88b6974db02f537cc5',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=26,OID_CHILD=403727020400,KEY_PARENT=27,OID_PARENT=403727020387,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '2e4c8afd4e6603be60e680efd140e8fb:a2dbd965ff55ac88b6974db02f537cc5'  ;

UPDATE NODE SET OID=3551963252029,NODE_ORDER=3,ASCENDING=1,VISIBLE=1,CONTENT_ID='2e4c8afd4e6603be60e680efd140e8fb:6a9c2a30-45c7-4c01-8c30-a117458edb41',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=28,OID_CHILD=3749507145101,KEY_PARENT=29,OID_PARENT=403727020387,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '2e4c8afd4e6603be60e680efd140e8fb:6a9c2a30-45c7-4c01-8c30-a117458edb41'  ;

UPDATE NODE SET OID=3551938009024,NODE_ORDER=2,ASCENDING=1,VISIBLE=1,CONTENT_ID='2e4c8afd4e6603be60e680efd140e8fb:68ef9f05d4e026bf3c6aee96f1e2237e',OJB_CONCRETE_CLASS='net.sourceforge.fenixedu.domain.contents.ExplicitOrderNode',KEY_CHILD=30,OID_CHILD=403727020395,KEY_PARENT=31,OID_PARENT=403727020387,KEY_ROOT_DOMAIN_OBJECT=1,OID_ROOT_DOMAIN_OBJECT=1035087118337 WHERE CONTENT_ID = '2e4c8afd4e6603be60e680efd140e8fb:68ef9f05d4e026bf3c6aee96f1e2237e'  ;

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(22,'e046e45719e698af8638fb0ab3001a90','2e4c8afd4e6603be60e680efd140e8fb:e046e45719e698af8638fb0ab3001a90') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(23,'2e4c8afd4e6603be60e680efd140e8fb','2e4c8afd4e6603be60e680efd140e8fb:e046e45719e698af8638fb0ab3001a90') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(24,'2e4c8afd4e6603be60e680efd140e8fb:6c6c707b-3a07-4f8c-b76e-7bfdce694324','2e4c8afd4e6603be60e680efd140e8fb:6c6c707b-3a07-4f8c-b76e-7bfdce694324') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(25,'2e4c8afd4e6603be60e680efd140e8fb','2e4c8afd4e6603be60e680efd140e8fb:6c6c707b-3a07-4f8c-b76e-7bfdce694324') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(26,'a2dbd965ff55ac88b6974db02f537cc5','2e4c8afd4e6603be60e680efd140e8fb:a2dbd965ff55ac88b6974db02f537cc5') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(27,'2e4c8afd4e6603be60e680efd140e8fb','2e4c8afd4e6603be60e680efd140e8fb:a2dbd965ff55ac88b6974db02f537cc5') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(28,'6a9c2a30-45c7-4c01-8c30-a117458edb41','2e4c8afd4e6603be60e680efd140e8fb:6a9c2a30-45c7-4c01-8c30-a117458edb41') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(29,'2e4c8afd4e6603be60e680efd140e8fb','2e4c8afd4e6603be60e680efd140e8fb:6a9c2a30-45c7-4c01-8c30-a117458edb41') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(30,'68ef9f05d4e026bf3c6aee96f1e2237e','2e4c8afd4e6603be60e680efd140e8fb:68ef9f05d4e026bf3c6aee96f1e2237e') ;
INSERT INTO UUID_TEMP_TABLE(COUNTER,UUID,FROM_UUID) VALUES(31,'2e4c8afd4e6603be60e680efd140e8fb','2e4c8afd4e6603be60e680efd140e8fb:68ef9f05d4e026bf3c6aee96f1e2237e') ;
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;
