Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.4.0d3-5.4.0d4.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.4.0d3-5.4.0d4.sql,v
diff -u -r1.1 -r1.1.2.1
--- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.4.0d3-5.4.0d4.sql	27 Oct 2007 22:10:59 -0000	1.1
+++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.4.0d3-5.4.0d4.sql	2 Feb 2008 14:19:06 -0000	1.1.2.1
@@ -1 +1,15 @@
+-- checking if the privilege annotate is created, if not then just create it
+
+create or replace function inline_0() returns integer as '
+
+begin
+    if (select count(*) from acs_privileges where privilege = ''annotate'') < 1 then
+         perform acs_privilege__create_privilege(''annotate'', null, null);
+    end if;
+    return null;
+end;' language 'plpgsql';
+
+select inline_0();
+drop function inline_0();
+
 select acs_privilege__add_child('admin', 'annotate');
