opensrp/playbooks

Update OpenSRP Mybatis Migration Tasks

jasonrogena opened this issue · 0 comments

Update how the Mybatis migration tasks in the OpenSRP role are executed:

  • Update the name of this template file to something more appropriate like opensrp_mybatis_env.properties.j2
  • Run the Mybatis migrations as the OpenSRP PostgreSQL user, and not superuser.
Currently the task to grant access to the OpenSRP schemas to the opensrp postgreSQL user runs after the migration scripts. 
This should be reverted after migration is run as the OpenSRP postgres user and has owner of all the schamas in the database
  • Default the opensrp_postgresql_user_role_attr_flags variable in the OpenSRP role to LOGIN.
  • In the Mybatis migration properties file, remove the *_tablespace_location variables. Replace them with *_tablespace variables (a variable for each tablespace). Default all of these (the tablespace name) variables to pg_default in the role's default file.
  • Add the ability to create tablespaces (apart from just tablespace directories) in the PostgreSQL role (working branch is this). Suggested variable for defining the tablespaces to be created can look like below (you might have to remove the postgresql_tablespaces_dirs from the role), default the variable to a blank list so that tablespaces aren't created by default:
postgresql_tablespaces:
  - name: opensrp_core
    dir: /opt/postgresql/opensrp-core
  - name :opensrp_error
    dir: /opt/postgresql/opensrp-error
  • Update the version of the PostgreSQL role in the requirements file to one with the change above.

Related to opensrp/opensrp-server-configs#19