From 298f36f145e11541885810c9f07b9d1853226717 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E7=BF=8A=20SionYang?= Date: Mon, 22 Jul 2024 12:10:17 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"Add=20an=20id=20primary=20key=20colum?= =?UTF-8?q?n=20to=20both=20the=20roles=20and=20permissions=20tables.?= =?UTF-8?q?=EF=BC=88mysql-schema.sql=EF=BC=89=20(#12206)"=20(#12396)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 5d871967eadef5476da0b4f52dac1f1d0a693eb1. --- config/src/main/resources/META-INF/mysql-schema.sql | 12 +++--------- distribution/conf/mysql-schema.sql | 12 +++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/config/src/main/resources/META-INF/mysql-schema.sql b/config/src/main/resources/META-INF/mysql-schema.sql index 58437fb0fa8..fe521426b3d 100644 --- a/config/src/main/resources/META-INF/mysql-schema.sql +++ b/config/src/main/resources/META-INF/mysql-schema.sql @@ -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 ); diff --git a/distribution/conf/mysql-schema.sql b/distribution/conf/mysql-schema.sql index 1fd982534e1..d3c06606e13 100644 --- a/distribution/conf/mysql-schema.sql +++ b/distribution/conf/mysql-schema.sql @@ -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 );