Index: openacs-4/packages/acs-lang/sql/oracle/upgrade/upgrade-4.7d5-4.7d6.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/sql/oracle/upgrade/upgrade-4.7d5-4.7d6.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/acs-lang/sql/oracle/upgrade/upgrade-4.7d5-4.7d6.sql	13 Feb 2003 15:03:08 -0000	1.1
+++ openacs-4/packages/acs-lang/sql/oracle/upgrade/upgrade-4.7d5-4.7d6.sql	1 Oct 2003 10:48:48 -0000	1.2
@@ -1,5 +1,25 @@
--- We forgot to add the package_id column in the Oracle version of this
--- table
-alter table ad_locale_user_prefs add  package_id integer
-                                      constraint lang_package_l_u_package_id_fk
-                                      references apm_packages(package_id) on delete cascade;
+declare
+  v_table_exists_p integer;
+begin
+	select count(*) into v_table_exists_p 
+	from user_objects 
+        where object_name = 'AD_LOCALE_USER_PREFS';
+
+	if v_table_exists_p = 0 then
+                -- Need to create table
+                execute immediate 'create table ad_locale_user_prefs (
+                  user_id               integer
+                                        constraint ad_locale_user_prefs_users_fk
+                                        references users (user_id) on delete cascade,
+                  package_id            integer
+                                        constraint lang_package_l_u_package_id_fk
+                                        references apm_packages(package_id) on delete cascade,
+                  locale                varchar(30) not null
+                                        constraint trb_language_preference_lid_fk
+                                        references ad_locales (locale) on delete cascade
+                )';                              
+	end if;
+
+end;
+/
+show errors
