Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Revert "Add an id primary key column to both the roles and permission… #12396

Merged
merged 1 commit into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions config/src/main/resources/META-INF/mysql-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

12 changes: 3 additions & 9 deletions distribution/conf/mysql-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Loading