Files
AgentCompany/src/main/database/migrations/022-provider-rate-limit-observations.ts
T
ZacharyZhang-NY 07d0b4587d Promote AgentCompany-New to the repository root and retire the old app
The legacy application - its src, tests, landing site, promo assets, docs,
release tooling, CI workflows, and root configs - leaves the tree; it stays
reachable in history. Everything under AgentCompany-New moves up unchanged:
same package name, so the production userData/database path is untouched,
and e2e/build scripts already resolved paths relative to the project. The
developer cred.txt stays gitignored at its new location. Full verify:ci
passes from the new root.
2026-07-07 00:04:13 -04:00

22 lines
802 B
TypeScript

export const providerRateLimitObservationSchema = `
create table if not exists provider_rate_limit_observations (
id text primary key,
org_id text not null references organizations(id) on delete cascade,
provider_id text not null references providers(id) on delete cascade,
provider_key text not null,
model text,
request_limit integer,
remaining_requests integer,
reset_at text,
retry_after_ms integer,
raw_state_json text not null,
observed_at text not null
);
create index if not exists idx_provider_rate_limit_observations_org_provider
on provider_rate_limit_observations(org_id, provider_id, observed_at desc);
insert into schema_migrations(version, name, applied_at)
values (22, 'provider_rate_limit_observations', datetime('now'));
`;