﻿CREATE TABLE `mail` (
  `id` int(11) NOT NULL auto_increment,
  `time` int(11) NOT NULL,
  `type` int (1) NOT NULL,
  `to_id` int(11) NOT NULL,
  `to_login` varchar(15) NOT NULL,
  `from_id` int(11) NOT NULL,
  `from_login` varchar(15) NOT NULL,
  `text` text NOT NULL,
  `read` int (1) NOT NULL,
  `del_to` int (1) NOT NULL,
  `del_from` int (1) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `time` (`time`),
  KEY `type` (`type`),
  KEY `to_id` (`to_id`),
  KEY `from_id` (`from_id`),
  KEY `read` (`read`),
  KEY `del_to` (`del_to`),
  KEY `del_from` (`del_from`)
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `mail_cont` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `cont_id` int(11) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `user_id` (`user_id`),
  KEY `cont_id` (`cont_id`)
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE `mail_ignor` (
  `id` int(11) NOT NULL auto_increment,
  `user_id` int(11) NOT NULL,
  `cont_id` int(11) NOT NULL,
  PRIMARY KEY  (`id`),
  KEY `user_id` (`user_id`),
  KEY `cont_id` (`cont_id`)
  ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

CREATE TABLE IF NOT EXISTS `mail_f` (
  `id` int(11) NOT NULL auto_increment,
  `refid` int(11) NOT NULL,
  `type` int (1) NOT NULL,
  `name` varchar (50),
  PRIMARY KEY  (`id`),
  KEY `refid` (`refid`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=utf8;