database.sql
changeset 20 e2f6e3af9959
parent 0 d02690a8552c
equal deleted inserted replaced
19:eb92dc5d9fb4 20:e2f6e3af9959
    15   line text,
    15   line text,
    16   spam tinyint(1) default '0',
    16   spam tinyint(1) default '0',
    17   PRIMARY KEY  (id)
    17   PRIMARY KEY  (id)
    18 );
    18 );
    19 
    19 
       
    20 --
       
    21 -- NEW - Late October '08 modifications
       
    22 --
       
    23 
       
    24 CREATE TABLE stats_messages (
       
    25   message_id int(21) NOT NULL auto_increment,
       
    26   channel varchar(30) NOT NULL DEFAULT '',
       
    27   nick varchar(40) NOT NULL DEFAULT '',
       
    28   time int(11) NOT NULL DEFAULT 0,
       
    29   PRIMARY KEY ( message_id )
       
    30 );
       
    31 
       
    32 CREATE TABLE stats_anon (
       
    33   nick varchar(40) NOT NULL DEFAULT '',
       
    34   PRIMARY KEY ( nick )
       
    35 );
       
    36 
       
    37 CREATE TABLE stats_count_cache (
       
    38   cache_id int(21) NOT NULL auto_increment,
       
    39   channel varchar(30) NOT NULL DEFAULT '',
       
    40   time_min int(11) NOT NULL DEFAULT 0,
       
    41   time_max int(11) NOT NULL DEFAULT 0,
       
    42   message_count int(11) NOT NULL DEFAULT 0,
       
    43   PRIMARY KEY ( cache_id )
       
    44 );
       
    45 
       
    46 --
       
    47 -- ADDED November 15 2008
       
    48 --
       
    49 
       
    50 CREATE TABLE ip_log (
       
    51   entry_id int(21) NOT NULL auto_increment,
       
    52   nick varchar(40) NOT NULL,
       
    53   basenick varchar(40) NOT NULL,
       
    54   ip varchar(39) NOT NULL,
       
    55   hostname varchar(80) NOT NULL,
       
    56   channel varchar(20) NOT NULL,
       
    57   time int(12) unsigned NOT NULL DEFAULT 0,
       
    58   PRIMARY KEY ( entry_id )
       
    59 );
       
    60 
       
    61 -- Also added Nov. 15 (this DRAMATICALLY speeds things up)
       
    62 CREATE INDEX stats_time_idx USING BTREE ON stats_messages (time);
       
    63