
diff -r eb92dc5d9fb4 -r e2f6e3af9959 database.sql
--- a/database.sql	Sat Nov 15 14:59:51 2008 -0500
+++ b/database.sql	Sat Nov 15 15:00:52 2008 -0500
@@ -17,3 +17,47 @@
   PRIMARY KEY  (id)
 );
 
+--
+-- NEW - Late October '08 modifications
+--
+
+CREATE TABLE stats_messages (
+  message_id int(21) NOT NULL auto_increment,
+  channel varchar(30) NOT NULL DEFAULT '',
+  nick varchar(40) NOT NULL DEFAULT '',
+  time int(11) NOT NULL DEFAULT 0,
+  PRIMARY KEY ( message_id )
+);
+
+CREATE TABLE stats_anon (
+  nick varchar(40) NOT NULL DEFAULT '',
+  PRIMARY KEY ( nick )
+);
+
+CREATE TABLE stats_count_cache (
+  cache_id int(21) NOT NULL auto_increment,
+  channel varchar(30) NOT NULL DEFAULT '',
+  time_min int(11) NOT NULL DEFAULT 0,
+  time_max int(11) NOT NULL DEFAULT 0,
+  message_count int(11) NOT NULL DEFAULT 0,
+  PRIMARY KEY ( cache_id )
+);
+
+--
+-- ADDED November 15 2008
+--
+
+CREATE TABLE ip_log (
+  entry_id int(21) NOT NULL auto_increment,
+  nick varchar(40) NOT NULL,
+  basenick varchar(40) NOT NULL,
+  ip varchar(39) NOT NULL,
+  hostname varchar(80) NOT NULL,
+  channel varchar(20) NOT NULL,
+  time int(12) unsigned NOT NULL DEFAULT 0,
+  PRIMARY KEY ( entry_id )
+);
+
+-- Also added Nov. 15 (this DRAMATICALLY speeds things up)
+CREATE INDEX stats_time_idx USING BTREE ON stats_messages (time);
+




