From ef452294c9c903f052d47a1349445ac44d51c7b7 Mon Sep 17 00:00:00 2001 From: Travis Vachon Date: Thu, 24 Aug 2023 09:44:13 -0700 Subject: [PATCH] feat: add CID index to store table (#221) We need to be able to figure out which space a CAR CID was added to. Not adding anything more than the Dynamo index for now because: a) we use the Dynamo console for blocking for now and b) we haven't designed the capabilities that will use this yet this supercedes https://github.com/web3-storage/w3infra/pull/121/files --- upload-api/tables/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/upload-api/tables/index.js b/upload-api/tables/index.js index ad5c6ff3..09d334e2 100644 --- a/upload-api/tables/index.js +++ b/upload-api/tables/index.js @@ -13,6 +13,9 @@ export const storeTableProps = { }, // space + link must be unique to satisfy index constraint primaryIndex: { partitionKey: 'space', sortKey: 'link' }, + globalIndexes: { + cid: { partitionKey: 'link', sortKey: 'space', projection: ['space', 'insertedAt'] } + } } /** @type TableProps */