notice_init.sql 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. create database if not exists `notice` default character set utf8 collate utf8_general_ci;
  2. DROP TABLE IF EXISTS `notice`.`msg_type`;
  3. create table `notice`.`message_type`(
  4. `id` int(11) unsigned not null auto_increment,
  5. `sys_name` varchar(64) not null default '',
  6. `type_name` varchar(64) not null default '',
  7. `remind_type_id` int(11) unsigned not null default 0,
  8. `remind_type` varchar(64) not null default '',
  9. `push_date` varchar(64) not null default '',
  10. `push_time` varchar(64) not null default '' comment '推送时间,different type have different format',
  11. `interval_time` int(11) not null default 0 comment '提醒间隔时间,单位hour',
  12. `push_limit` int(11) not null default 0 ,
  13. `template_id` varchar(64) not null default '',
  14. primary key (`id`),
  15. UNIQUE key `u_msg_type` (`remind_type`)
  16. )ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT '消息类型';
  17. drop table if exists `notice`.`message`;
  18. create table `notice`.`message`(
  19. `id` int(11) not null auto_increment,
  20. `msg_type_id` int(11) not null default 0,
  21. `msg_content` text not null ,
  22. `target` varchar(64) not null default '',
  23. `push_count` int(11) not null default 0,
  24. `push_limit` int(11) not null default 0,
  25. `status` int(11) not null default 0,
  26. `create_at` DATETIME not null default CURRENT_TIMESTAMP,
  27. `update_at` DATETIME not null ON UPDATE CURRENT_TIMESTAMP ,
  28. primary key(`id`)
  29. )ENGINE=InnoDB DEFAULT CHARSET=utf8 comment '消息';
  30. -- create table `user`(
  31. -- `id` int(11) not null auto_increment,
  32. -- openid varchar(64) not null default '',
  33. -- phone varchar(64) not null default '',
  34. -- primary key (`id`)
  35. -- )ENGINE=InnoDB DEFAULT CHARSET=utf8 comment='用户表';