mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-27 03:14:11 +00:00
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:
+14
@@ -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;
|
||||
@@ -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
|
||||
|
||||
-1
@@ -195,7 +195,6 @@ export type QuotaPeriod = (typeof QuotaPeriod)[keyof typeof QuotaPeriod]
|
||||
export const QuotaResourceType = {
|
||||
agent_total_tokens: 'agent_total_tokens',
|
||||
agent_cost: 'agent_cost',
|
||||
agent_skill_call_count: 'agent_skill_call_count',
|
||||
agent_mcp_call_count: 'agent_mcp_call_count',
|
||||
agent_bash_call_count: 'agent_bash_call_count',
|
||||
agent_tool_call_count: 'agent_tool_call_count'
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user