-- ----------------------------------
-- Table structure for messagez
-- ----------------------------------
CREATE TABLE IF NOT EXISTS messagez (
   msg_id int(10) NOT NULL AUTO_INCREMENT
 , msg_date decimal(20,0) NOT NULL default 0
 , msg_type decimal(1,0) default '0'
 , to_name varchar(45) default NULL
 , to_id varchar(48) default NULL
 , from_name varchar(45) default NULL
 , from_id varchar(48) default NULL
 , title text NOT NULL
 , message text NOT NULL
 , readflg decimal(1,0) default '0'
 , delflg decimal(1,0) default '0'
 , last_date decimal(20,0)
 , com_max int(4) default 0
 , PRIMARY KEY (msg_id)
 , INDEX to_id (to_id)
 , INDEX last_date (last_date)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

-- ----------------------------------
-- Table structure for commentz
-- ----------------------------------
CREATE TABLE IF NOT EXISTS commentz (
   msg_id int(10) NOT NULL
 , com_id int(4) NOT NULL AUTO_INCREMENT
 , msg_date decimal(20,0) NOT NULL
 , from_name varchar(45) NOT NULL
 , from_id varchar(48) NOT NULL
 , message text NOT NULL
 , delflg decimal(1,0) default '0'
 , PRIMARY KEY (msg_id, com_id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

/* see...
 * http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html
 * http://dev.mysql.com/doc/refman/4.1/ja/example-auto-increment.html
 */
