SELECT @key_content:=ID_INTERNAL FROM CONTENT WHERE NAME = 'pt11:Planeamento' AND OJB_CONCRETE_CLASS = 'net.sourceforge.fenixedu.domain.Section';

INSERT INTO AVAILABILITY_POLICY(KEY_ROOT_DOMAIN_OBJECT, EXPRESSION, TARGET_GROUP, OJB_CONCRETE_CLASS, KEY_CONTENT, CONTENT_ID, CREATION_ENTITY_DATE)
VALUES(1, 'role(SOFTPLANNING)', 'role(SOFTPLANNING)', 'net.sourceforge.fenixedu.domain.functionalities.ExpressionGroupAvailability', @key_content, UUID() ,CURDATE());

SELECT @key_policy:=ID_INTERNAL FROM AVAILABILITY_POLICY WHERE KEY_CONTENT = @key_content;

UPDATE CONTENT SET KEY_AVAILABILITY_POLICY = @key_policy WHERE ID_INTERNAL = @key_content;
