



CREATE TABLE `user` (
                      id INTEGER PRIMARY KEY AUTOINCREMENT,
                      email TEXT,
                      password TEXT,
                      username TEXT,
                      role TEXT,
                      token TEXT,
                      logintime TEXT
);
CREATE TABLE `note` (
                      id INTEGER PRIMARY KEY AUTOINCREMENT,
                      pid INTEGER,
                      title TEXT,
                      context TEXT,
                      conjson TEXT,
                      createtime TEXT,
                      updatetime TEXT,
                      viewtime TEXT,
                      userid INTEGER,
                      username TEXT,
                      flag INTEGER  DEFAULT 1
);
CREATE TABLE `history` (
                        id INTEGER PRIMARY KEY AUTOINCREMENT,
                        nid INTEGER,
                        title TEXT,
                        context TEXT,
                        conjson TEXT,
                        createtime TEXT,
                        userid INTEGER,
                        username TEXT,
                        flag INTEGER DEFAULT 1
);
CREATE TABLE appx (
                      app_id INTEGER PRIMARY KEY AUTOINCREMENT,
                      app_key TEXT,
                      akey TEXT,
                      ugroup_id INTEGER DEFAULT 0,
                      agroup_id INTEGER,
                      name TEXT,
                      note TEXT,
                      ar_is_setting INTEGER NOT NULL DEFAULT 0,
                      ar_is_examine INTEGER NOT NULL DEFAULT 0,
                      ar_examine_ver INTEGER NOT NULL DEFAULT 0,
                      log_fulltime TEXT
);

INSERT INTO `user` VALUES ('1', 'aaaaaaaaa', 'cyy123', 'admin', 'admin','','');
INSERT INTO `user` VALUES ('2', 'aaaaaaaaa', 'test', 'test', 'test','','');
INSERT INTO `note` VALUES ('1', '0', 'test', 'test', 'test','','','','1','1','1');