Generate Liquibase Scripts Automatically
Following up on https://github.com/corda/corda/issues/6812 since 4.6 you need to specify Liquibase scripts for schemas.
This is really tedious to do by hand.
If you start the node with the right parameters hibernate will generate the schema for you:
java -jar corda.jar --allow-hibernate-to-manage-app-schema
You can't do this in production though so you need to create the Liquibase scripts.
You can generate these automatically with the following:
./liquibase --driver=org.h2.Driver --changeLogFile=schema.xml --url=jdbc:h2:~/Projects/my-corda-app/build/nodes/ClientName/persistence --username=sa --includeObjects=table:CUSTOM_STATE,table:SECOND_STATE generateChangeLog
This isn't perfect as it almost certainly wont have the right author and id in it, however, it saves you writing it all from scratch.
Corda should do this automatically for you on request to save time and improve the development experience.
Created by github action.