Index: openacs-4/packages/attachments/sql/postgresql/upgrade/upgrade-0.1d-0.2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/attachments/sql/postgresql/upgrade/upgrade-0.1d-0.2.sql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/attachments/sql/postgresql/upgrade/upgrade-0.1d-0.2.sql 30 Aug 2002 14:59:28 -0000 1.1 @@ -0,0 +1,40 @@ +-- +-- upgrade attachments to include approved_p column +-- +-- @author yon@openforce.net +-- @creation-date 2002-08-29 +-- @version $Id: upgrade-0.1d-0.2.sql,v 1.1 2002/08/30 14:59:28 arjun Exp $ +-- + +alter table attachments rename to attachments_old; + +drop index attachments_pk; + +create table attachments ( + object_id integer + constraint attachments_object_id_fk + references acs_objects(object_id) + on delete cascade, + item_id integer + constraint attachments_item_id_fk + references acs_objects(object_id) + on delete cascade, + approved_p char(1) + default 't' + constraint attachments_approved_p_ck + check (approved_p in ('t', 'f')) + constraint attachments_approved_p_nn + not null, + constraint attachments_pk + primary key (object_id, item_id) +); + +insert +into attachments +(object_id, item_id, approved_p) +select object_id, + item_id, + 't' +from attachments_old; + +drop table attachments_old;