Creating Postgres Database
MyBatis Migrations
MyBatis migrations(http://www.mybatis.org/migrations) is used to create or migrate the database and to manage migrations.
Its is used to create the database objects i.e schema, tablespaces, tables, indexes in the postgres database.
Manual Installation of MyBatis Migrations
- Download the latest MyBatis Migrations from Github https://github.com/mybatis/migrations/releases
- Unzip the downloaded file.
- Set the PATH environment variable to include the bin folder in unzipped folder
- Type
migrate info
on the terminal to confirm migrate command has been set up successfully. You should see something similar to the below
Creating the OpenSRP database
- Create the OpenSRP user and database
- Create the OpenSRP tablespaces locations. These locations are in the .properties of the environment
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'
- To set up the database objects just run the command below(Make sure to update the username,password and database in .properties to reflect the details used in step 1)
migrate up --path=assets/migrations
This will set the database and create the prerequisite database objects e.g schema, tables, etc.
Edit context.xml and update the postgres user, password and database name
This site is no longer maintained. Please visit docs.opensrp.io for current documentation.