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

Feature request: Rake task to create/recreate index #443

Open
mooktakim opened this issue Jun 2, 2020 · 6 comments
Open

Feature request: Rake task to create/recreate index #443

mooktakim opened this issue Jun 2, 2020 · 6 comments

Comments

@mooktakim
Copy link

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.

@andrykonchin
Copy link
Member

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?

@mooktakim
Copy link
Author

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.

@andrykonchin
Copy link
Member

andrykonchin commented Jun 2, 2020

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).

@mooktakim
Copy link
Author

Thats great cheers.

@AlexGascon
Copy link
Contributor

@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

@andrykonchin
Copy link
Member

This issue is still in the backlog and I haven't started it yet. So contribution is welcome!

@andrykonchin andrykonchin reopened this Jul 23, 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

No branches or pull requests

3 participants