--  SQL file representing changes to the functionalities model
--  Generated at Fri Jan 5 14:50:18 WET 2007
--  DO NOT EDIT THIS FILE, run the generating script instead

--  Preamble

START TRANSACTION;

-- 
--  Deleting functionalities
-- 

--  ID: 224 UUID: '2375facd-190c-49f0-a011-9350502e6e54'
DELETE FROM ap USING `AVAILABILITY_POLICY` AS ap, `ACCESSIBLE_ITEM` AS f WHERE ap.`KEY_ACCESSIBLE_ITEM` = f.`ID_INTERNAL` AND f.`UUID` = '2375facd-190c-49f0-a011-9350502e6e54';
DELETE FROM `ACCESSIBLE_ITEM` WHERE `UUID` = '2375facd-190c-49f0-a011-9350502e6e54';

-- 
--  Updating existing functionalities
-- 

--  ID: 217 UUID: '63bb3ae4-d1a0-4fc7-be16-ae25918a8831'
DELETE FROM ap USING `AVAILABILITY_POLICY` AS ap, `ACCESSIBLE_ITEM` AS f WHERE ap.`KEY_ACCESSIBLE_ITEM` = f.`ID_INTERNAL` AND f.`UUID` = '63bb3ae4-d1a0-4fc7-be16-ae25918a8831';
UPDATE `ACCESSIBLE_ITEM` AS own SET own.`KEY_AVAILABILITY_POLICY` = NULL, own.`NAME` = 'pt40:Secção de Pessoal Docente e Investigador' WHERE own.`UUID` = '63bb3ae4-d1a0-4fc7-be16-ae25918a8831';
INSERT INTO `AVAILABILITY_POLICY` (`OJB_CONCRETE_CLASS`, `KEY_ROOT_DOMAIN_OBJECT`, `KEY_ACCESSIBLE_ITEM`, `EXPRESSION`, `TARGET_GROUP`) SELECT 'net.sourceforge.fenixedu.domain.functionalities.ExpressionGroupAvailability', 1, `ID_INTERNAL`, 'role(CREDITS_MANAGER) || role(GRANT_OWNER_MANAGER)', 'role(CREDITS_MANAGER) || role(GRANT_OWNER_MANAGER)' FROM `ACCESSIBLE_ITEM` WHERE `UUID` = '63bb3ae4-d1a0-4fc7-be16-ae25918a8831';
UPDATE `ACCESSIBLE_ITEM` AS f, `AVAILABILITY_POLICY` AS ap SET f.`KEY_AVAILABILITY_POLICY` = ap.`ID_INTERNAL` WHERE f.`UUID` = '63bb3ae4-d1a0-4fc7-be16-ae25918a8831' AND ap.`KEY_ACCESSIBLE_ITEM` = f.`ID_INTERNAL`;

COMMIT;
