During my frustrations I read blogposts saying you can implement schema version changes easily by yourself and I kind of see it... You have to do the thinking by yourself anyway when you declare changeSets?
During my frustrations I read blogposts saying you can implement schema version changes easily by yourself and I kind of see it... You have to do the thinking by yourself anyway when you declare changeSets?
I find it crazier that people use xml changesets.
My setup is to use sql files versioned by date. Each file has changsets (regions demarcated by comments) for single transaction actions (like creating a database), along with it's rollback actions written as comments in it's respective changeset.
I don't trust rollbacks, I mostly use them for dev purposes for scripts that are wip. If i have to "undo" changes to a db, better to write specific scripts that revert the actions (i.e. manually move columns around to a tmp table).
I essentially just use liquibase as a language-agnostic db-migration tool that can connect ot a db and run a series of sql files. I could write scripts for that, but it's nice to have a third-party solution.
For example, think of one install going from 1.0.0 > 1.0.2 while another is going from 1.0.0 > 1.1.0. Sure, you could write something to do that yourself, but I'd rather use an existing library that already covers tons of edge cases.
The number of Docker containers I've used that need to be rolled through a special incantation of several versions to get things upgraded cleanly make me shake my head sometimes. Every time I have to do that I still think of Liquibase and wish that I could just grab the most recent version and have the database schema magically updated like I could do with Java apps 2 decades ago.