Revert "Add an id primary key column to both the roles and permissions tables.(mysql-schema.sql) (#12206)" (#12396)

This reverts commit 5d871967ea.
This commit is contained in:
杨翊 SionYang 2024-07-22 12:10:17 +08:00 committed by GitHub
parent 4e776256eb
commit 298f36f145
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 18 deletions

View File

@ -190,27 +190,21 @@ CREATE TABLE `tenant_info` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='tenant_info';
CREATE TABLE `users` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`username` varchar(50) NOT NULL COMMENT 'username',
`username` varchar(50) NOT NULL PRIMARY KEY COMMENT 'username',
`password` varchar(500) NOT NULL COMMENT 'password',
`enabled` boolean NOT NULL COMMENT 'enabled',
PRIMARY KEY (`id`)
`enabled` boolean NOT NULL COMMENT 'enabled'
);
CREATE TABLE `roles` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`username` varchar(50) NOT NULL COMMENT 'username',
`role` varchar(50) NOT NULL COMMENT 'role',
PRIMARY KEY (`id`),
UNIQUE INDEX `idx_user_role` (`username` ASC, `role` ASC) USING BTREE
UNIQUE INDEX `idx_user_role` (`username` ASC, `role` ASC) USING BTREE
);
CREATE TABLE `permissions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`role` varchar(50) NOT NULL COMMENT 'role',
`resource` varchar(128) NOT NULL COMMENT 'resource',
`action` varchar(8) NOT NULL COMMENT 'action',
PRIMARY KEY (`id`),
UNIQUE INDEX `uk_role_permission` (`role`,`resource`,`action`) USING BTREE
);

View File

@ -190,27 +190,21 @@ CREATE TABLE `tenant_info` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='tenant_info';
CREATE TABLE `users` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`username` varchar(50) NOT NULL COMMENT 'username',
`username` varchar(50) NOT NULL PRIMARY KEY COMMENT 'username',
`password` varchar(500) NOT NULL COMMENT 'password',
`enabled` boolean NOT NULL COMMENT 'enabled',
PRIMARY KEY (`id`)
`enabled` boolean NOT NULL COMMENT 'enabled'
);
CREATE TABLE `roles` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`username` varchar(50) NOT NULL COMMENT 'username',
`role` varchar(50) NOT NULL COMMENT 'role',
PRIMARY KEY (`id`),
UNIQUE INDEX `idx_user_role` (`username` ASC, `role` ASC) USING BTREE
UNIQUE INDEX `idx_user_role` (`username` ASC, `role` ASC) USING BTREE
);
CREATE TABLE `permissions` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
`role` varchar(50) NOT NULL COMMENT 'role',
`resource` varchar(128) NOT NULL COMMENT 'resource',
`action` varchar(8) NOT NULL COMMENT 'action',
PRIMARY KEY (`id`),
UNIQUE INDEX `uk_role_permission` (`role`,`resource`,`action`) USING BTREE
);