java - Create database upgrade diff with Liquibase -


i have 2 database schema files, both of them empty. let's there's version 1 , version 2 of database schema in db.v1.sql , db.v2.sql.

i'd create diff update database schema db.v1.sql db.v2.sql.

is liquibase capable that? there tool java?

yes, do-able using liquibase.

  1. create changelog.xml file lists .sql files separate changesets. think of file 'tempchangelog.xml' in file, add label attribute each of changesets "v1" or "v2".
  2. use liquibase update apply first label first database instance.
  3. use liquibase generatechangelog "convert" sql liquibase xml changesets. 'realchangelog.xml'
  4. modify 'realchangelog.xml add "v1" label attribute changesets.
  5. use liquibase update 'tempchangelog.xml' apply second label second database instance.
  6. use liquibase diffchangelog command compare database instance 1 database instance 2, appending changes 'realchangelog.xml'
  7. modify 'realchangelog.xml' again add "v2" labels new changesets.

you have changelog.xml can used update database either v1 or v2.

synchronizing new changes orm separate exercise.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -