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.12.1 -r1.4.12.2
--- openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql	31 May 2005 23:13:03 -0000	1.4.12.1
+++ openacs-4/packages/dotlrn/sql/oracle/community-memberships-create.sql	22 Jul 2005 14:50:48 -0000	1.4.12.2
@@ -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;
\ No newline at end of file
