Index: openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-create.sql,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-create.sql 27 Jul 2003 00:46:16 -0000 1.3 +++ openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-create.sql 30 Jul 2003 04:56:41 -0000 1.4 @@ -14,19 +14,21 @@ not null constraint cr_ca_attributes_pk primary key, - package_id integer - constraint ca_attributes_package_id_fk - references acs_objects, - sitewide_p char(1) - default 'f' - constraint ca_attributes_sitewide_p_nn - not null - constraint ca_attributes_sitewide_p_ck - check (sitewide_p in ('t','f')), - constraint ca_attributes_un - unique(attribute_id,package_id) + -- + -- RBM: We have keyword_id here so we can have per-category + -- custom fields. Selling books requires ISBN, but motorcycles + -- requires something else. + -- + keyword_id integer + constraint ca_attributes_keyword_id_nn + not null + constraint ca_attributes_keyword_id_fk + references cr_keywords(keyword_id), + constraint ca_attributes_un unique(attribute_id, keyword_id) ); +CREATE INDEX ca_attributes_keyword_id_idx +ON ca_attributes( keyword_id ); create table ca_attribute_values ( object_id integer