Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert Liquibase XML to YAML?

Can I automatically convert Liquibase changelog files in the XML format to the YAML format?

like image 722
user3364825 Avatar asked Apr 09 '14 16:04

user3364825


1 Answers

There is nothing built in, but you can easily do it with a little scripting.

Some starting points: liquibase.parser.ChangeLogParserFactory.getInstance().getParser(".xml", resourceAccessor).parse(...) will return a DatabaseChangeLog object representing the changelog file.

liquibase.serializer.ChangeLogSerializerFactory.getInstance().getSerializer(".ya‌​ml").write(...) will output the changeSets in the DatabaseChangeLog object out to a file in yaml format

like image 175
Nathan Voxland Avatar answered Sep 21 '22 11:09

Nathan Voxland