|
|
|
@ -41,12 +41,13 @@ CREATE TABLE `App` (
|
|
|
|
|
`OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
|
|
|
|
|
`OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
|
|
|
|
|
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
|
|
|
|
|
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
|
|
|
|
|
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
|
|
|
|
|
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
|
|
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
|
|
|
|
|
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
KEY `AppId` (`AppId`(191)),
|
|
|
|
|
UNIQUE KEY `UK_AppId_DeletedAt` (`AppId`,`DeletedAt`),
|
|
|
|
|
KEY `DataChange_LastTime` (`DataChange_LastTime`),
|
|
|
|
|
KEY `IX_Name` (`Name`(191))
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用表';
|
|
|
|
@ -66,12 +67,13 @@ CREATE TABLE `AppNamespace` (
|
|
|
|
|
`IsPublic` bit(1) NOT NULL DEFAULT b'0' COMMENT 'namespace是否为公共',
|
|
|
|
|
`Comment` varchar(64) NOT NULL DEFAULT '' COMMENT '注释',
|
|
|
|
|
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
|
|
|
|
|
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
|
|
|
|
|
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
|
|
|
|
|
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
|
|
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
|
|
|
|
|
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
KEY `IX_AppId` (`AppId`),
|
|
|
|
|
UNIQUE KEY `UK_AppId_Name_DeletedAt` (`AppId`,`Name`,`DeletedAt`),
|
|
|
|
|
KEY `Name_AppId` (`Name`,`AppId`),
|
|
|
|
|
KEY `DataChange_LastTime` (`DataChange_LastTime`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='应用namespace定义';
|
|
|
|
@ -92,12 +94,13 @@ CREATE TABLE `Consumer` (
|
|
|
|
|
`OwnerName` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerName',
|
|
|
|
|
`OwnerEmail` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'ownerEmail',
|
|
|
|
|
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
|
|
|
|
|
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
|
|
|
|
|
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
|
|
|
|
|
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
|
|
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
|
|
|
|
|
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
KEY `AppId` (`AppId`(191)),
|
|
|
|
|
UNIQUE KEY `UK_AppId_DeletedAt` (`AppId`,`DeletedAt`),
|
|
|
|
|
KEY `DataChange_LastTime` (`DataChange_LastTime`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='开放API消费者';
|
|
|
|
|
|
|
|
|
@ -132,14 +135,15 @@ CREATE TABLE `ConsumerRole` (
|
|
|
|
|
`ConsumerId` int(11) unsigned DEFAULT NULL COMMENT 'Consumer Id',
|
|
|
|
|
`RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id',
|
|
|
|
|
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
|
|
|
|
|
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
|
|
|
|
|
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
|
|
|
|
|
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
|
|
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
|
|
|
|
|
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
UNIQUE KEY `UK_ConsumerId_RoleId_DeletedAt` (`ConsumerId`,`RoleId`,`DeletedAt`),
|
|
|
|
|
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
|
|
|
|
|
KEY `IX_RoleId` (`RoleId`),
|
|
|
|
|
KEY `IX_ConsumerId_RoleId` (`ConsumerId`,`RoleId`)
|
|
|
|
|
KEY `IX_RoleId` (`RoleId`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer和role的绑定表';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -155,12 +159,13 @@ CREATE TABLE `ConsumerToken` (
|
|
|
|
|
`Token` varchar(128) NOT NULL DEFAULT '' COMMENT 'token',
|
|
|
|
|
`Expires` datetime NOT NULL DEFAULT '2099-01-01 00:00:00' COMMENT 'token失效时间',
|
|
|
|
|
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
|
|
|
|
|
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
|
|
|
|
|
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
|
|
|
|
|
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
|
|
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
|
|
|
|
|
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
UNIQUE KEY `IX_Token` (`Token`),
|
|
|
|
|
UNIQUE KEY `UK_Token_DeletedAt` (`Token`,`DeletedAt`),
|
|
|
|
|
KEY `DataChange_LastTime` (`DataChange_LastTime`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='consumer token表';
|
|
|
|
|
|
|
|
|
@ -175,13 +180,14 @@ CREATE TABLE `Favorite` (
|
|
|
|
|
`AppId` varchar(500) NOT NULL DEFAULT 'default' COMMENT 'AppID',
|
|
|
|
|
`Position` int(32) NOT NULL DEFAULT '10000' COMMENT '收藏顺序',
|
|
|
|
|
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
|
|
|
|
|
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
|
|
|
|
|
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
|
|
|
|
|
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
|
|
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
|
|
|
|
|
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
UNIQUE KEY `UK_UserId_AppId_DeletedAt` (`UserId`,`AppId`,`DeletedAt`),
|
|
|
|
|
KEY `AppId` (`AppId`(191)),
|
|
|
|
|
KEY `IX_UserId` (`UserId`),
|
|
|
|
|
KEY `DataChange_LastTime` (`DataChange_LastTime`)
|
|
|
|
|
) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8mb4 COMMENT='应用收藏表';
|
|
|
|
|
|
|
|
|
@ -195,12 +201,13 @@ CREATE TABLE `Permission` (
|
|
|
|
|
`PermissionType` varchar(32) NOT NULL DEFAULT '' COMMENT '权限类型',
|
|
|
|
|
`TargetId` varchar(256) NOT NULL DEFAULT '' COMMENT '权限对象类型',
|
|
|
|
|
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
|
|
|
|
|
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
|
|
|
|
|
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
|
|
|
|
|
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
|
|
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
|
|
|
|
|
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
KEY `IX_TargetId_PermissionType` (`TargetId`(191),`PermissionType`),
|
|
|
|
|
UNIQUE KEY `UK_TargetId_PermissionType_DeletedAt` (`TargetId`,`PermissionType`,`DeletedAt`),
|
|
|
|
|
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='permission表';
|
|
|
|
|
|
|
|
|
@ -215,12 +222,13 @@ CREATE TABLE `Role` (
|
|
|
|
|
`Id` int(11) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增Id',
|
|
|
|
|
`RoleName` varchar(256) NOT NULL DEFAULT '' COMMENT 'Role name',
|
|
|
|
|
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
|
|
|
|
|
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
|
|
|
|
|
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
|
|
|
|
|
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
|
|
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
|
|
|
|
|
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
KEY `IX_RoleName` (`RoleName`(191)),
|
|
|
|
|
UNIQUE KEY `UK_RoleName_DeletedAt` (`RoleName`,`DeletedAt`),
|
|
|
|
|
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色表';
|
|
|
|
|
|
|
|
|
@ -236,13 +244,14 @@ CREATE TABLE `RolePermission` (
|
|
|
|
|
`RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id',
|
|
|
|
|
`PermissionId` int(10) unsigned DEFAULT NULL COMMENT 'Permission Id',
|
|
|
|
|
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
|
|
|
|
|
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
|
|
|
|
|
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
|
|
|
|
|
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
|
|
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
|
|
|
|
|
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
UNIQUE KEY `UK_RoleId_PermissionId_DeletedAt` (`RoleId`,`PermissionId`,`DeletedAt`),
|
|
|
|
|
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
|
|
|
|
|
KEY `IX_RoleId` (`RoleId`),
|
|
|
|
|
KEY `IX_PermissionId` (`PermissionId`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='角色和权限的绑定表';
|
|
|
|
|
|
|
|
|
@ -259,12 +268,13 @@ CREATE TABLE `ServerConfig` (
|
|
|
|
|
`Value` varchar(2048) NOT NULL DEFAULT 'default' COMMENT '配置项值',
|
|
|
|
|
`Comment` varchar(1024) DEFAULT '' COMMENT '注释',
|
|
|
|
|
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
|
|
|
|
|
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
|
|
|
|
|
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
|
|
|
|
|
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
|
|
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
|
|
|
|
|
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
KEY `IX_Key` (`Key`),
|
|
|
|
|
UNIQUE KEY `UK_Key_DeletedAt` (`Key`,`DeletedAt`),
|
|
|
|
|
KEY `DataChange_LastTime` (`DataChange_LastTime`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置服务自身配置';
|
|
|
|
|
|
|
|
|
@ -280,14 +290,15 @@ CREATE TABLE `UserRole` (
|
|
|
|
|
`UserId` varchar(128) DEFAULT '' COMMENT '用户身份标识',
|
|
|
|
|
`RoleId` int(10) unsigned DEFAULT NULL COMMENT 'Role Id',
|
|
|
|
|
`IsDeleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '1: deleted, 0: normal',
|
|
|
|
|
`DeletedAt` BIGINT(20) NOT NULL DEFAULT '0' COMMENT 'Delete timestamp based on milliseconds',
|
|
|
|
|
`DataChange_CreatedBy` varchar(64) NOT NULL DEFAULT 'default' COMMENT '创建人邮箱前缀',
|
|
|
|
|
`DataChange_CreatedTime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
|
|
|
|
`DataChange_LastModifiedBy` varchar(64) DEFAULT '' COMMENT '最后修改人邮箱前缀',
|
|
|
|
|
`DataChange_LastTime` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
UNIQUE KEY `UK_UserId_RoleId_DeletedAt` (`UserId`,`RoleId`,`DeletedAt`),
|
|
|
|
|
KEY `IX_DataChange_LastTime` (`DataChange_LastTime`),
|
|
|
|
|
KEY `IX_RoleId` (`RoleId`),
|
|
|
|
|
KEY `IX_UserId_RoleId` (`UserId`,`RoleId`)
|
|
|
|
|
KEY `IX_RoleId` (`RoleId`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户和role的绑定表';
|
|
|
|
|
|
|
|
|
|
# Dump of table Users
|
|
|
|
@ -302,7 +313,8 @@ CREATE TABLE `Users` (
|
|
|
|
|
`UserDisplayName` varchar(512) NOT NULL DEFAULT 'default' COMMENT '用户名称',
|
|
|
|
|
`Email` varchar(64) NOT NULL DEFAULT 'default' COMMENT '邮箱地址',
|
|
|
|
|
`Enabled` tinyint(4) DEFAULT NULL COMMENT '是否有效',
|
|
|
|
|
PRIMARY KEY (`Id`)
|
|
|
|
|
PRIMARY KEY (`Id`),
|
|
|
|
|
UNIQUE KEY `UK_Username` (`Username`)
|
|
|
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='用户表';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|