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 1 year 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

Very important feature

aashishjaria avatar Nov 12 '24 04:11 aashishjaria

Hey,👋 thanks for raising this! I'm going to transfer this over to our API repository for better assistance 🙂

ykethan avatar Nov 12 '24 15:11 ykethan

Any update on this?

aashishjaria avatar Dec 15 '24 17:12 aashishjaria