Skip to content

Commit

Permalink
feat: add CID index to store table (#221)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
travis authored Aug 24, 2023
1 parent e742d65 commit ef45229
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions upload-api/tables/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit ef45229

Please sign in to comment.