how to run sql script when nuxeo instance starts

Hi, we want to run sql script when our nuxeo instance starts. This script should create tables in database if this not exists. We do not want to use schemas contributions because we do not want to manage those rows tables as documents types.

We want to do something equals to nxp_logs because we will use those tables for stats

0 votes

1 answers

2397 views

ANSWER



Hello,

You can configure VCS to do so. The documentation is here :

http://doc.nuxeo.com/display/ADMINDOC/VCS+Configuration

You have to specify a script in the sqlInitFile tag (See database creation option). This scripts holds some commands to pass to the backend given some condictions. As stated in the doc, you'll find some samples here https://github.com/nuxeo/nuxeo-core/tree/master/nuxeo-core-storage-sql/nuxeo-core-storage-sql/src/main/resources/nuxeovcs

1 votes