-- -- create database if not exists `notice` default character set utf8 collate utf8_general_ci; -- DROP TABLE IF EXISTS `notice`.`message_type`; -- create table `notice`.`message_type`( -- `sys_name` varchar(64) not null default '', -- `id` int(11) unsigned not null , -- `pasture_id` int(11) not null default 0, -- `type_name` varchar(64) not null default '', -- `remind_type_id` int(11) unsigned not null default 0, -- `remind_type` varchar(64) not null default '', -- `push_date` varchar(64) not null default '', -- `push_time` varchar(64) not null default '' comment '推送时间,different type have different format', -- `interval_time` int(11) not null default 0 comment '提醒间隔时间,单位hour', -- `push_limit` int(11) not null default 0 , -- `template_id` varchar(64) not null default '', -- `roles_id` varchar(64) not null default '', -- `users_id` varchar(64) not null default '', -- primary key(`id`,`sys_name`,`pasture_id`), -- index `u_msg_type` (`remind_type`) -- )ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '消息类型'; -- alter table msg_type -- modify column `remind_type_id` int(11) unsigned not null default '0' FIRST remind_type; -- modify column `remind_type_id` int(11) FIRST remind_type -- drop index u_msg_type on message_type -- alter table message -- -- add push_count int(11) unsigned not null default '0' AFTER `status`; -- add remind_type_id int(11) unsigned not null default '0' AFTER `status`; insert into message_type (sys_name,id,pasture_id,type_name,remind_type_id,remind_type,push_date,push_time,interval_time,push_limit,template_id,roles_id,users_id) values -- ('tmrwatch',1,1,'合同金额超期未收',3,'指定周期','w1,w3,w5','9:30','0',3,'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo','1,2,3','1,2,3'), ('tmrwatch',2,3,'合同金额超期未收',3,'指定周期','w1,w3,w5','9:30','0',3,'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo','1,2,3','1,2,3'), ('tmrwatch',1,3,'合同金额超期未收',3,'指定周期','w1,w3,w5','9:30','0',3,'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo','1,2,3','1,2,3'); -- ('tmrwatch','合同审批',1,'立即','0','0','2','0','BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'), -- ('tmrwatch','客户回访未完成',2,'延时','48','9:30','24',3,'BtkN1rWKOJtKP0C64lGxIrPzLRFsYFas-4gupX2-pFo'),