The "dirty secret" of golang-migrate
Editor's note: Dear Reader, please accept my sincere apologies for the blatant dad joke in the title. Being a father of two, I couldn't resist the pun. -RT
Atlas was originally created to support Ent, a popular Go ORM. From the start, Ent shipped with a simple "auto-migration" feature that could set up the database schema based on the Ent schema. However, as the project grew popular, it became clear that a more robust, versioned migration system was needed.
Our team did not originally set out to build a new migration tool; Ent's authors had hoped to add functionality to generate
migration files based on the existing "auto-migration" engine and use an off-the-shelf migration tool to apply them.
The most promising candidate was golang-migrate
, a widely adopted migration tool in the Go community which was
renowned for its simplicity and wide database support.
But like many tools that start simple and grow popular, we realized that golang-migrate
begins to show its limitations as projects -
and teams - scale. In this post, we'll review some of the issues we encountered with golang-migrate
and how they
ultimately led us to build Atlas.