feat(migrations): 改进校验和错误提示和文档

- 增强迁移校验和不匹配的错误信息,提供具体解决方案
- 添加 migrations/README.md 文档说明迁移最佳实践
- 明确迁移不可变原则和正确的修改流程
This commit is contained in:
ianshaw
2025-12-31 18:06:42 -08:00
parent 0fd1e9c5e6
commit eee5c0ac0b
3 changed files with 188 additions and 7 deletions

View File

@@ -26,10 +26,5 @@ UPDATE accounts
SET credentials = credentials - 'tier_id'
WHERE platform = 'gemini'
AND type = 'oauth'
AND jsonb_typeof(credentials) = 'object'
AND credentials->>'tier_id' = 'LEGACY'
AND (
credentials->>'oauth_type' = 'code_assist'
OR (credentials->>'oauth_type' IS NULL AND credentials->>'project_id' IS NOT NULL)
);
AND credentials->>'oauth_type' = 'code_assist';
-- +goose StatementEnd