Files
codex-proxy-rs/backend/migrations/0044_account_quota_settings.sql
T
5b7f307bb2 feat(openai): warm up general quota buckets after reset (#725)
* feat(openai): warm up general quota buckets after reset

Co-authored-by: Codex <noreply@openai.com>

* fix(openai): distinguish stream quota facts from actual usage

Co-authored-by: Codex <noreply@openai.com>

---------

Co-authored-by: Zyy <zyycn@users.noreply.github.com>
Co-authored-by: Codex <noreply@openai.com>
2026-11-16 14:24:24 +08:00

12 lines
590 B
SQL

-- 将已有窗口上限保留为额度桶设置,预热默认关闭
alter table provider_accounts rename column quota_limits to quota_settings;
update provider_accounts a set quota_settings = (
select coalesce(jsonb_object_agg(key, jsonb_build_object('limitPercent', value, 'warmup', null)), '{}'::jsonb)
from jsonb_each(a.quota_settings)
);
-- 执行进度与管理配置分开,后台写入不发布配置版本
alter table provider_accounts
add column quota_warmup_state jsonb not null default '{}'::jsonb,
add column quota_warmup_revision bigint not null default 0;