fix(quota): exclude agents from quota rules and usage records (#325)

* fix(quota): exclude agents from quota rules and usage records

* refactor(quota): remove agent_skill_call_count resource type and related logic

* chore(db): replace manual migration with prisma-generated migration
This commit is contained in:
Yiling-J
2026-08-18 11:56:03 +08:00
committed by GitHub
parent f806272c06
commit 8a75d015a1
22 changed files with 127 additions and 318 deletions
@@ -0,0 +1,14 @@
/*
Warnings:
- The values [agent_skill_call_count] on the enum `QuotaResourceType` will be removed. If these variants are still used in the database, this will fail.
*/
-- AlterEnum
BEGIN;
CREATE TYPE "QuotaResourceType_new" AS ENUM ('agent_total_tokens', 'agent_cost', 'agent_mcp_call_count', 'agent_bash_call_count', 'agent_tool_call_count');
ALTER TABLE "quota_rules" ALTER COLUMN "resource" TYPE "QuotaResourceType_new" USING ("resource"::text::"QuotaResourceType_new");
ALTER TYPE "QuotaResourceType" RENAME TO "QuotaResourceType_old";
ALTER TYPE "QuotaResourceType_new" RENAME TO "QuotaResourceType";
DROP TYPE "public"."QuotaResourceType_old";
COMMIT;
-1
View File
@@ -151,7 +151,6 @@ enum QuotaPeriod {
enum QuotaResourceType {
agent_total_tokens
agent_cost
agent_skill_call_count
agent_mcp_call_count
agent_bash_call_count
agent_tool_call_count