/*
 Navicat Premium Data Transfer

 Source Server         : admin
 Source Server Type    : SQLite
 Source Server Version : 3030001
 Source Schema         : main

 Target Server Type    : SQLite
 Target Server Version : 3030001
 File Encoding         : 65001

 Date: 01/06/2021 09:20:10
*/

-- ----------------------------
-- Table structure for auth_token
-- ----------------------------
CREATE TABLE IF NOT EXISTS "auth_token" (
                              "token" TEXT NOT NULL  ,
                              "jcb_id" TEXT NOT NULL PRIMARY KEY,
                              "lasttime" DATETIME NOT NULL
);

-- ----------------------------
-- Table structure for jcb
-- ----------------------------
CREATE TABLE IF NOT EXISTS  "jcb" (
                                      "jcb_id" TEXT(255) NOT NULL,
                                      "db_name" TEXT(255) NOT NULL,
                                      "db_pwd" TEXT(255) NOT NULL,
                                      "db_username" TEXT(255) NOT NULL,
                                      "host" TEXT(255) NOT NULL,
                                      "name" TEXT(255) NOT NULL,
                                      "port" TEXT(255) NOT NULL,
                                      "remark" TEXT(255) NOT NULL,
                                      "state" INTEGER(11) NOT NULL,
                                      "gmt_create" DATETIME NOT NULL,
                                      "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
                                      "db_type" INTEGER(1) NOT NULL,
                                      "gmt_modify" DATETIME NOT NULL,
                                      CONSTRAINT "jcb_id" UNIQUE ("jcb_id" ASC)
);


-- ----------------------------
-- Table structure for sys_task
-- ----------------------------
CREATE TABLE IF NOT EXISTS "sys_task" (
                                          "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
                                          "jcb_id" TEXT(64) NOT NULL,
                                          "job_name" TEXT(255) NOT NULL,
                                          "job_status" INTEGER(1) NOT NULL,
                                          "create_time" DATETIME NOT NULL,
                                          "ctype" TEXT NOT NULL,
                                          "cid" INTEGER NOT NULL,
                                          "content" TEXT NOT NULL DEFAULT '',
                                          "state" INTEGER NOT NULL
);

-- ----------------------------
-- Table structure for table_log
-- ----------------------------
CREATE TABLE IF NOT EXISTS  "table_log" ( "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, "table_name" TEXT NOT NULL, "hs_cloud_last_time" DATETIME NOT NULL, CONSTRAINT "table_name" UNIQUE ("table_name") );

-- ----------------------------
-- Table structure for user
-- ----------------------------
CREATE TABLE IF NOT EXISTS  "user" (
                                       "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
                                       "user_name" TEXT(255) NOT NULL,
                                       "password" TEXT(255) NOT NULL,
                                       "gmt_create" DATETIME NOT NULL,
                                       "gmt_modify" DATETIME NOT NULL
);


insert into user (user_name,password,gmt_create,gmt_modify)VALUES('admin','87DC6B04718D412DBBFB4620D1A2436B', datetime('now'), datetime('now'));

-- ----------------------------
-- Indexes structure for table jcb
-- ----------------------------
CREATE UNIQUE INDEX "main"."jcb_id"
    ON "jcb" (
              "jcb_id" ASC
        );


-- ----------------------------
-- Indexes structure for table user
-- ----------------------------
CREATE UNIQUE INDEX "main"."user_name"
    ON "user" (
               "user_name" ASC
        );

