text: -- phpMyAdmin SQL Dump
  -- version 4.6.4
  -- https://www.phpmyadmin.net/
  --
  -- Host: 127.0.0.1
  -- Generation Time: 2017-02-02 14:16:33
  -- 服务器版本： 5.5.50-MariaDB
  -- PHP Version: 5.6.26
  
  SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  SET time_zone = "+00:00";
  
  
  /*!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 utf8mb4 */;
  
  --
  -- Database: `task`
  --
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `log_crontab`
  --
  
  DROP TABLE IF EXISTS `log_crontab`;
  CREATE TABLE IF NOT EXISTS `log_crontab` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `times` int(11) NOT NULL,
    `fail_times` int(11) NOT NULL,
    `created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=347 DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `model`
  --
  
  DROP TABLE IF EXISTS `model`;
  CREATE TABLE IF NOT EXISTS `model` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `uid` int(11) NOT NULL,
    `name` varchar(256) CHARACTER SET utf8 NOT NULL COMMENT '名称',
    `description` varchar(255) CHARACTER SET utf8 DEFAULT NULL COMMENT '描述',
    `code` text CHARACTER SET utf8 NOT NULL COMMENT '执行代码',
    `datatype` text COMMENT '代码内需要的数据',
    `status` int(1) NOT NULL COMMENT '-1: 删除  0：私有，1：公开',
    `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `schedule`
  --
  
  DROP TABLE IF EXISTS `schedule`;
  CREATE TABLE IF NOT EXISTS `schedule` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `uid` int(11) NOT NULL,
    `tid` int(11) NOT NULL,
    `mid` int(11) NOT NULL,
    `status` int(1) NOT NULL DEFAULT '0' COMMENT '执行状态 0: 成功, 1: 失败, 2: 未执行, 3: 终止',
    `result` text NOT NULL,
    `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
    `update_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=137 DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `task`
  --
  
  DROP TABLE IF EXISTS `task`;
  CREATE TABLE IF NOT EXISTS `task` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `uid` int(11) NOT NULL,
    `mid` int(11) NOT NULL COMMENT '模板id',
    `data` text NOT NULL COMMENT '用户提交的数据，json格式',
    `frequency` int(11) DEFAULT '24' COMMENT '执行频率，按小时计算',
    `status` int(1) NOT NULL COMMENT '-1: 删除 0: 运行， 1: 暂停',
    `remark` text NOT NULL COMMENT '备注信息',
    `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `times`
  --
  
  DROP TABLE IF EXISTS `times`;
  CREATE TABLE IF NOT EXISTS `times` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `type` varchar(255) NOT NULL COMMENT 'task: 任务，model：模板',
    `type_id` int(11) NOT NULL,
    `positive` int(11) NOT NULL,
    `negative` int(11) NOT NULL,
    `ratio` float NOT NULL,
    `update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8;
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `user`
  --
  
  DROP TABLE IF EXISTS `user`;
  CREATE TABLE IF NOT EXISTS `user` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `nickname` varchar(255) CHARACTER SET utf8 NOT NULL,
    `email` varchar(50) NOT NULL,
    `avatar` text NOT NULL,
    `password` varchar(255) CHARACTER SET utf8 NOT NULL,
    `status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '-1: 删除, 0: 正常',
    `role` int(10) NOT NULL DEFAULT '0' COMMENT '0: 普通用户, 1: 管理员',
    `auth_key` varchar(32) NOT NULL,
    `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
    `update_time` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00',
    PRIMARY KEY (`id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=latin1;
  
  -- --------------------------------------------------------
  
  --
  -- 表的结构 `user_auth`
  --
  
  DROP TABLE IF EXISTS `user_auth`;
  CREATE TABLE IF NOT EXISTS `user_auth` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `user_id` int(11) NOT NULL,
    `identifier` varchar(255) CHARACTER SET utf8 NOT NULL,
    `type` int(10) NOT NULL,
    `credential` varchar(255) CHARACTER SET utf8 DEFAULT NULL,
    PRIMARY KEY (`id`,`user_id`)
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
  
  /*!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 */;
  