...
1) Open opensrp-server pom file and uncomment the postgres dependency in org.codehaus.mojo:sql-maven-plugin and comment out (or remove) the mysql:mysql-connector-java dependency
2) Open opensrp.properties file in opensrp-server/assets/config and make following changes in properties listed or image below
...
- org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.PostgreSQLDelegate
- org.quartz.dataSource.motechDS.driver = org.postgresql.Driver
- org.quartz.dataSource.motechDS.URL = jdbc:postgresql://localhost:5432/motechquartz (change server url and port according to your DBMS settings)
- change username and password according to your DBMS credentials from settings
- org.quartz.dataSource.motechDS.user = postgres
- org.quartz.dataSource.motechDS.password = postgrespwd
...
4) Open maven.properties in opensrp-server/build and change settings as below
...
5) Open opensrp-server/pom file and replace the executions between comments with following executions
Code Block | ||||
---|---|---|---|---|
| ||||
<!-- Database init scripts for DBMS specific configuration --> <execution> <id>drop-create-relational-db</id> <phase>pre-integration-test</phase> <goals> <goal>execute</goal> </goals> <configuration> <url>${jdbc.url-wo-db}</url> <autocommit>true</autocommit> <sqlCommand> drop database if exists ${db.quartz}; drop database if exists ${db.reporting}; create database ${db.quartz}; create database ${db.reporting}; </sqlCommand> <onError>abort</onError> </configuration> </execution> <execution> <id>create-opensrp-schemas</id> <phase>pre-integration-test</phase> <goals> <goal>execute</goal> </goals> <configuration> <url>${jdbc.url-wo-db}/${db.reporting}</url> <autocommit>true</autocommit> <sqlCommand> CREATE SCHEMA ${db.reporting.report} ; CREATE SCHEMA ${db.reporting.anm} ; </sqlCommand> <onError>abort</onError> </configuration> </execution> <!-- END: Database init scripts for DBMS specific configuration --> |
...
1) Open opensrp-server pom file and uncomment the mysql dependency in org.codehaus.mojo:sql-maven-plugin and comment out (or remove) the postgres dependency
2) Open opensrp.properties file in opensrp-server/assets/config and make following changes in properties listed or image below
...
4) Open maven.properties in opensrp-server/build and change setting below (removing the opensrp value here i.e. setting db name to empty is mandatory otherwise project does not build successfully). NOTE: Donot remove setting.
- db.reporting=
5) Open opensrp-server/pom file and replace the executions between comments with following executions
Code Block | ||||
---|---|---|---|---|
| ||||
<!-- Database init scripts for DBMS specific configuration --> <execution> <id>drop-create-relational-db</id> <phase>pre-integration-test</phase> <goals> <goal>execute</goal> </goals> <configuration> <url>${jdbc.url-wo-db}</url> <autocommit>true</autocommit> <sqlCommand> drop database if exists ${db.quartz}; drop database if exists ${db.reporting.anm}; drop database if exists ${db.reporting.report}; create database ${db.quartz}; create database ${db.reporting.anm}; create database ${db.reporting.report}; </sqlCommand> <onError>abort</onError> </configuration> </execution> <!-- END: Database init scripts for DBMS specific configuration --> |
...