Index: openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql	9 Aug 2002 18:39:24 -0000	1.4
+++ openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql	8 Aug 2006 21:26:21 -0000	1.5
@@ -72,3 +72,31 @@
     from dotlrn_member_rels_full,
          dotlrn_admin_rels
     where dotlrn_member_rels_full.rel_id = dotlrn_admin_rels.rel_id;
+
+-- Store emails to be sent when user joins a community
+create table dotlrn_member_emails (
+        email_id	integer primary key,
+        community_id    integer references dotlrn_communities_all (community_id)
+                        on delete cascade,
+-- Might be useful
+        type            varchar2(30) default 'on join',
+        from_addr       varchar2(256),
+        subject         varchar2(4000),
+        email           long,
+        enabled_p       char(1) default 'f'
+	                check (enabled_p in ('t', 'f')),
+			constraint dotlrn_member_emails_un unique(community_id, type)
+);
+
+create sequence dotlrn_member_emails_seq
+start with 1
+increment by 1
+nomaxvalue;
+
+create trigger dotlrn_member_emails_trigger
+before insert on dotlrn_member_emails
+for each row
+begin
+	select dotlrn_member_emails_seq.nextval into :new.email_id from dual;
+end;
+/
