OpenTreeMap is a collaborative platform for crowdsourced tree inventory, ecosystem services calculations, urban forestry analysis, and community engagement.
This is more involved than trimming UDF names because choice definitions are buried in UDF objects' datatype JSON field and choice values are buried in Plot or Tree objects' udfs hstore.
The data migration:
for each UDF definition
if it has type "choice"
for each choice value
if it needs trimming
trim it
for all Trees or Plots having this choice value for this UDF
use the trimmed value
for all Audits having this choice value (old or new) for this UDF
use the trimmed value
The validator (udf._validate_single_datatype) must trim all choice values, and (if any changed) update datatype['choices'] and serialize and save datatype.
This is more involved than trimming UDF names because choice definitions are buried in UDF objects'
datatype
JSON field and choice values are buried in Plot or Tree objects'udfs
hstore.The data migration:
The validator (
udf._validate_single_datatype
) must trim all choice values, and (if any changed) updatedatatype['choices']
and serialize and savedatatype
.