Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix global index deletion when projection type is INCLUDE #1604

Merged
merged 4 commits into from
Dec 28, 2023

Conversation

madhusudhand
Copy link
Contributor

Summary:

Fixes issue where index is deleted when projection is set to list of attributes instead of ALL.

Code sample:

Schema

const schema = new dynamoose.Schema(
    {
      id: {
        type: String,
        required: true,
        hashKey: true,
      },
      group: {
        type: String,
        required: true,
        index: {
            name: 'group-gsi',
            type: 'global',
            project: ['data1', 'data3', 'data2'],
        }
     },
     data1: String,
     data2: String,
     data3: String
);

Model

dynamoose.model('TableName', schema, {
  create: true,
  update: true,
});

GitHub linked issue:

Closes #1603

Type (select 1):

  • Bug fix
  • Feature implementation
  • Documentation improvement
  • Testing improvement
  • Test added to report bug (GitHub issue #---- @---)
  • Something not listed here

Is this a breaking change? (select 1):

  • 🚨 YES 🚨
  • No
  • I'm not sure

Is this ready to be merged into Dynamoose? (select 1):

  • Yes
  • No

Are all the tests currently passing on this PR? (select 1):

  • Yes
  • No

Other:

  • I have read through and followed the Contributing Guidelines
  • I have searched through the GitHub pull requests to ensure this PR has not already been submitted
  • I have updated the Dynamoose documentation (if required) given the changes I made
  • I have added/updated the Dynamoose test cases (if required) given the changes I made
  • I agree that all changes made in this pull request may be distributed and are made available in accordance with the Dynamoose license
  • All of my commits and commit messages are detailed, explain what changes were made, and are easy to follow and understand
  • I have filled out all fields above

@github-actions
Copy link
Contributor

github-actions bot commented May 18, 2023

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@madhusudhand madhusudhand changed the title fix global index deletion of projection INCLUDE type Fixes global index deletion when projection type is INCLUDE May 18, 2023
@madhusudhand
Copy link
Contributor Author

I dedicate any and all copyright interest in this software to the public domain. I make this dedication for the benefit of the public at large and to the detriment of my heirs and successors. I intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

@github-actions
Copy link
Contributor

This pull request is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 3 days.

@madhusudhand
Copy link
Contributor Author

Hey can you reopen and review this?

@madhusudhand
Copy link
Contributor Author

Hi, could you review and merge this change?
without this I cannot use indexes with specific projection list

@madhusudhand madhusudhand changed the title Fixes global index deletion when projection type is INCLUDE Fix global index deletion when projection type is INCLUDE Aug 3, 2023
@madhusudhand
Copy link
Contributor Author

@fishcharlie Could you please review this change and bring it in?

@madhusudhand
Copy link
Contributor Author

@fishcharlie can you consider merging this?

fishcharlie and others added 3 commits December 28, 2023 09:01
Signed-off-by: Charlie Fish <contact@charlie.fish>
Signed-off-by: Charlie Fish <contact@charlie.fish>
@fishcharlie fishcharlie merged commit 8750e5b into dynamoose:main Dec 28, 2023
15 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 28, 2023
@fishcharlie
Copy link
Member

@madhusudhand Sorry for the delay on this. Thank you for continuing to politely pester me.

@madhusudhand madhusudhand deleted the fix-1603 branch January 3, 2024 07:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Global indexes with projection attributes are deleted while updating the table.
2 participants