Hello everyone, Michael here, I’ve used MongoDB for 4 years now and there’s been one thing I have always wanted to solve which is auto-generating migration scripts whenever we make new changes to our schema.
Now, while this is not a MongoDB Philosophy, I believe there are many engineers like me out there who still once in a while like to bring relational database ideals into Mongo, one of them is migrations.
We have migrations in Mongo but we do not have a way to detect schema changes and create migration scripts to run just like Typeorm provides.
So I am currently building a utility that will solve this issue and I would love to get your input, let me know what you think.
Hey @Orson_Brice, thanks for the positive feedback! Will definitely keep you in the loop and will continually update everyone on the progress of the tool.
Glad to see that I am not the only one facing the issue.
Hey everyone, I want to give an update on this, I have not had the time to really work on this because of school and work, however, I just finished my trimester today and I get August as break, so I intend to use all of August to actually build this tool.
I am also making the tool open-source so I am happy to receive any contributions you want to provide, especially with the naming of the tool, right now, it’s called mongeese.
Here is the Github Repository if you’d like to contribute.
That sounds like a solid initiative, especially for industries handling sensitive data. At Aftermath Bail Bonds where accurate client records and legal case data matter, managing schema changes securely is critical. A tool that auto-generates migration scripts would really help reduce manual errors. Looking forward to your progress!Visit here: https://www.aftermathbailbonds.com/
Hey everyone, happy to announce that the tool has been built and is now stable for use and also ready for testing, really great that we did this in 20 days!
Please use and test in your projects wherever you need it.
Please note the following:
This tool will never do anything automatically for you unless you approve it.
This tool never actually reads the data from your database, in order to achieve data safety, it uses MongoDB’s powerful $sample operation to sample documents and then infer characteristics like type, existence, nullability, e.t.c.
This tool is open-source so please feel free to contribute whenever!
In order to use the cli tool, head straight to its npm package here - Mongeese CLI