chore: replace 'token' with power

This commit is contained in:
RockYang
2024-02-23 18:11:57 +08:00
parent 66c0d1b2f7
commit 668d4c9c64
11 changed files with 397 additions and 212 deletions

View File

@@ -0,0 +1,23 @@
-- 删除用户名重复的用户,只保留一条
DELETE FROM chatgpt_users
WHERE username IN (
SELECT username
FROM (
SELECT username
FROM chatgpt_users
GROUP BY username
HAVING COUNT(*) > 1
) AS temp
) AND id NOT IN (
SELECT MIN(id)
FROM (
SELECT id, username
FROM chatgpt_users
GROUP BY id, username
HAVING COUNT(*) > 1
) AS temp
GROUP BY username
);
-- 给 username 字段建立唯一索引
ALTER TABLE `chatgpt_users` ADD UNIQUE(`username`)