This commit is contained in:
beabigegg
2025-10-03 08:19:40 +08:00
commit 6599716481
99 changed files with 28184 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
-- 合併重複的使用者記錄
-- 保留 ID=3 的記錄 (較新且有較多關聯資料)
-- 將 ID=1 的關聯資料轉移到 ID=3然後刪除 ID=1
-- 1. 將 ID=1 的 system_logs 轉移到 ID=3
UPDATE dt_system_logs SET user_id = 3 WHERE user_id = 1;
-- 2. 確認沒有其他關聯資料需要轉移
-- (dt_translation_jobs, dt_api_usage_stats 都已經在 ID=3)
-- 3. 刪除重複的記錄 ID=1
DELETE FROM dt_users WHERE id = 1;
-- 4. 驗證結果
SELECT 'After merge:' as status;
SELECT id, username, display_name, email FROM dt_users WHERE email = 'ymirliu@panjit.com.tw';
SELECT 'Jobs:', COUNT(*) FROM dt_translation_jobs WHERE user_id = 3;
SELECT 'Logs:', COUNT(*) FROM dt_system_logs WHERE user_id = 3;
SELECT 'Stats:', COUNT(*) FROM dt_api_usage_stats WHERE user_id = 3;