Skip to content

Commit

Permalink
feat: add date index to uploads table
Browse files Browse the repository at this point in the history
The last piece of the blocking workflow that's not possible right now is being able to get a list of recent uploads. Add an index to the upload table to enable this.

I think this is the right thing to do for now while we figure out what kind of data warehousing setup we want, but we may want to consider removing this later.
  • Loading branch information
travis committed Aug 21, 2023
1 parent e742d65 commit 43b169d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion upload-api/tables/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export const uploadTableProps = {
// space + root must be unique to satisfy index constraint
primaryIndex: { partitionKey: 'space', sortKey: 'root' },
globalIndexes: {
cid: { partitionKey: 'root', projection: ['space', 'insertedAt'] }
cid: { partitionKey: 'root', projection: ['space', 'insertedAt'] },
date: { partitionKey: 'insertedAt' , projection: ['root', 'space']}
}
}

Expand Down

0 comments on commit 43b169d

Please sign in to comment.