Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I use liquibase at work because there was a large marketing campaign saying this was the standard for db schema versioning in the java world. Now that I look at flyway, it seems to be a tiny bit better... I had mixed results with liquibase, if you don't use the xml changeSets you are in for a ride and its not that easy to do a simple diff on two databases. It kinda works but feels iffy...

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?



> if you don't use the xml 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.


I haven't used it for 15 years, but this is exactly what I used to do. I felt like using SQL helped me understand what was actually happening to the database and having a tool that automatically did the right thing for applying those snippets between versions was great.

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.


cfgbvcsbmn


Be careful, or you could end up in the same situation with Flyway. I'm not sure how many contributors are employed or paid by Redgate Software. But what's to stop them from doing the same to Flyway once their competitor has made this change to Liquibase?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: