Index: openacs-4/packages/dotlrn/sql/postgresql/dotlrn-classes-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/postgresql/Attic/dotlrn-classes-create.sql,v
diff -u -N -r1.2 -r1.3
--- openacs-4/packages/dotlrn/sql/postgresql/dotlrn-classes-create.sql	29 Mar 2002 19:14:44 -0000	1.2
+++ openacs-4/packages/dotlrn/sql/postgresql/dotlrn-classes-create.sql	2 Jul 2002 18:40:08 -0000	1.3
@@ -23,6 +23,7 @@
 --
 -- @author Ben Adida (ben@openforce.net)
 -- @author yon (yon@openforce.net)
+-- @author dan chak (chak@openforce.net)
 -- @creation-date 2001-08-18
 -- @version $Id$
 --
@@ -33,7 +34,7 @@
                                 references dotlrn_community_types (community_type)
                                 constraint dotlrn_departments_pk
                                 primary key,
-    external_url                varchar(250)
+    external_url                varchar(4000)
 );
 
 create view dotlrn_departments_full
@@ -72,11 +73,13 @@
 );
 
 create table dotlrn_classes (
-    class_key                   varchar(100) constraint dotlrn_classes_class_key_fk
+    class_key                   varchar(100) 
+				constraint dotlrn_classes_class_key_fk
                                 references dotlrn_community_types (community_type)
                                 constraint dotlrn_classes_pk
                                 primary key,
-    department_key              varchar(100) constraint dotlrn_classes_dept_key_fk
+    department_key              varchar(100) 
+				constraint dotlrn_classes_dept_key_fk
                                 references dotlrn_departments (department_key)
                                 constraint dotlrn_classes_dept_key_nn
                                 not null
@@ -98,15 +101,18 @@
     where dotlrn_classes.class_key = dotlrn_community_types.community_type;
 
 create table dotlrn_class_instances (
-    class_instance_id           integer constraint dotlrn_ci_class_instance_id_fk
+    class_instance_id           integer 
+				constraint dotlrn_ci_class_instance_id_fk
                                 references dotlrn_communities (community_id)
                                 constraint dotlrn_class_instances_pk
                                 primary key,
-    class_key                   varchar(100) constraint dotlrn_ci_class_key_fk
+    class_key                   varchar(100) 
+				constraint dotlrn_ci_class_key_fk
                                 references dotlrn_classes (class_key)
                                 constraint dotlrn_ci_class_key_nn
                                 not null,
-    term_id                     integer constraint dotlrn_ci_term_id_fk
+    term_id                     integer
+				constraint dotlrn_ci_term_id_fk
                                 references dotlrn_terms (term_id)
                                 constraint dotlrn_ci_term_id_nn
                                 not null
@@ -121,15 +127,7 @@
            dotlrn_terms.term_year,
            dotlrn_terms.start_date,
            dotlrn_terms.end_date,
-           dotlrn_communities.community_type,
-           dotlrn_communities.community_key,
-           dotlrn_communities.pretty_name,
-           dotlrn_communities.description,
-           dotlrn_communities.active_start_date,
-           dotlrn_communities.active_end_date,
-           dotlrn_communities.portal_id,
-           dotlrn_communities.portal_template_id,
-           dotlrn_communities.package_id,
+           dotlrn_communities.*
            dotlrn_community__url(dotlrn_communities.community_id) as url,
            dotlrn_classes_full.pretty_name as class_name,
            dotlrn_classes_full.url as class_url,
@@ -170,15 +168,15 @@
 create function dotlrn_department__new(varchar,varchar,varchar,varchar,integer,timestamp,integer,varchar,integer)
 returns varchar as '
 DECLARE
-        p_department_key                        alias for $1;
-        p_pretty_name                                alias for $2;
-        p_pretty_plural                                alias for $3;
-        p_description                                alias for $4;
-        p_package_id                                alias for $5;
-        p_creation_date                                alias for $6;
-        p_creation_user                                alias for $7;
-        p_creation_ip                                alias for $8;
-        p_context_id                                alias for $9;
+        p_department_key                    alias for $1;
+        p_pretty_name                       alias for $2;
+        p_pretty_plural                     alias for $3;
+        p_description                       alias for $4;
+        p_package_id                        alias for $5;
+        p_creation_date                     alias for $6;
+        p_creation_user                     alias for $7;
+        p_creation_ip                       alias for $8;
+        p_context_id                        alias for $9;
         v_department_key dotlrn_departments.department_key%TYPE;
 BEGIN
         v_department_key := dotlrn_community_type__new (
@@ -226,16 +224,16 @@
 create function dotlrn_class__new(varchar,varchar,varchar,varchar,varchar,integer,timestamp,integer,varchar,integer)
 returns varchar as '
 DECLARE
-        p_class_key                        alias for $1;
+        p_class_key                     alias for $1;
         p_department_key                alias for $2;
-        p_pretty_name                        alias for $3;
-        p_pretty_plural                        alias for $4;
-        p_description                        alias for $5;
-        p_package_id                        alias for $6;
-        p_creation_date                        alias for $7;
-        p_creation_user                        alias for $8;
-        p_creation_ip                        alias for $9;
-        p_context_id                        alias for $10;
+        p_pretty_name                   alias for $3;
+        p_pretty_plural                 alias for $4;
+        p_description                   alias for $5;
+        p_package_id                    alias for $6;
+        p_creation_date                 alias for $7;
+        p_creation_user                 alias for $8;
+        p_creation_ip                   alias for $9;
+        p_context_id                    alias for $10;
         v_class_key dotlrn_classes.class_key%TYPE;
 BEGIN
         v_class_key := dotlrn_community_type__new (
@@ -276,7 +274,7 @@
 
 
 
-select define_function_args('dotlrn_class_instance__new','class_instance_id,class_key,term_id,community_key,pretty_name,description,package_id,portal_id,portal_template_id,join_policy,creation_date,creation_user,creation_ip,context_id');
+select define_function_args('dotlrn_class_instance__new','class_instance_id,class_key,term_id,community_key,pretty_name,description,package_id,portal_id,non_member_portal_id,join_policy,creation_date,creation_user,creation_ip,context_id');
 
 select define_function_args('dotlrn_class_instance__delete','class_instance_id');
 
@@ -292,7 +290,7 @@
         p_description                                alias for $6;
         p_package_id                                alias for $7;
         p_portal_id                                alias for $8;
-        p_portal_template_id                        alias for $9;
+        p_non_member_portal_id                        alias for $9;
         p_join_policy                                alias for $10;
         p_creation_date                                alias for $11;
         p_creation_user                                alias for $12;
@@ -308,7 +306,7 @@
             p_description,
             p_package_id,
             p_portal_id,
-            p_portal_template_id,
+            p_non_member_portal_id,
             p_join_policy,
             p_creation_date,
             p_creation_user,
