hres / cfg-task-service

Canada Food Guide Task Service
https://java-dev.hres.ca/cfg-task-service
MIT License
0 stars 1 forks source link

For HRE creating a seperate table and load data #8

Closed shussain closed 7 years ago

shussain commented 7 years ago

This file is created to deal with a scenario when deploying to HRE. Currently we have a script to drop the database instance, create a new instance and then run the create_table_and_load_data.psql

However, with the file specifying a DB instance to connect to, our build fails. Hard coding the DB name is problematic for deployment. In addition, the maser create_table_and_load_data.psql also drops and recreates cnfadm-qa which could potentially be disruptive since if the cfg-task-service DB instance is being rebuild, one does not want to rebuild the cfg-task-service-qa DB instance

shussain commented 7 years ago

@rsanchej please note that if you wish, you can modify your own create_table_and_load_data.psql to import the HRE_create_table_and_load_data.psql so there is no repetition.

E.g the create_table_and_load_data.psql could be

\c cnfadm
\i HRE_create_table_and_load_data.psql 

That way the DRY principle is met.

NOTE: I have not tested the above but it should work

shussain commented 7 years ago

Thank you