CREATE DATABASE `saas_mail` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
use `saas_mail`;

create table `m_log` (
  `id` int unsigned primary key not null auto_increment,
  `template_id` int comment '模板',
  `subject` varchar(300) not null comment '主题',
  `text` text comment '内容',
  `from` varchar(100) comment '发送人',
  `to` varchar(1000) comment '接收人',
  `company_id` int,
  `creator_id` int,
  `create_time` datetime
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='邮件日志';

create table `m_template` (
  `id` varchar(100) primary key not null,
  `subject` varchar(300) not null comment '主题',
  `text` text comment '内容'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='邮件模板';