Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update OpenSRP Mybatis Migration Tasks #88

Open
4 of 6 tasks
jasonrogena opened this issue Jul 12, 2019 · 0 comments
Open
4 of 6 tasks

Update OpenSRP Mybatis Migration Tasks #88

jasonrogena opened this issue Jul 12, 2019 · 0 comments

Comments

@jasonrogena
Copy link
Contributor

jasonrogena commented Jul 12, 2019

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

jasonrogena added a commit that referenced this issue Aug 29, 2019
Rename the OpenSRP development properties template to
opensrp_mybatis_env, which is in line with #88

Related to #88

Signed-off-by: Jason Rogena <[email protected]>
jasonrogena added a commit that referenced this issue Aug 29, 2019
Run the Mybatis migrations as the OpenSRP database user once the user
has been given all privileges to the database. This therefore means that
the user doesn't need to be granted access to the schemas (since they're
the ones creating the schemas in the first place).

Also add variables for specifying the OpenSRP tablespace names (instead
of directories). Change was introduced in OpenSRP Server version
v1.2.18-SNAPSHOT.

- https://github.com/OpenSRP/opensrp-server-web/releases/tag/v1.2.18-SNAPSHOT

Related to #88

Signed-off-by: Jason Rogena <[email protected]>
jasonrogena added a commit that referenced this issue Aug 29, 2019
Rename the OpenSRP development properties template to
opensrp_mybatis_env, which is in line with #88

Related to #88

Signed-off-by: Jason Rogena <[email protected]>
jasonrogena added a commit that referenced this issue Aug 29, 2019
Run the Mybatis migrations as the OpenSRP database user once the user
has been given all privileges to the database. This therefore means that
the user doesn't need to be granted access to the schemas (since they're
the ones creating the schemas in the first place).

Also add variables for specifying the OpenSRP tablespace names (instead
of directories). Change was introduced in OpenSRP Server version
v1.2.18-SNAPSHOT.

- https://github.com/OpenSRP/opensrp-server-web/releases/tag/v1.2.18-SNAPSHOT

Related to #88

Signed-off-by: Jason Rogena <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant