Files
codex-proxy-rs/backend/migrations/0042_usage_retention_days.sql
T
f61995e61d feat(settings): remove request history retention cap (#702)
* feat(settings): remove request history retention cap

Allow positive retention days beyond 31 throughout the form, domain rules,
and database constraint. Keep the existing default and saved settings.
Bound cleanup and account usage queries by stored data so large retention
windows remain safe without expanding empty history.

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

* test(admin): align retention policy coverage with positive windows

Accept long request retention windows while preserving zero rejection
for each target and independent event and audit retention settings.

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-13 17:29:21 +08:00

8 lines
330 B
SQL

-- 保留期仅要求正整数天数,沿用当前设置与默认值
alter table runtime_settings drop constraint runtime_settings_retention_ck;
alter table runtime_settings add constraint runtime_settings_retention_ck check (
usage_retention_days > 0
and ops_event_retention_days > 0
and audit_retention_days > 0
);