Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

主键索引正常,却提示不规范。 #255

Closed
Beacan opened this issue Jun 3, 2020 · 0 comments
Closed

主键索引正常,却提示不规范。 #255

Beacan opened this issue Jun 3, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@Beacan
Copy link

Beacan commented Jun 3, 2020

建表语句:

CREATE TABLE table_test (
id bigint unsigned NOT NULL AUTO_INCREMENT COMMENT 'auto id',
column1 varchar(50) NOT NULL DEFAULT '' COMMENT 'column1',
column2 varchar(50) NOT NULL DEFAULT '' COMMENT 'column2',
column3 varchar(150) NOT NULL DEFAULT '' COMMENT 'column3',
column4 varchar(255) NOT NULL DEFAULT '' COMMENT 'column4',
column5 varchar(20) NOT NULL DEFAULT '' COMMENT 'column5',
ctime datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'ctime',
mtime datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'mtime',
PRIMARY KEY (id),
KEY idx_column2 (column2),
KEY idx_column3 (column3)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci COMMENT = 'this is a test table';

提示:

未指定主键或主键非 int 或 bigint
Item: KEY.007
Severity: L4
Content: 未指定主键或主键非 int 或 bigint,建议将主键设置为 int unsigned 或 bigint unsigned。

@martianzhang martianzhang added the bug Something isn't working label Jun 3, 2020
@Beacan Beacan closed this as completed Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants