Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql	26 Jan 2004 15:39:45 -0000	1.4
+++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql	17 May 2004 15:14:47 -0000	1.5
@@ -772,7 +772,7 @@
 
 ---- DRB: fixes bug 1144
 
-drop view registered_users;
+drop view registered_users CASCADE;
 create view registered_users
 as
   select p.email, p.url, pe.first_names, pe.last_name, u.*, mr.member_state
@@ -788,8 +788,13 @@
   and mr.member_state = 'approved'
   and u.email_verified_p = 't';
 
+create view registered_users_of_package_id
+as
+SELECT u.*, au.package_id
+FROM application_users au, registered_users u
+WHERE (au.user_id = u.user_id);
 
-drop view cc_users;
+drop view cc_users CASCADE;
 create view cc_users
 as
 select o.*, pa.*, pe.*, u.*, mr.member_state, mr.rel_id
@@ -804,6 +809,12 @@
   and m.container_id = m.group_id
   and m.rel_type = 'membership_rel';
 
+create view cc_users_of_package_id
+as
+SELECT u.*, au.package_id
+FROM application_users au, cc_users u
+WHERE (au.user_id = u.user_id);
+
 drop function acs__add_user(int4,varchar,timestamptz,int4,varchar,varchar,varchar,varchar,varchar,bpchar,bpchar,varchar,varchar,varchar,bool,varchar);
 
 create or replace function acs__add_user (
