Index: openacs-4/packages/new-portal/sql/oracle/portal-core-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/new-portal/sql/oracle/portal-core-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/new-portal/sql/oracle/portal-core-create.sql 28 Sep 2001 00:26:52 -0000 1.3 +++ openacs-4/packages/new-portal/sql/oracle/portal-core-create.sql 28 Sep 2001 02:00:54 -0000 1.4 @@ -3,7 +3,7 @@ -- distributed under the GNU GPL v2 -- -- arjun@openforce.net --- started Sept. 26, 2001 +-- $Id$ -- **** DATASOURCES **** @@ -13,11 +13,14 @@ pretty_name varchar(200) ); --- Hmm. we might want an extra layer of security here. +-- secure_p is for an extra layer of security. See defualts.sql create table portal_data_types ( name varchar(200) constraint p_data_types_name_pk primary key, - pretty_name varchar(200) + pretty_name varchar(200), + secure_p char(1) default 'f' + constraint p_data_types_secure_p_ck + check(secure_p in ('t', 'f')) ); @@ -35,7 +38,7 @@ data_type constraint p_datasources_data_type_fk references portal_data_types(name) not null, - mime_type constraint p_datasources_mimetype_fk + mime_type constraint p_datasources_mime_type_fk references portal_mime_types(name) not null, -- lame flag until real metadata arrives @@ -73,7 +76,6 @@ -- Layouts are the template for the portal page. i.e. 2 cols, 3 cols, -- etc. They are globally available. No secret layouts! --- Considering db storage. create table portal_layouts ( layout_id constraint p_layouts_layout_id_fk references acs_objects(object_id) @@ -93,8 +95,8 @@ references portal_layouts on delete cascade not null, - region varchar(20), - immutable_p char(1) + region varchar(20) not null, + immutable_p char(1) not null constraint p_spprtd_rgns_immtble_p_ck check(immutable_p in ('t', 'f')), constraint p_spprtd_rgns_tmpl_id_rgn_pk primary key (template_id,region) @@ -104,8 +106,7 @@ -- **** Portal Element Themes **** -- Themes are templates with decoration for PEs, nothing more. --- At this point they will just be bits of ADPs stuffed into the DB or in --- the filesystem +-- At this point they will just be bits of ADPs in the filesystem create table portal_element_themes ( theme_id constraint p_e_themes_theme_id_fk references acs_objects(object_id) @@ -116,10 +117,6 @@ unique not null, description varchar(4000), --- storage varchar(20) --- constraint p_e_themes_type_ck --- check(storage in ('db', 'fs')), --- db_storage varchar(4000) filename varchar(4000), resource_dir varchar(4000) ); @@ -137,11 +134,6 @@ -- No securtiy checks are done here. If you can view and bind to a DS you have -- a PE for it. - --- XXX constraints --- unique(element_id, portal_id) --- PE name uniqueness (per-portal) - create table portal_element_map ( element_id constraint p_element_map_element_id_pk primary key, @@ -158,10 +150,14 @@ not null, region varchar(20) not null, sort_key integer not null, - constraint p_element_map_pid_rgn_srt_un unique(portal_id,region,sort_key) + -- Two elements may not exist in the same place on a portal. + constraint p_element_map_pid_rgn_srt_un + unique(portal_id,region,sort_key) + -- Two elements may not have the same name on a portal. + constraint p_element_map_pid_rgn_srt_un + unique(portal_id,name) ); - create table portal_element_parameters ( parameter_id integer constraint p_element_prms_prm_id_pk @@ -176,7 +172,7 @@ -- Portals are essentially "containers" for PEs that bind to DSs. -- XXX Can parties have portals? Restrict to party check? --- Roles and perms issues? +-- Roles and perms issues? package_id? create table portals ( portal_id constraint p_portal_id_fk references acs_objects(object_id) @@ -189,9 +185,5 @@ owner_id constraint p_owner_id_fk references persons(person_id) on delete cascade, - constraint p_owner_package_un unique(package_id,owner_id) ); --- INDEX owner_id --- INDEX package_id -