修复账号大小写敏感校验
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
CREATE DATABASE IF NOT EXISTS jayu_cloud DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
|
||||
use jayu_cloud;
|
||||
|
||||
DROP PROCEDURE IF EXISTS sp_jy_modify_user_account_collation_if_needed;
|
||||
DELIMITER $$
|
||||
CREATE PROCEDURE sp_jy_modify_user_account_collation_if_needed()
|
||||
BEGIN
|
||||
IF EXISTS (
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 't_user'
|
||||
AND column_name = 'account'
|
||||
AND collation_name <> 'utf8mb4_bin'
|
||||
) THEN
|
||||
ALTER TABLE t_user
|
||||
MODIFY COLUMN account varchar(50)
|
||||
CHARACTER SET utf8mb4
|
||||
COLLATE utf8mb4_bin
|
||||
NOT NULL
|
||||
COMMENT '用户账号(登录用)';
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
||||
CALL sp_jy_modify_user_account_collation_if_needed();
|
||||
|
||||
DROP PROCEDURE IF EXISTS sp_jy_modify_user_account_collation_if_needed;
|
||||
Reference in New Issue
Block a user