- 简化标签:将 "RPD Pro/Flash" 改为 "Pro/Flash",避免文字截断 - 添加账号类型徽章(Free/Pro/Ultra),带颜色区分 - 添加帮助图标(?),悬停显示限流政策和官方文档链接 - 重构显示布局:账号类型 + 两行配额(Pro/Flash) - 移除冗余的 AccountQuotaInfo 组件调用
36 lines
1.0 KiB
SQL
36 lines
1.0 KiB
SQL
-- +goose Up
|
||
-- +goose StatementBegin
|
||
-- 为 Gemini Code Assist OAuth 账号添加默认 tier_id
|
||
-- 包括显式标记为 code_assist 的账号,以及 legacy 账号(oauth_type 为空但 project_id 存在)
|
||
UPDATE accounts
|
||
SET credentials = jsonb_set(
|
||
credentials,
|
||
'{tier_id}',
|
||
'"LEGACY"',
|
||
true
|
||
)
|
||
WHERE platform = 'gemini'
|
||
AND type = 'oauth'
|
||
AND jsonb_typeof(credentials) = 'object'
|
||
AND credentials->>'tier_id' IS NULL
|
||
AND (
|
||
credentials->>'oauth_type' = 'code_assist'
|
||
OR (credentials->>'oauth_type' IS NULL AND credentials->>'project_id' IS NOT NULL)
|
||
);
|
||
-- +goose StatementEnd
|
||
|
||
-- +goose Down
|
||
-- +goose StatementBegin
|
||
-- 回滚:删除 tier_id 字段
|
||
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)
|
||
);
|
||
-- +goose StatementEnd
|