amplify-category-api icon indicating copy to clipboard operation
amplify-category-api copied to clipboard

Ability to create Local Secondary Index for AppSync Model table

Open NiharikaBaliboyna9 opened this issue 11 months ago • 3 comments

Environment information

NA

Describe the feature

Currently we can only crease GSI for the data models in Amplify.


ChartOfAccount: a
    .model({
      orgId: a.id().required(),
      accountName: a.string().required(),
      accountDescription: a.string(),
      categoryName: a.string().required(),
      categoryType: a.string().required(),}) //ex: "INCOME", "EXPENSE", "ASSET", 
    .identifier(["orgId", "accountName"])
    .secondaryIndexes((index) => [index("orgId").sortKeys(["categoryName"])])
    .authorization((allow) => [allow.owner()]),
});

There is no option to create Local Secondary Index for the model. Unable to update/add using the backend.ts as the table would be already created by then and the LSI should be created with the table.

Use case

To create and use Local Secondary Index for the data models in amplify.

NiharikaBaliboyna9 avatar Nov 09 '24 09:11 NiharikaBaliboyna9