Tools

  • Liquibase (Java)
  • migrate (Nodejs)

How it works

  • Liquibase creates two additional tables inside each database:
    • DATABASECHANGELOG
    • DATABASECHANGELOGLOCK
  • It helps track the changes and remember which all migration scripts have run so far
  • If a new migration script exists in the source code then it will run them on your database server
  • It also creates a checksum, If there are changes on the database not done by liquibase, then it will simply fail

Recommendation

  • Do not modify the existing changeset, instead write new changeset
  • For example modifying the name of the table
  • You can modify existing changeset, if it is very necessary like, it introduced irrecoverable bugs
  • But changing existing changeset, will break the migration on any other database
  • https://www.liquibase.com/blog/dealing-with-changing-changesets