Index: openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-package-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-package-create.sql,v
diff -u -r1.3 -r1.4
--- openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-package-create.sql	27 Jul 2003 00:46:16 -0000	1.3
+++ openacs-4/contrib/packages/classified-ads/sql/postgresql/attributes-package-create.sql	30 Jul 2003 04:56:41 -0000	1.4
@@ -5,7 +5,7 @@
 -- @cvs-id $Id$
 --
 
-select define_function_args('ca_attributes__create_attribute','content_type,attribute_name,datatype,pretty_name,pretty_plural,sort_order,default_value,storage,table_name,column_spec,package_id');
+select define_function_args('ca_attributes__create_attribute','content_type,attribute_name,datatype,pretty_name,pretty_plural,sort_order,default_value,storage,table_name,column_spec,keyword_id');
 
 create or replace function ca_attributes__create_attribute (varchar,varchar,varchar,varchar,varchar,integer,varchar,varchar,varchar,varchar,integer)
 returns integer as '
@@ -20,7 +20,7 @@
     p_storage                       alias for $8;
     p_table_name                    alias for $9;
     p_column_spec                   alias for $10;
-    p_package_id                    alias for $11;
+    p_keyword_id                    alias for $11;
     v_attribute_id                  acs_attributes.attribute_id%TYPE;
     v_sort_order                    acs_attributes.sort_order%TYPE;
     v_sitewide_p                    ca_attributes.sitewide_p%TYPE;
@@ -119,18 +119,12 @@
     end if; end if;
 
 -- insert the attribute_id into our own table for purposes
--- of tracking the package_id
+-- of tracking the keyword_id
 
-    if p_package_id is null then
-        v_sitewide_p := ''t'';
-    else
-        v_sitewide_p := ''f'';
-    end if;
-
     insert into ca_attributes
-        (attribute_id, package_id, sitewide_p)
+        (attribute_id, keyword_id)
     values
-        (v_attribute_id, p_package_id, v_sitewide_p);
+        (v_attribute_id, p_keyword_id);
 
     return v_attribute_id;
 end;
@@ -184,31 +178,30 @@
 ' language 'plpgsql';
 
 
-select define_function_args('ca_attributes__register_widget','attribute_id,widget,label,keyword_id,html_options,extra_options,select_options,validate,optional_p,enabled_p');
+select define_function_args('ca_attributes__register_widget','attribute_id,widget,label,html_options,extra_options,select_options,validate,optional_p,enabled_p');
 
-create or replace function ca_attributes__register_widget (integer,varchar,varchar,integer,varchar,text,varchar,varchar,char,char)
+create or replace function ca_attributes__register_widget (integer,varchar,varchar,varchar,text,varchar,varchar,char,char)
 returns integer as '
 declare
     p_attribute_id                  alias for $1;
     p_widget                        alias for $2;
     p_label                         alias for $3;
-    p_keyword_id                    alias for $4;
-    p_html_options                  alias for $5;
-    p_extra_options                 alias for $6;
-    p_select_options                alias for $7;
-    p_validate                      alias for $8;
-    p_optional_p                    alias for $9;
-    p_enabled_p                     alias for $10;
+    p_html_options                  alias for $4;
+    p_extra_options                 alias for $5;
+    p_select_options                alias for $6;
+    p_validate                      alias for $7;
+    p_optional_p                    alias for $8;
+    p_enabled_p                     alias for $9;
 begin
 
     -- DEDS: FIXME - check for options when inserting something that does not support it
     --  RBM: 07/2003 - What does the above mean? 
      
     insert into ca_attribute_widget_values
-        ( attribute_id, widget, label, keyword_id, html_options, extra_options, 
+        ( attribute_id, widget, label, html_options, extra_options, 
 	  select_options, validate, optional_p, enabled_p )
     values
-        ( p_attribute_id, p_widget, p_label, p_keyword_id, p_html_options, p_extra_options,
+        ( p_attribute_id, p_widget, p_label, p_html_options, p_extra_options,
 	  p_select_options, p_validate, p_optional_p, p_enabled_p );
 
     return null;
