Custom Sql scripts

Hi Guys,

As you know, currently if you are using spring boot version of Camunda, when application is started it creates all user tables. It’s brilliant. Is there a way that we can run custom scripts after Base scripts are run.

Use case: After DB is created, we want to automatically create an admin user and other test groups avoiding manual intervention.

Thanks for your time.

-Bharat

Answering my own question.

If we are using spring boot application, it may be a good idea to have ApplicationReadyEvent listener and call a DataGenerator. Something like https://github.com/camunda/camunda-bpm-platform/blob/master/examples/invoice/src/main/java/org/camunda/bpm/example/invoice/DemoDataGenerator.java

Indeed, one can use JPA but it is far from ideal.
If a better solutions exist, i’m more than happy to hear it. (eg using the mybatis scriptrunner)

@nvanbelle

May be Liquibase & ApplicationReadyEvent with below code?

		JdbcConnection liquibaseConnection = new JdbcConnection(connection);
		Liquibase liquibase = new Liquibase("liquibase/db.changelog-master.xml", new ClassLoaderResourceAccessor(),
				liquibaseConnection);
		liquibase.update("");