-- MySQL dump 10.14  Distrib 5.5.41-MariaDB, for Linux (x86_64)
--
-- Host: localhost    Database: maildb
-- ------------------------------------------------------
-- Server version       5.5.41-MariaDB

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `version`
--

DROP TABLE IF EXISTS `version`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `version` (
  `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `version` int(11) NOT NULL DEFAULT '0' COMMENT '版本号',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `version` (`version`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `t_mail`
--

DROP TABLE IF EXISTS `t_mail`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_mail` (
  `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `mail_id` bigint NOT NULL COMMENT '邮件id',
  `mail_type` int(11) NOT NULL DEFAULT '0' COMMENT '邮件类型',
  `unikey` varchar(255) CHARACTER SET utf8 COMMENT 'unikey',
  `subject` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'subject',
  `content` text NOT NULL DEFAULT '' COMMENT '消息内容',
  `recipients` text NOT NULL DEFAULT '' COMMENT '收件人列表',
  `attachments` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '附件',
  `deleted` int(11) NOT NULL DEFAULT '0' COMMENT '是否已删除',
  `sendtime` int(11) NOT NULL DEFAULT '0' COMMENT '发送时间',
  `user_reg_start_time` int(11) NOT NULL DEFAULT '0' COMMENT '用户注册开始时间',
  `user_reg_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '用户注册结束时间',
  `tag1` int(11) NOT NULL DEFAULT '0' COMMENT 'tag1',
  `tag2` int(11) NOT NULL DEFAULT '0' COMMENT 'tag2',
  `expiretime` int(11) NOT NULL DEFAULT '0' COMMENT '过期时间',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  UNIQUE KEY `idx` (`idx`),
  UNIQUE KEY `unikey` (`unikey`),
  PRIMARY KEY (`mail_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

--
-- Table structure for table `t_group`
--

DROP TABLE IF EXISTS `t_group`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_group` (
  `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `group_id` bigint NOT NULL COMMENT 'group id',
  `group_name` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '分组名',
  `group_desc` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '描述',
  `enabled` int(11) NOT NULL DEFAULT '0' COMMENT '是否已启用',
  `deleted` int(11) NOT NULL DEFAULT '0' COMMENT '是否已删除',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  UNIQUE KEY `idx` (`idx`),
  PRIMARY KEY (`group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

--
-- Table structure for table `t_member`
--

DROP TABLE IF EXISTS `t_member`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_member` (
  `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `group_id` bigint NOT NULL COMMENT 'group id',
  `member_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '账号id',
  `deleted` int(11) NOT NULL DEFAULT '0' COMMENT '是否已删除',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  UNIQUE KEY `idx` (`idx`),
  PRIMARY KEY (`group_id`, `member_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

--
-- Table structure for table `t_inbox`
--

DROP TABLE IF EXISTS `t_inbox`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_inbox` (
  `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `account_id` varchar(60) CHARACTER SET utf8 NOT NULL COMMENT '账号id',
  `mail_id` bigint NOT NULL COMMENT '邮件id',
  `state` int(11) NOT NULL DEFAULT '0' COMMENT '1:已读取 2:已删除',
  `expiretime` int(11) NOT NULL DEFAULT '0' COMMENT '过期时间',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  UNIQUE KEY `idx` (`idx`),
  PRIMARY KEY (`account_id`, `mail_id`),
  KEY `idx_state` (`state`),
  KEY `idx_expiretime` (`expiretime`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

--
-- Table structure for table `t_event`
--

DROP TABLE IF EXISTS `t_event`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_event` (
  `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `event_name` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '事件名',
  `param1` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '事件参数1',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

--
-- Table structure for table `t_param`
--

DROP TABLE IF EXISTS `t_param`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_param` (
  `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `param_name` varchar(60) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '事件名',
  `param_val1` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '参数1',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

--
-- Table structure for table `t_sys_mail`
--

DROP TABLE IF EXISTS `t_sys_mail`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `t_sys_mail` (
  `idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `unikey` varchar(255) CHARACTER SET utf8 DEFAULT '' COMMENT 'unikey',
  `subject` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT 'subject',
  `content` text NOT NULL DEFAULT '' COMMENT '消息内容',
  `recipients` text NOT NULL DEFAULT '' COMMENT '收件人列表',
  `attachments` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '' COMMENT '附件',
  `tag1` int(11) NOT NULL DEFAULT '0' COMMENT 'tag1',
  `tag2` int(11) NOT NULL DEFAULT '0' COMMENT 'tag2',
  `sendtime` int(11) NOT NULL DEFAULT '0' COMMENT '发送时间',
  `expiretime` int(11) NOT NULL DEFAULT '0' COMMENT '过期时间',
  `user_reg_start_time` int(11) NOT NULL DEFAULT '0' COMMENT '用户注册开始时间',
  `user_reg_end_time` int(11) NOT NULL DEFAULT '0' COMMENT '用户注册结束时间',
  `createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
  `modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
  PRIMARY KEY (`idx`),
  UNIQUE KEY `unikey` (`unikey`)
) ENGINE=InnoDB AUTO_INCREMENT=10000 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2015-08-19 18:52:06
