Skip to content
This repository has been archived by the owner on Jan 21, 2021. It is now read-only.

Commit

Permalink
Merge ef90428 into 5e8fb1c
Browse files Browse the repository at this point in the history
  • Loading branch information
manutarus committed Sep 19, 2018
2 parents 5e8fb1c + ef90428 commit 3554a9b
Show file tree
Hide file tree
Showing 165 changed files with 14,783 additions and 3,156 deletions.
3 changes: 2 additions & 1 deletion assets/config/couchdb.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#this file is used by motech
host=localhost
port=5984
maxConnections=20
connectionTimeout=1000
socketTimeout=10000
username=rootuser
password=adminpass
password=adminpass
5 changes: 3 additions & 2 deletions assets/config/opensrp.properties
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ openmrs.idgen.url=/module/idgen/exportIdentifiers.form
openmrs.idgen.initial.batchsize=300000
openmrs.idgen.batchsize=100
openmrs.idgen.idsource=1
openmrs.version=2.1.3
#supported versions 1.11x and 2x

dhis2.url=http://dhis2.mpower-social.com:8080/api/
dhis2.username=path
Expand Down Expand Up @@ -58,7 +60,6 @@ jdbc.url-wo-db=jdbc:mysql://localhost:3306

# Hibernate properties for Reporting DB
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.show_sql=false
# hibernate.hbm2ddl.auto=update
hibernate.show_sql=true
hibernate.format_sql=false
Expand Down Expand Up @@ -98,4 +99,4 @@ opensrp.authencation.cache.ttl=600
redis.host=localhost
redis.port=6379
redis.password=RedI$P@S5
redis.pool.max.connections=25
redis.pool.max.connections=25
1 change: 1 addition & 0 deletions assets/config/schedule_tracking.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#this file is used by motech
schedule.definitions.directory=/schedules
2 changes: 1 addition & 1 deletion assets/migrations/environments/development.properties
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@ core_tablespace_location='/opt/postgres/core'
error_tablespace_location ='/opt/postgres/error'
schedule_tablespace_location='/opt/postgres/schedule'
feed_tablespace_location='/opt/postgres/feed'
form_tablespace_location='/opt/postgres/form'
form_tablespace_location='/opt/postgres/form'
16 changes: 13 additions & 3 deletions assets/migrations/generator/generatorConfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,20 @@
<javaClientGenerator targetPackage="org.opensrp.repository.postgres.mapper"
targetProject="opensrp-core" type="XMLMAPPER" />

<!-- <table schema="core" tableName="client">
<table schema="core" tableName="client">
<columnOverride column="json"
typeHandler="org.opensrp.repository.postgres.handler.ClientTypeHandler" />
</table>
<table schema="core" tableName="event">
<columnOverride column="json"
typeHandler="org.opensrp.repository.postgres.handler.EventTypeHandler" />
</table>

<!--<table schema="core" tableName="action">
<table schema="core" tableName="action">
<columnOverride column="json"
typeHandler="org.opensrp.repository.postgres.handler.ActionTypeHandler" />
</table>
Expand Down Expand Up @@ -52,7 +56,13 @@
<table schema="core" tableName="alert_metadata" />
<table schema="core" tableName="app_state_token" />
<table schema="core" tableName="multi_media" />
<table schema="error" tableName="error_trace" /> -->
<table schema="error" tableName="error_trace" />
<table schema="core" tableName="view_configuration">
<columnOverride column="json"
typeHandler="org.opensrp.repository.postgres.handler.ViewConfigurationTypeHandler" />
</table>
<table schema="core" tableName="view_configuration_metadata" /> -->

</context>
</generatorConfiguration>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ WITH (
OIDS = FALSE
) TABLESPACE core_space;


CREATE INDEX alert_metadata_composite_index ON core.alert_metadata (base_entity_id,provider_id,server_version,trigger_name);


Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--
-- Copyright 2010-2016 the original author or authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--

-- // create view configurations table
-- Migration SQL that makes the change goes here.
CREATE TABLE core.view_configuration
(
id bigserial NOT NULL,
json jsonb NOT NULL,
PRIMARY KEY (id)
)
WITH (
OIDS = FALSE
)


-- //@UNDO
-- SQL to undo the change goes here.
DROP TABLE core.view_configuration

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
--
-- Copyright 2010-2016 the original author or authors.
--
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
-- You may obtain a copy of the License at
--
-- http://www.apache.org/licenses/LICENSE-2.0
--
-- Unless required by applicable law or agreed to in writing, software
-- distributed under the License is distributed on an "AS IS" BASIS,
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-- See the License for the specific language governing permissions and
-- limitations under the License.
--

-- // create view configurations metadata table
-- Migration SQL that makes the change goes here.

CREATE TABLE core.view_configuration_metadata
(
id bigserial NOT NULL,
view_configuration_id bigint REFERENCES core.view_configuration (id),
document_id character varying UNIQUE NOT NULL,
identifier varchar UNIQUE,
server_version bigint,
PRIMARY KEY (id)
)
WITH (
OIDS = FALSE
);

-- //@UNDO
-- SQL to undo the change goes here.
DROP TABLE core.view_configuration_metadata;

42 changes: 42 additions & 0 deletions assets/tbreach_default_view_configs/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
This folder contains the default view configuration json files as deployed with this Release Version of TB Reach as well as the Shell Script to populate the db with them.

The script works with both postgres and couchdb.

For couchDb
Make sure you have set up couch database on this machine and that couch is accessible via port 5894 (You can modify the script if you use a different port)
Run the command below:

./setup_view_configs.sh -d <database name> (e.g. ./setup_view_configs.sh -d opensrp_tbreach)

For Postgres

You must specify the parameter -t with value postgres. The default is couchdb
Make sure you have set up postgres database on this machine and that postgres is accessible via port 5432 (You can modify the script if you use a different port)
Run the command below:

./setup_view_configs.sh -t postgres -u <postgres_user> -pwd <postgres _user_password> -d opensrp -d <database name> (e.g. ./setup_view_configs.sh -t postgres -u opensrp_admin -pwd admin -d opensrp_tbreach)

Run ./setup_view_configs.sh --help to get a list of available options

Specify (Optional) database type like ./setup_view_configs.sh -t postgres

Specify (Optional) a database name like ./setup_view_configs.sh -d <database name>

Specify (Optional) a host like  ./setup_view_configs.sh -h <hostname>

Specify (Optional) a port name like  ./setup_view_configs.sh -p <port>

Specify (Optional) a source folder like  ./setup_view_configs.sh -f <folder path>

Specify (Optional) a username like  ./setup_view_configs.sh -u <username>

Specify (Optional) a password like  ./setup_view_configs.sh -pwd <password>

Specify (Optional) a protocol e.g. http or https like  ./setup_view_configs.sh -proto <protocol>

Specify (Optional) any multiple arguments like  ./setup_view_configs.sh -u <username> -pwd <password> -d <database name>

For Authentication you can choose to pass the username and password as part of the host e.g.  ./setup_view_configs.sh -h http://<username>:<password>@<hostname>

Happy Coding :)

Loading

0 comments on commit 3554a9b

Please sign in to comment.