4 ms·
Having done it the wrong way many times and a better way a few times, I can tell you that an ORM with migrations is a huge improvement.
by piyh 5y ago
Having done it the wrong way many times and a better way a few times, I can tell you that an ORM with migrations is a huge improvement.
- KronisLV 5y agoYep, something like Flyway or Liquibase in the Java world has always made a lot of sense, though you also should be able to explicitly say when you do/don't want to run said migrations (e.g. run different profiles). Of course, recently i've also found Dbmate (https://github.com/amacneil/dbmate https://github.com/amacneil/dbmate) which is a lightweight and language-agnostic tool that supports a variety of DBMSes (PostgreSQL, MySQL/MariaDB, SQLite and more recently even ClickHouse) and can be used for running SQL migration scripts regardless of what technologies that particular app uses (Java, .NET, Node, PHP and so on). Now, setting up the CI might be a little bit more difficult, but having one tool across all of the services in your architecture can be worth it!
- tianzhou 5y agoBytebase (https://github.com/bytebase/bytebase https://github.com/bytebase/bytebase) is another option. It has bulit-in integration with GitLab to achieve so called database-as-code (disclaimer: I am the author of it)