Index: openacs-4/packages/download/sql/oracle/download-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/sql/oracle/download-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/download/sql/oracle/download-create.sql 14 May 2001 20:30:23 -0000 1.2 +++ openacs-4/packages/download/sql/oracle/download-create.sql 23 May 2001 18:44:13 -0000 1.3 @@ -20,7 +20,8 @@ repository_id integer constraint download_repository_id_fk references cr_items (item_id) on delete cascade - constraint download_repository_id_pk primary key + constraint download_repository_id_pk + primary key ); begin @@ -50,8 +51,10 @@ create sequence download_archive_type_sequence; create table download_archive_types ( archive_type_id integer - constraint download_archive_types_pk primary key, - repository_id constraint download_archive_rep_id_fk references download_repository (repository_id), + constraint download_archive_types_pk + primary key, + repository_id constraint download_archive_rep_id_fk + references download_repository (repository_id), pretty_name varchar(100) not null, description varchar(500) not null -- unique (repository_id, short_name) constraint download_archive_types_shrt_name_un unique @@ -64,9 +67,11 @@ create sequence download_reasons_sequence; create table download_reasons ( download_reason_id integer - constraint download_archive_reasons_pk primary key, - repository_id constraint download_reason_id_fk references download_repository (repository_id) , - reason varchar(500) not null + constraint download_archive_reasons_pk + primary key, + repository_id constraint download_reason_id_fk + references download_repository (repository_id) , + reason varchar(500) not null -- unique (repository_id, reason) constraint download_reason_un unique ); @@ -85,12 +90,14 @@ -- create table download_archive_metadata ( metadata_id integer - constraint download_ma_pk primary key, + constraint download_ma_pk + primary key, repository_id constraint download_ma_rep_id_fk references download_repository (repository_id), --if archive_type_id is null, applies to all archive types archive_type_id integer - constraint download_ma_type_fk references download_archive_types, + constraint download_ma_type_fk + references download_archive_types, sort_key integer constraint download_ma_sort_key_nn not null, @@ -99,17 +106,21 @@ constraint download_data_type_ck check (data_type in ('text', 'shorttext', 'boolean', 'number', 'integer', 'date', 'choice')), required_p varchar(1) - constraint download_ma_required_p_ck check(required_p in ('t','f')), + constraint download_ma_required_p_ck + check(required_p in ('t','f')), --linked_p indicates whether we should have links to show all --archives with a particular link linked_p varchar(1) - constraint download_ma_linked_p_ck check(linked_p in ('t','f')), + constraint download_ma_linked_p_ck + check(linked_p in ('t','f')), --is this field shown on the main page? mainpage_p varchar(1) - constraint download_ma_mainpage_p_ck check(mainpage_p in ('t','f')), + constraint download_ma_mainpage_p_ck + check(mainpage_p in ('t','f')), --is this field computed, or should we ask the user to enter it? computed_p varchar(1) - constraint download_ma_computed_p_ck check(computed_p in ('t','f')) + constraint download_ma_computed_p_ck + check(computed_p in ('t','f')) ); --When a piece of metadata has a fixed set of responses Index: openacs-4/packages/download/sql/oracle/download-drop.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/sql/oracle/download-drop.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/download/sql/oracle/download-drop.sql 14 May 2001 20:30:23 -0000 1.3 +++ openacs-4/packages/download/sql/oracle/download-drop.sql 23 May 2001 18:44:13 -0000 1.4 @@ -2,6 +2,10 @@ -- Drop the data model and the PL/SQL packages. -- +-- delete the archives +delete from download_archives; +delete from download_archive_types; + /* Drop all content items */ begin for archive_rec in (select item_id from cr_items where content_type = 'cr_download_archive_desc') @@ -10,6 +14,7 @@ end loop; end; / +show errors begin for archive_rec in (select item_id from cr_items where content_type = 'cr_download_archive') @@ -18,6 +23,7 @@ end loop; end; / +show errors begin for archive_rec in (select item_id from cr_items where content_type = 'cr_download_rep') @@ -26,6 +32,7 @@ end loop; end; / +show errors /* Sequences */ drop sequence download_archive_type_sequence; @@ -42,15 +49,18 @@ drop table download_downloads; drop table download_revision_data; drop table download_archive_revisions; -drop table download_archives; drop table download_metadata_choices; drop table download_archive_metadata; drop table download_reasons; -drop table download_archive_types; -drop table download_repository; -drop table download_archive_descs; -/* acs_object_type */ +-- shouldn't drop these tables. +-- they're dropped when we drop the content types below + +--drop table download_repository; +--drop table download_archive_descs; +--drop table download_archives; + +--unregister the content_types begin content_type.unregister_child_type( parent_type => 'cr_download_rep', @@ -65,36 +75,35 @@ ); end; / - ---fixme VK drop the content_types, not the acs type directly - -begin - acs_object_type.drop_type( - object_type => 'cr_download_archive_desc', - cascade_p => 't' - ); -end; -/ show errors begin - acs_object_type.drop_type( - object_type => 'cr_download_rep', - cascade_p => 't' - ); + content_type.drop_type ( + content_type => 'cr_download_archive_desc', + drop_children_p => 't', + drop_table_p => 't' + ); + + content_type.drop_type ( + content_type => 'cr_download_archive', + drop_children_p => 't', + drop_table_p => 't' + ); end; / show errors -begin - acs_object_type.drop_type( - object_type => 'cr_download_archive', - cascade_p => 't' - ); +-- need to drop this table here +drop table download_archive_types; +begin + content_type.drop_type ( + content_type => 'cr_download_rep', + drop_children_p => 't', + drop_table_p => 't' + ); end; / show errors - -drop package download_rep; \ No newline at end of file +drop package download_rep;