feat: add database migration script

This commit is contained in:
JustSong
2023-05-16 11:36:00 +08:00
parent bcb4862a19
commit 9537e47430
2 changed files with 9 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
UPDATE users
SET quota = quota + (
SELECT SUM(remain_quota)
FROM tokens
WHERE tokens.user_id = users.id
)