head	1.1;
access;
symbols
	TIGRIS_1_1_0RC2:1.1
	TIGRIS_1_1_0RC1:1.1
	TIGRIS_1_1:1.1.0.4
	TIGRIS_1_0_8:1.1
	TIGRIS_1_0_8RC3:1.1
	TIGRIS_1_0_8RC2:1.1
	TIGRIS_1_0_8RC1:1.1
	TIGRIS_1_0_7:1.1
	TIGRIS_1_0_7RC3:1.1
	TIGRIS_1_0_7RC2:1.1
	TIGRIS_1_0_7RC1:1.1
	TIGRIS_1_0_6:1.1
	TIGRIS_1_0_6RC5:1.1
	TIGRIS_1_0_6RC4:1.1
	TIGRIS_1_0_6RC3:1.1
	TIGRIS_1_0_6RC2:1.1
	TIGRIS_1_0_6RC1:1.1
	TIGRIS_1_0_5:1.1
	TIGRIS_1_0_5RC6:1.1
	TIGRIS_1_0_5RC5:1.1
	TIGRIS_1_0_5RC4:1.1
	TIGRIS_1_0_5RC3:1.1
	TIGRIS_1_0_5RC2:1.1
	TIGRIS_1_0_5RC1:1.1
	TIGRIS_1_0_4:1.1
	TIGRIS_1_0_3:1.1
	TIGRIS_1_0_2:1.1
	TIGRIS_1_0_1:1.1
	TIGRIS_1_0:1.1.0.6
	TIGRIS_1_0_0:1.1
	TIGRIS_1_0_0_RC1:1.1.0.2;
locks; strict;
comment	@# @;


1.1
date	2001.03.17.23.28.31;	author edk;	state Exp;
branches;
next	;


desc
@@


1.1
log
@this is needed, it seems; we could get it from eb, but we know 1.0.0
works with this specific version of eb's schema
@
text
@
CREATE TABLE eb_List (
       listId               INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
       listName             VARCHAR(80) NOT NULL, 
       listDescr            VARCHAR(80),

       indexed              BIT NOT NULL DEFAULT 0, 
       indexFile            CHAR(255), 
       lastMsgIndexed       INTEGER NOT NULL DEFAULT 0, 
       UNIQUE INDEX(listName)
);

CREATE TABLE eb_ListFile (
       fileId               INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
       listId               INTEGER NOT NULL,
       filePath             CHAR(255) NOT NULL,
       msgCount             INTEGER DEFAULT 0 NOT NULL,
       firstMsgNo           INTEGER NOT NULL,
       fileNo               INTEGER NOT NULL,
       fileSize             INTEGER DEFAULT 0 NOT NULL,
       isActive             BIT DEFAULT 0 NOT NULL, 
       UNIQUE INDEX(filePath)
);

CREATE TABLE eb_Subject (
       subjectId            INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
       listId               INTEGER NOT NULL,
       subjectText          VARCHAR(80) NOT NULL,
       INDEX (listId, subjectText(16))
);

CREATE TABLE eb_Thread (
       threadId             INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
       listId               INTEGER NOT NULL,
       firstMsg             INTEGER NOT NULL, 
       INDEX (listId, firstMsg)
);

CREATE TABLE eb_Author (
       authorId             INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
       listId               INTEGER NOT NULL,
       authorName           VARCHAR(80) NOT NULL, 
       INDEX (listId, authorName(16))
);

CREATE TABLE eb_Message (
       msgId                INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY,
       subjectId            INTEGER NOT NULL,
       authorId             INTEGER NOT NULL,
       listId               INTEGER NOT NULL,
       fileId               INTEGER NOT NULL,
       msgNo                INTEGER NOT NULL,
       byteOffset           INTEGER NOT NULL,
       byteLength           INTEGER NOT NULL,
       msgDate              DATE NOT NULL,
       threadId             INTEGER NOT NULL DEFAULT 0,
       parentMsgId          INTEGER NOT NULL DEFAULT 0,
       isReply              BIT DEFAULT 0,
       INDEX msgDate (listId, msgDate), 
       INDEX msgNo (listId, msgNo), 
       INDEX (threadId, msgNo), 
       INDEX (authorId), 
       INDEX (subjectId)
);

CREATE TABLE eb_MessageId (
       msgId                INTEGER NOT NULL,
       listId               INTEGER NOT NULL,
       messageIdString      VARCHAR(128) NOT NULL,
       INDEX (messageIdString(16))
);

CREATE TABLE eb_DateRange (
       dateRangeName        CHAR(20),
       fromDate             DATE,
       toDate               DATE
);

CREATE TABLE eb_DateSummaryCache (
       listId               INTEGER NOT NULL,
       dateRangeName        CHAR(20) NOT NULL, 
       count                INTEGER NOT NULL, 
       PRIMARY KEY (listId, dateRangeName));

INSERT INTO eb_DateRange VALUES 
       ( "ancient", "0000-01-01", "1994-12-31" ),
       ( "1995", "1995-01-01", "1995-12-31" ), 
       ( "1996", "1996-01-01", "1996-12-31" ), 
       ( "1997", "1997-01-01", "1997-12-31" ), 
       ( "1998", "1998-01-01", "1998-12-31" ), 
       ( "Jan 1999", "1999-01-01", SUBDATE("1999-02-01", INTERVAL 1 DAY) ), 
       ( "Feb 1999", "1999-02-01", SUBDATE("1999-03-01", INTERVAL 1 DAY) ), 
       ( "Mar 1999", "1999-03-01", SUBDATE("1999-04-01", INTERVAL 1 DAY) ), 
       ( "Apr 1999", "1999-04-01", SUBDATE("1999-05-01", INTERVAL 1 DAY) ), 
       ( "May 1999", "1999-05-01", SUBDATE("1999-06-01", INTERVAL 1 DAY) ), 
       ( "Jun 1999", "1999-06-01", SUBDATE("1999-07-01", INTERVAL 1 DAY) ), 
       ( "Jul 1999", "1999-07-01", SUBDATE("1999-08-01", INTERVAL 1 DAY) ), 
       ( "Aug 1999", "1999-08-01", SUBDATE("1999-09-01", INTERVAL 1 DAY) ), 
       ( "Sep 1999", "1999-09-01", SUBDATE("1999-10-01", INTERVAL 1 DAY) ), 
       ( "Oct 1999", "1999-10-01", SUBDATE("1999-11-01", INTERVAL 1 DAY) ), 
       ( "Nov 1999", "1999-11-01", SUBDATE("1999-12-01", INTERVAL 1 DAY) ), 
       ( "Dec 1999", "1999-12-01", "1999-12-31" ),
       ( "Jan 2000", "2000-01-01", SUBDATE("2000-02-01", INTERVAL 1 DAY) ), 
       ( "Feb 2000", "2000-02-01", SUBDATE("2000-03-01", INTERVAL 1 DAY) ), 
       ( "Mar 2000", "2000-03-01", SUBDATE("2000-04-01", INTERVAL 1 DAY) ), 
       ( "Apr 2000", "2000-04-01", SUBDATE("2000-05-01", INTERVAL 1 DAY) ), 
       ( "May 2000", "2000-05-01", SUBDATE("2000-06-01", INTERVAL 1 DAY) ), 
       ( "Jun 2000", "2000-06-01", SUBDATE("2000-07-01", INTERVAL 1 DAY) ), 
       ( "Jul 2000", "2000-07-01", SUBDATE("2000-08-01", INTERVAL 1 DAY) ), 
       ( "Aug 2000", "2000-08-01", SUBDATE("2000-09-01", INTERVAL 1 DAY) ), 
       ( "Sep 2000", "2000-09-01", SUBDATE("2000-10-01", INTERVAL 1 DAY) ), 
       ( "Oct 2000", "2000-10-01", SUBDATE("2000-11-01", INTERVAL 1 DAY) ), 
       ( "Nov 2000", "2000-11-01", SUBDATE("2000-12-01", INTERVAL 1 DAY) ), 
       ( "Dec 2000", "2000-12-01", "2000-12-31" ), 
       ( "Jan 2001", "2001-01-01", SUBDATE("2001-02-01", INTERVAL 1 DAY) ), 
       ( "Feb 2001", "2001-02-01", SUBDATE("2001-03-01", INTERVAL 1 DAY) ), 
       ( "Mar 2001", "2001-03-01", SUBDATE("2001-04-01", INTERVAL 1 DAY) ), 
       ( "Apr 2001", "2001-04-01", SUBDATE("2001-05-01", INTERVAL 1 DAY) ), 
       ( "May 2001", "2001-05-01", SUBDATE("2001-06-01", INTERVAL 1 DAY) ), 
       ( "Jun 2001", "2001-06-01", SUBDATE("2001-07-01", INTERVAL 1 DAY) ), 
       ( "Jul 2001", "2001-07-01", SUBDATE("2001-08-01", INTERVAL 1 DAY) ), 
       ( "Aug 2001", "2001-08-01", SUBDATE("2001-09-01", INTERVAL 1 DAY) ), 
       ( "Sep 2001", "2001-09-01", SUBDATE("2001-10-01", INTERVAL 1 DAY) ), 
       ( "Oct 2001", "2001-10-01", SUBDATE("2001-11-01", INTERVAL 1 DAY) ), 
       ( "Nov 2001", "2001-11-01", SUBDATE("2001-12-01", INTERVAL 1 DAY) ), 
       ( "Dec 2001", "2001-12-01", "2001-12-31" );



       
@
