Index: openacs-4/packages/search/sql/oracle/search-tables-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/search/sql/oracle/search-tables-create.sql,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/search/sql/oracle/search-tables-create.sql 7 Jun 2005 19:58:15 -0000 1.4 +++ openacs-4/packages/search/sql/oracle/search-tables-create.sql 8 Nov 2005 18:24:06 -0000 1.5 @@ -30,21 +30,39 @@ constraint sws_index_fk references acs_objects(object_id) on delete cascade, object_name varchar(4000), indexed_content clob, - package_id integer --- TODO Dirk: bring back not null constraint --- constraint swi_package_id_nn --- not null - constraint swi_package_id_fk - references apm_packages - on delete cascade, - datastore char(1) not null, - event_date date - default sysdate, - event varchar(6) - constraint site_wide_index_event_ck - check (event in ('INSERT','DELETE','UPDATE')) + -- Dirk Gomez: no not null constraint because we also want to + -- be able to index objects which are not tied to an object, + -- in particular people. + package_id integer + constraint swi_package_id_fk + references apm_packages + on delete cascade, + -- Dirk Gomez: This is a .LRNism. It looks like .LRN has not + -- only object-granular permiissions, but also + -- community-granular ones. In search we need not only check + -- whether a user has the right to view this object, but also + -- its community. In pure OpenACS this should always be a + -- null column and it should have no referential integrity. + community_id integer + constraint swi_community_id_fk + references dotlrn_communities_all + on delete cascade, + -- Dirk Gomez: That's the place to put an object's relevant + -- date which is part of the ranking function. In calendar + -- this is the item date, in forum it could be the last reply + -- date to a thread etc. + relevant_date date ); +create table search_observer_queue ( + object_id integer, + event_date date + default sysdate, + event varchar(6) + constraint search_observer_queue_event_ck + check (event in ('INSERT','DELETE','UPDATE')) +); + -- Intermedia sometimes is painful to debug, so I added a logging -- mechanism which relies on Oracle's autonomous transactions: DML -- statements are committed immediately so you can access this data