feat(db): update Asset.sizeByte and AiUsage token fields to BigInt

This commit is contained in:
yiling
2026-07-29 20:14:23 +08:00
parent 5b19cfe98e
commit f161437797
17 changed files with 400 additions and 265 deletions
+2 -2
View File
@@ -1263,7 +1263,7 @@ describe('Agent Database Activities Integration', () => {
const parentFolder = await prisma.asset.findUnique({ where: { id: folder.id } })
expect(parentFolder?.fileCount).toBe(1)
expect(parentFolder?.sizeByte).toBe(500)
expect(Number(parentFolder?.sizeByte)).toBe(500)
expect(uploadService.triggerPostUploadWorkflows).toHaveBeenCalled()
})
})
@@ -1372,7 +1372,7 @@ describe('Agent Database Activities Integration', () => {
})
expect(updatedStack?.fileCount).toBe(2)
expect(updatedStack?.sizeByte).toBe(350)
expect(Number(updatedStack?.sizeByte)).toBe(350)
})
})
})
+5 -5
View File
@@ -1122,7 +1122,7 @@ export async function executeAgentToolActivity(params: ExecuteAgentToolParams):
id: a.id,
name: a.name,
type: a.type,
size: a.sizeByte,
size: Number(a.sizeByte),
}))
return {
@@ -1160,7 +1160,7 @@ export async function executeAgentToolActivity(params: ExecuteAgentToolParams):
id: newFolder.id,
name: newFolder.name,
type: newFolder.type,
size: newFolder.sizeByte,
size: Number(newFolder.sizeByte),
}
}
@@ -1232,7 +1232,7 @@ export async function executeAgentToolActivity(params: ExecuteAgentToolParams):
id: newFile.id,
name: newFile.name,
type: newFile.type,
size: newFile.sizeByte,
size: Number(newFile.sizeByte),
}
}
@@ -1332,7 +1332,7 @@ export async function executeAgentToolActivity(params: ExecuteAgentToolParams):
id: newFile.id,
name: newFile.name,
type: newFile.type,
size: newFile.sizeByte,
size: Number(newFile.sizeByte),
}
} else {
// Parent is a regular file. We must create a new version stack.
@@ -1381,7 +1381,7 @@ export async function executeAgentToolActivity(params: ExecuteAgentToolParams):
id: newFile.id,
name: newFile.name,
type: newFile.type,
size: newFile.sizeByte,
size: Number(newFile.sizeByte),
}
}
}