dynamoid
dynamoid copied to clipboard
Feature request: Rake task to create/recreate index
Hi,
The rake task dynamoid:create_tables
is helpful for creating all the tables the first time you deploy. But over time I found myself needing to change the schema.
I understand a rake task to modify the table would be complicated (risk of losing data). But it would be really handy if there was a rake task to create only index's defined in the model.
We would be able to delete and create index without risk of losing data.
Sounds reasonable. I wasn't sure whether table schema migration is useful as far as it's usually changed manually in AWS Console (or maybe with terraform or some similar tool).
I'm wondering what is your use case. Do you need to add indexes in development environment locally or in staging/production?
Maybe its not a normal thing to do, but recently i've been creating different index's to get the result i'm looking for. I wish i didn't need to use aws console to make these changes. I have dev and prod environment. Its a lot of work making sure changes are replicated. I haven't used terraform, but thats how people solve this problem. I have a rails project.
I believe it's easy enough just to add a Rake task to update indexes - delete excessive and add missing indexes.
Will add it in the next release (in ~1-2 months).
Thats great cheers.
@andrykonchin Is this already being worked on? If not, are you accepting contributions for it? I'd benefit from having this feature on one of my projects, so I'll be happy to help to introduce it directly on Dynamoid
This issue is still in the backlog and I haven't started it yet. So contribution is welcome!