From d3f7b134892b6c5ea794e9e7dd4811b27cdf6eb1 Mon Sep 17 00:00:00 2001 From: Pavel Denisjuk Date: Wed, 17 May 2023 00:34:05 +0200 Subject: [PATCH] fix(api-page-builder-so-ddb-es): add missing GSI index definition --- .../src/definitions/table.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/packages/api-page-builder-so-ddb-es/src/definitions/table.ts b/packages/api-page-builder-so-ddb-es/src/definitions/table.ts index 9d48980526c..9e9a52d54fc 100644 --- a/packages/api-page-builder-so-ddb-es/src/definitions/table.ts +++ b/packages/api-page-builder-so-ddb-es/src/definitions/table.ts @@ -1,7 +1,7 @@ -import { TableModifier } from "~/types"; -import { DocumentClient } from "aws-sdk/clients/dynamodb"; import { Table } from "dynamodb-toolbox"; +import { DocumentClient } from "aws-sdk/clients/dynamodb"; import { TableConstructor } from "dynamodb-toolbox/dist/classes/Table"; +import { TableModifier } from "~/types"; interface Params { table?: TableModifier; @@ -12,7 +12,13 @@ export const createTable = ({ table, documentClient }: Params): Table => { name: process.env.DB_PAGE_BUILDER || (process.env.DB_TABLE as string), partitionKey: "PK", sortKey: "SK", - DocumentClient: documentClient + DocumentClient: documentClient, + indexes: { + GSI1: { + partitionKey: "GSI1_PK", + sortKey: "GSI1_SK" + } + } }; const config = typeof table === "function" ? table(tableConfig) : tableConfig;