Index: openacs-4/packages/acs-kernel/acs-kernel.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/acs-kernel.info,v
diff -u -N -r1.69 -r1.70
--- openacs-4/packages/acs-kernel/acs-kernel.info 24 Jul 2004 14:44:54 -0000 1.69
+++ openacs-4/packages/acs-kernel/acs-kernel.info 26 Jul 2004 12:21:39 -0000 1.70
@@ -7,15 +7,15 @@
t
t
-
+
Don Baccus
Routines and data models providing the foundation for OpenACS-based Web services.
2004-04-18
GPL
3
OpenACS
The OpenACS kernel contains the core datamodel create and drop scripts for such things as objects, groups, partiies and the supporting PL/SQL and PL/pgSQL procedures.
-
+
2
Index: openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql,v
diff -u -N -r1.17 -r1.18
--- openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql 12 Mar 2004 18:48:49 -0000 1.17
+++ openacs-4/packages/acs-kernel/sql/oracle/acs-objects-create.sql 26 Jul 2004 12:21:39 -0000 1.18
@@ -175,11 +175,16 @@
before update on acs_objects
for each row
begin
- :new.last_modified := sysdate;
+ if :new.last_modified is null then
+ :new.last_modified := :old.last_modified;
+ elsif :new.last_modified = :old.last_modified then
+ :new.last_modified := sysdate;
+ end if;
end acs_objects_last_mod_update_tr;
/
show errors
+
comment on table acs_objects is '
';
Index: openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.2.0d6-5.2.0d7.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.2.0d6-5.2.0d7.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-kernel/sql/oracle/upgrade/upgrade-5.2.0d6-5.2.0d7.sql 26 Jul 2004 12:21:40 -0000 1.1
@@ -0,0 +1,15 @@
+-- Change the trigger so if last_modified is null on the update the old modified date is
+-- preserved.
+
+create or replace trigger acs_objects_last_mod_update_tr
+before update on acs_objects
+for each row
+begin
+ if :new.last_modified is null then
+ :new.last_modified := :old.last_modified;
+ elsif :new.last_modified = :old.last_modified then
+ :new.last_modified := sysdate;
+ end if;
+end acs_objects_last_mod_update_tr;
+/
+show errors
Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql,v
diff -u -N -r1.51 -r1.52
--- openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql 18 Jun 2004 18:21:57 -0000 1.51
+++ openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql 26 Jul 2004 12:21:40 -0000 1.52
@@ -257,10 +257,12 @@
create function acs_objects_last_mod_update_tr () returns opaque as '
begin
- new.last_modified := now();
-
+ if new.last_modified is null then
+ new.last_modified := old.last_modified;
+ elsif new.last_modified = old.last_modified then
+ new.last_modified := now();
+ end if;
return new;
-
end;' language 'plpgsql';
create trigger acs_objects_last_mod_update_tr before update on acs_objects
Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.2.0d6-5.2.0d7.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.2.0d6-5.2.0d7.sql,v
diff -u -N
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.2.0d6-5.2.0d7.sql 26 Jul 2004 12:21:41 -0000 1.1
@@ -0,0 +1,17 @@
+-- Change the trigger so if last_modified is null on the update the old modified date is
+-- preserved.
+
+drop function acs_objects_last_mod_update_tr() cascade;
+
+create function acs_objects_last_mod_update_tr () returns opaque as '
+begin
+ if new.last_modified is null then
+ new.last_modified := old.last_modified;
+ elsif new.last_modified = old.last_modified then
+ new.last_modified := now();
+ end if;
+ return new;
+end;' language 'plpgsql';
+
+create trigger acs_objects_last_mod_update_tr before update on acs_objects
+for each row execute procedure acs_objects_last_mod_update_tr ();