INSERT INTO ACCESSIBLE_ITEM 
	(OJB_CONCRETE_CLASS, KEY_SITE, SECTION_ORDER, KEY_FUNCTIONALITY)
	SELECT 'net.sourceforge.fenixedu.domain.FunctionalitySection', S.ID_INTERNAL, 2, AI.ID_INTERNAL
	FROM ACCESSIBLE_ITEM AS AI, SITE AS S
	WHERE AI.UUID = '931438dc-b0e2-4d2a-b017-1a449adf59e3'
	AND   S.SITE_TYPE = 'net.sourceforge.fenixedu.domain.DepartmentSite';

UPDATE ACCESSIBLE_ITEM AI1, ACCESSIBLE_ITEM AI2, SITE S
SET AI1.ITEM_ORDER = 3
WHERE AI2.UUID = '173e00ae-66ff-408b-a8ce-d4a4011fe3f5'
AND   AI2.ID_INTERNAL = AI1.KEY_FUNCTIONALITY
AND   AI1.KEY_SITE = S.ID_INTERNAL
AND   S.SITE_TYPE = 'net.sourceforge.fenixedu.domain.DepartmentSite';

UPDATE ACCESSIBLE_ITEM AI1, ACCESSIBLE_ITEM AI2, SITE S
SET AI1.ITEM_ORDER = 4
WHERE AI2.UUID = '3bd0759b-edca-4ff7-87d6-6e03b6be1b3c'
AND   AI2.ID_INTERNAL = AI1.KEY_FUNCTIONALITY
AND   AI1.KEY_SITE = S.ID_INTERNAL
AND   S.SITE_TYPE = 'net.sourceforge.fenixedu.domain.DepartmentSite';

UPDATE ACCESSIBLE_ITEM AI1, ACCESSIBLE_ITEM AI2, SITE S
SET AI1.ITEM_ORDER = 5
WHERE AI2.UUID = '85372e2e-ffe0-48ff-a758-1017a11c797f'
AND   AI2.ID_INTERNAL = AI1.KEY_FUNCTIONALITY
AND   AI1.KEY_SITE = S.ID_INTERNAL
AND   S.SITE_TYPE = 'net.sourceforge.fenixedu.domain.DepartmentSite';
