Framework built-in tables

12003
  • Built-in Tables/View
    • Users: _user, _user_session, _view01_user
    • Pages & Interfaces: _page, _resource
    • User Permissions:
      • _group, _user_group_role,
      • _user_group_role_page, _user_group_role_resource
    • Utility Tables: constant_ui, constant, _record_history, _file, _cache

Users

_user

CREATE TABLE `_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `idSequence` varchar(255)  DEFAULT NULL COMMENT 'Auto-incremented id; used to generate userId',
  `userId` varchar(255)  DEFAULT NULL COMMENT 'Primary key id',
  `username` varchar(255)  DEFAULT NULL COMMENT 'Username (login)',
  `clearTextPassword` varchar(255)  DEFAULT NULL COMMENT 'Plain text password',
  `password` varchar(255)  DEFAULT NULL COMMENT 'Password',
  `md5Salt` varchar(255)  DEFAULT NULL COMMENT 'md5Salt',
  `userStatus` varchar(255)  DEFAULT 'active' COMMENT 'User account status: active or closed',
  `userType` varchar(255)  DEFAULT NULL COMMENT 'User type; staff, student.',
  `config` mediumtext  COMMENT 'Configuration information',
  `operation` varchar(255)  DEFAULT 'insert' COMMENT 'Operation; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  `operationByUserId` varchar(255)  DEFAULT NULL COMMENT 'Operator userId',
  `operationByUser` varchar(255)  DEFAULT NULL COMMENT 'Operator username',
  `operationAt` varchar(255)  DEFAULT NULL COMMENT 'Operation time; E.g: 2021-05-28T10:24:54+08:00 ',
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `username_index` (`username`) USING BTREE,
  UNIQUE KEY `userId_index` (`userId`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 50 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'User table'

_user_session

CREATE TABLE `_user_session` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userId` varchar(255)  DEFAULT NULL COMMENT 'User id',
  `userIp` varchar(255)  DEFAULT NULL COMMENT 'User IP',
  `userIpRegion` varchar(255)  DEFAULT NULL COMMENT 'User IP region',
  `userAgent` text  COMMENT 'Request agent',
  `deviceId` varchar(255)  DEFAULT NULL COMMENT 'Device id',
  `deviceType` varchar(255)  DEFAULT 'web' COMMENT 'Device type; flutter, web, bot_databot, bot_chatbot, bot_xiaochengxu',
  `socketStatus` varchar(255)  DEFAULT 'offline' COMMENT 'Socket status',
  `authToken` varchar(255)  DEFAULT NULL COMMENT 'Auth token',
  `operation` varchar(255)  DEFAULT 'insert' COMMENT 'Operation; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  `operationByUserId` varchar(255)  DEFAULT NULL COMMENT 'Operator userId',
  `operationByUser` varchar(255)  DEFAULT NULL COMMENT 'Operator username',
  `operationAt` varchar(255)  DEFAULT NULL COMMENT 'Operation time; E.g: 2021-05-28T10:24:54+08:00 ',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `userId_index` (`userId`) USING BTREE,
  KEY `userId_deviceId_index` (`userId`, `deviceId`) USING BTREE,
  KEY `authToken_index` (`authToken`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 83 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'User session table; deviceId dimension; soft delete not enabled;'

_view01_user

CREATE ALGORITHM=UNDEFINED SQL SECURITY DEFINER VIEW `_view01_user` AS select `_user`.`id` AS `id`,`_user`.`idSequence` AS `idSequence`,`_user`.`userId` AS `userId`,`_user`.`username` AS `username`,`_user`.`phoneNumber` AS `phoneNumber`,`_user`.`email` AS `email`,`_user`.`userStatus` AS `userStatus`,`_user`.`hrOrgRoleList` AS `hrOrgRoleList`,`_user`.`qiweiId` AS `qiweiId`,`_user`.`wechatId` AS `wechatId`,`_user`.`userConfig` AS `userConfig`,`_user`.`password` AS `password`,`_user`.`md5Salt` AS `md5Salt`,`_user`.`clearTextPassword` AS `clearTextPassword`,`_user`.`operation` AS `operation`,`_user`.`operationByUserId` AS `operationByUserId`,`_user`.`operationByUser` AS `operationByUser`,`_user`.`operationAt` AS `operationAt` from `_user`

Pages & Interfaces

_page

CREATE TABLE `_page` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pageId` varchar(255)  DEFAULT NULL COMMENT 'pageId',
  `pageFile` varchar(255)  DEFAULT NULL COMMENT 'Page file specification; defaults to pageId.html',
  `pageHook` varchar(255)  DEFAULT NULL COMMENT 'pageHook',
  `pageName` varchar(255)  DEFAULT NULL COMMENT 'Page name',
  `pageType` varchar(255)  DEFAULT NULL COMMENT 'Page type; showInMenu, dynamicInMenu',
  `pageIcon` text ,
  `sort` varchar(255)  DEFAULT NULL,
  `operation` varchar(255)  DEFAULT 'insert' COMMENT 'Operation; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  `operationByUserId` varchar(255)  DEFAULT NULL COMMENT 'Operator userId',
  `operationByUser` varchar(255)  DEFAULT NULL COMMENT 'Operator username',
  `operationAt` varchar(255)  DEFAULT NULL COMMENT 'Operation time; E.g: 2021-05-28T10:24:54+08:00 ',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 174 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'Page table; soft delete not enabled;'

_resource

CREATE TABLE `_resource` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `accessControlTable` varchar(255)  DEFAULT NULL COMMENT 'Data rule control table',
  `resourceHook` text  COMMENT '[ "before": {"service": "xx", "serviceFunction": "xxx"}, "after": [] }',
  `pageId` varchar(255)  DEFAULT NULL COMMENT 'Page id; E.g: index',
  `actionId` varchar(255)  DEFAULT NULL COMMENT 'Action id; E.g: selectXXXByXXX',
  `desc` varchar(255)  DEFAULT NULL COMMENT 'Description',
  `resourceType` varchar(255)  DEFAULT NULL COMMENT 'Resource type; E.g: auth service sql',
  `appDataSchema` text  COMMENT 'AppData parameter validation',
  `resourceData` text  COMMENT 'Resource data; { "service": "auth", "serviceFunction": "passwordLogin" } or  { "table": "${tableName}", "action": "select", "whereCondition": ".where(function() {this.whereNot( { recordStatus: \\"active\\" })})" }',
  `requestDemo` text  COMMENT 'Request demo',
  `responseDemo` text  COMMENT 'Response demo',
  `operation` varchar(255)  DEFAULT 'insert' COMMENT 'Operation; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  `operationByUserId` varchar(255)  DEFAULT NULL COMMENT 'Operator userId',
  `operationByUser` varchar(255)  DEFAULT NULL COMMENT 'Operator username',
  `operationAt` varchar(255)  DEFAULT NULL COMMENT 'Operation time; E.g: 2021-05-28T10:24:54+08:00 ',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 798 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'Request resource table; soft delete not enabled; resourceId=`${appId}.${pageId}.${actionId}`'

Pages & Interfaces

_group

CREATE TABLE `_group` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `groupId` varchar(511) CHARACTER SET utf8mb4 DEFAULT NULL,
  `groupLastId` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'groupId',
  `groupPath` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL,
  `groupName` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'Group abbreviation',
  `groupDeptName` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Group full name',
  `groupAllName` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'Full path name',
  `principalId` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Organization head',
  `headId` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Department head',
  `leadId` varchar(255) COLLATE utf8mb4_bin DEFAULT NULL COMMENT 'Responsible leader; not enabled',
  `groupDesc` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'Group description',
  `operation` varchar(255) CHARACTER SET utf8mb4 DEFAULT 'insert' COMMENT 'Operation; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  `operationByUserId` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'Operator userId',
  `operationByUser` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'Operator username',
  `operationAt` varchar(255) CHARACTER SET utf8mb4 DEFAULT NULL COMMENT 'Operation time; E.g: 2021-05-28T10:24:54+08:00 ',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=44 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;

_user_group_role

CREATE TABLE `_user_group_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userId` varchar(255) NOT NULL COMMENT 'User id',
  `groupId` varchar(255) NOT NULL COMMENT 'Group Id',
  `roleId` varchar(255) DEFAULT NULL COMMENT 'Role Id',
  `roleDeadline` varchar(255) DEFAULT NULL COMMENT 'Permission expiration date',
  `operation` varchar(255) DEFAULT 'insert' COMMENT 'Operation; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  `operationByUserId` varchar(255) DEFAULT NULL COMMENT 'Operator userId',
  `operationByUser` varchar(255) DEFAULT NULL COMMENT 'Operator username',
  `operationAt` varchar(255) DEFAULT NULL COMMENT 'Operation time; E.g: 2021-05-28T10:24:54+08:00 ',
  PRIMARY KEY (`id`) USING BTREE,
  KEY `groupId_index` (`groupId`) USING BTREE,
  KEY `userId_index` (`userId`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=691 DEFAULT CHARSET=utf8mb4 COMMENT='User group role association table; soft delete not enabled;';

_user_group_role_page

_user_group_role_resource

Utility Tables

constant_ui

constant

CREATE TABLE `_constant` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `constantKey` varchar(255)  DEFAULT NULL,
  `constantType` varchar(255)  DEFAULT NULL COMMENT 'Constant type; object, array',
  `desc` varchar(255)  DEFAULT NULL COMMENT 'Description',
  `constantValue` text  COMMENT 'Constant content; object, array',
  `operation` varchar(255)  DEFAULT 'insert' COMMENT 'Operation; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  `operationByUserId` varchar(255)  DEFAULT NULL COMMENT 'Operator userId',
  `operationByUser` varchar(255)  DEFAULT NULL COMMENT 'Operator username',
  `operationAt` varchar(255)  DEFAULT NULL COMMENT 'Operation time; E.g: 2021-05-28T10:24:54+08:00 ',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 12 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'Constant table; soft delete not enabled;'

_record_history

CREATE TABLE `_record_history` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `table` varchar(255)  DEFAULT NULL COMMENT 'Table',
  `recordId` int(11) DEFAULT NULL COMMENT 'Primary key id of data in table; recordContent.id',
  `recordContent` text  NOT NULL COMMENT 'Data',
  `packageContent` text  NOT NULL COMMENT 'Package JSON of the request at that time',
  `operation` varchar(255)  DEFAULT NULL COMMENT 'Operation; jhInsert, jhUpdate, jhDelete jhRestore',
  `operationByUserId` varchar(255)  DEFAULT NULL COMMENT 'Operator userId; recordContent.operationByUserId',
  `operationByUser` varchar(255)  DEFAULT NULL COMMENT 'Operator username; recordContent.operationByUser',
  `operationAt` varchar(255)  DEFAULT NULL COMMENT 'Operation time; recordContent.operationAt; E.g: 2021-05-28T10:24:54+08:00 ',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 40812 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin

_file

_cache

CREATE TABLE `_cache` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `userId` varchar(255)  NOT NULL COMMENT 'User Id',
  `content` longtext  COMMENT 'Cached data',
  `recordStatus` varchar(255)  DEFAULT 'active',
  `operation` varchar(255)  DEFAULT 'insert' COMMENT 'Operation; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  `operationByUserId` varchar(255)  DEFAULT NULL COMMENT 'Operator userId',
  `operationByUser` varchar(255)  DEFAULT NULL COMMENT 'Operator username',
  `operationAt` varchar(255)  DEFAULT NULL COMMENT 'Operation time; E.g: 2021-05-28T10:24:54+08:00 ',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = 'Cache table'