Setting up an app with SQL - kwantu/platformconfiguration GitHub Wiki
-
Create a new database for the app
-
Add a new row in the
community_hubs
table located in the mobile1_8 database with the database name and the hub communityId.
- Add a new row (if not already present) in the
etl_types_appid_mapping
table located in the mobile1_8 database containingetl_type = 'mysqlSubprocess'
and the appId.
- Ensure all data objects for the app contains an sql tag as shown on this page here
- Update
etl_appcodes
to have anapp_file_precode
(this must match the precode used in thetable_name
inside the data object<sql/>
tag that looks like thistableName="PROJ_localAuthSiteReport"
. Here 'PROJ' is the precode).
-
Run the service
/db/kwantu-resource/etl/couchdbToMySQL/populate_community_to_hubs_mapping.xql
. This will update theetl_communityid_appid_mapping
table so that it contains all communities that insidecommunity_hubs
. -
Run the service
/db/kwantu-resource/etl/couchdbToMySQL/prepareTables.xql
with the correctappId
,communityId
andappCode
. (If this fails then the most likely issue is with dataTypes being missing) -
Now update the
etl_control
table with a new row for each community (You can use the/db/kwantu-resource/etl/couchdbToMySQL/insertEtl.xq
service to do this automatically by updating the parameters for the$hubCommunityId
and$childrenTitle
. The value of this variable should be the one highlighted yellow in the picture below.)
Now the etl should start processing