Create a table including TTL setting with :table_name keyword argument #579
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thank you for your maintenance.
This PR resolves an error that occurs when it calls
.create_table
withtable_name
keyword for a Model with TTL set.A simple reproduced code is below,
This is because when setting TTL with
.create_table
, the table name based onDynamoid.config.namespace
is used instead of the keyword argument:table_name
. In this case, changing to use the value of:table_name
would solve this problem.My practical use case is to create tables during development using the
db:create
hook in Ruby on Rails. I need to create a table for development and a table for testing during development, and call.create_table
for each environment. The:table_name
keyword argument is required to create the table for testing.