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 MigrateRunner._createMigrateTableIfNotExists #3

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

sean-krail
Copy link

@sean-krail sean-krail commented Dec 10, 2019

Same as noppoMan#72


_createMigrateTableIfNotExists now works when there are more than 100 tables (DynamoDB has a soft limit of 256 tables per region). Say you have 101 tables table1 through table100 and your migration history table's name is table101, the function thinks the migration history table doesn't exist, tries to create it, and then throws a ResourceInUseException since it really does exist.

Changes

  • renamed _createMigrateTableIfNotExits to _createMigrateTableIfNotExists
  • _createMigrateTableIfNotExists now uses describeTable instead of listTables to figure out if the migration history table already exists. This change was made since listTables uses pagination which defaults to 100 and describeTable can fetch one table by name.

@hiradp
Copy link

hiradp commented Dec 10, 2019

@sean-krail @tmercswims - I'm going to merge this PR's branch to my branch for #1. I can then tell my package json to point to jitterbit/npdynamodb#branch-name and it'll fetch the dependency from there.

@tmercswims tmercswims merged commit 6e087ca into master Jan 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants