助讯通 WaleChat 文档中心































助讯通 服务端 数据库 表明细


助讯通 ( Wale ) 服务端所用到的所有 MySQL 数据表,表结构如下:

(二次开发,需要作字段增删调整的用户,请联系河马)



数据库 字符集 请用:'''utf8mb4'''

数据库 排序和比较的校对编码格式 请用:'''utf8mb4_unicode_ci'''


数据库 建立语句

create database waleserver CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

表功能说明!! 创建语句

运行参数表(详情请见 基本配置 文档)

CREATE TABLE `wale_config` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `ini_key` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `value_long` bigint(20) DEFAULT '0',
  `value_bool` tinyint(1) DEFAULT '0',
  `value_string` varchar(8192) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `value_binary` blob,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

后台管理人员帐号表

CREATE TABLE `wale_admin` (
  `uid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `account` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
  `password` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,
  `salt` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`uid`),
  UNIQUE KEY `account` (`account`)
) ENGINE=MyISAM AUTO_INCREMENT=9900 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

群表

CREATE TABLE `wale_club` (
  `cid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rootuid` bigint(20) unsigned NOT NULL,
  `maxuser` int(20) unsigned DEFAULT '500',
  `bantalk` tinyint(1) DEFAULT '0',
  `createtime` datetime DEFAULT NULL,
  `deleted` tinyint(1) DEFAULT '0',
  `aver` int(11) DEFAULT '0',
  PRIMARY KEY (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=33 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

群及成员关系表

CREATE TABLE `wale_clubuser` (
  `rid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `cid` bigint(20) unsigned NOT NULL,
  `uid` bigint(20) unsigned NOT NULL,
  `type` int(11) NOT NULL DEFAULT '0',
  `firstmid` bigint(20) unsigned DEFAULT '0',
  `syncmid` bigint(20) unsigned DEFAULT '0',
  PRIMARY KEY (`rid`),
  KEY `cid` (`cid`)
) ENGINE=MyISAM AUTO_INCREMENT=349 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

分布式 文件/数据 服务器表(详情请见分布式部署文档)

CREATE TABLE `wale_datasvr` (
  `svrid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `url` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL,
  `remark` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  PRIMARY KEY (`svrid`)
) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

部门表(企业模式)

CREATE TABLE `wale_dept` (
  `did` bigint(20) NOT NULL AUTO_INCREMENT,
  `pdid` bigint(20) NOT NULL DEFAULT '0',
  `name` varchar(256) COLLATE utf8mb4_unicode_ci NOT NULL,
  `order` int(11) NOT NULL DEFAULT '0',
  `regswitch` tinyint(1) DEFAULT '0',
  `permission` text COLLATE utf8mb4_unicode_ci,
  PRIMARY KEY (`did`)
) ENGINE=MyISAM AUTO_INCREMENT=24 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

部门员工关系表

CREATE TABLE `wale_deptuser` (
  `iid` bigint(20) NOT NULL AUTO_INCREMENT,
  `uid` bigint(20) DEFAULT '0',
  `did` bigint(20) DEFAULT '0',
  `order` int(11) DEFAULT '0',
  PRIMARY KEY (`iid`)
) ENGINE=MyISAM AUTO_INCREMENT=83 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

手机移动设备表(向手机推送消息时会用到)

CREATE TABLE `wale_device` (
  `did` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uid` bigint(20) unsigned DEFAULT '0',
  `appname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `appversion` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `devtoken` varchar(255) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `devtype` int(11) DEFAULT '0',
  `ioslang` varchar(128) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT 'en',
  `badgecnt` int(11) DEFAULT '0',
  `pushhost` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT 'google',
  `pushbadge` tinyint(1) DEFAULT '0',
  `pushalert` tinyint(1) DEFAULT '0',
  `pushsound` tinyint(1) DEFAULT '0',
  `previewtxt` tinyint(1) DEFAULT '1',
  `updated` datetime DEFAULT NULL,
  PRIMARY KEY (`did`),
  UNIQUE KEY `devtoken` (`devtoken`)
) ENGINE=MyISAM AUTO_INCREMENT=114 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

好友添加请求表(客服模式)

CREATE TABLE `wale_event` (
  `iid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `ruid` bigint(20) NOT NULL,
  `auid` bigint(20) NOT NULL,
  `cid` bigint(20) NOT NULL DEFAULT '0',
  `rsex` tinyint(1) NOT NULL DEFAULT '0',
  `raccount` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rname` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rmessage` varchar(256) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `evtm` datetime DEFAULT NULL,
  PRIMARY KEY (`iid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

好友关系表(客服模式)

CREATE TABLE `wale_friend` (
  `lid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `ouid` bigint(20) unsigned DEFAULT NULL COMMENT '所属人uid',
  `uid` bigint(20) unsigned DEFAULT NULL COMMENT '联系人id',
  PRIMARY KEY (`lid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

人员名称备注表

CREATE TABLE `wale_remark` (
  `rid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `ouid` bigint(20) NOT NULL,
  `uid` bigint(20) NOT NULL,
  `remark` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL,
  `dtime` datetime NOT NULL,
  PRIMARY KEY (`rid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

消息撤回表

CREATE TABLE `wale_revoke` (
  `iid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `uid` bigint(20) unsigned DEFAULT '0',
  `mid` bigint(20) unsigned DEFAULT '0',
  `cid` bigint(20) unsigned DEFAULT '0',
  `msgtype` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`iid`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

用户帐号表

CREATE TABLE `wale_user` (
  `uid` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `account` varchar(64) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `password` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `salt` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `mobile` bigint(32) DEFAULT NULL,
  `country` int(11) DEFAULT NULL,
  `email` varchar(256) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
  `name` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `show` varchar(1024) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sex` tinyint(1) DEFAULT '1',
  `syncmid` bigint(20) unsigned DEFAULT '0',
  `aver` int(10) unsigned DEFAULT '1',
  `permission` text COLLATE utf8mb4_unicode_ci,
  `createtime` datetime DEFAULT NULL,
  `lastlogin` bigint(20) DEFAULT '0',
  PRIMARY KEY (`uid`),
  UNIQUE KEY `moblie` (`mobile`),
  UNIQUE KEY `account` (`account`)
) ENGINE=MyISAM AUTO_INCREMENT=1097 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;





WaleChat 文档中心
Powered by WaleHelp.com