-- Fix attributes for Structural Elements DCE
UPDATE layers SET metadata = '{"hierarchy": ["Observations", "Structural Elements"], "fields": [{"machine_code": "structural_element_type", "label": "Type", "type": "list", "lookup": "structural_element_points"}, {"machine_code": "structure_count", "label": "Structure Count", "type": "integer", "default": 1, "visibility": {"field_name": "structural_element_type", "values": ["Dam","Jam","Other","Root Mass"]}}, {"machine_code": "length", "label": "Length", "type": "float", "visibility": {"field_name": "structural_element_type", "values": ["Dam","Jam","Other","Root Mass"]}}, {"machine_code": "width", "label": "Width", "type": "float", "visibility": {"field_name": "structural_element_type", "values": ["Dam","Jam","Other","Root Mass"]}}, {"machine_code": "height", "label": "Height", "type": "float", "visibility": {"field_name": "structural_element_type", "values": ["Dam","Jam","Other","Root Mass"]}}, {"machine_code": "large_wood_count", "label": "Large Wood Count", "type": "integer"}]}' WHERE fc_name = 'structural_elements_points';
UPDATE layers SET metadata = '{"hierarchy": ["Observations", "Structural Elements"], "fields": [{"machine_code": "structural_element_type", "label": "Type", "type": "list", "lookup": "structural_element_areas"}, {"machine_code": "large_wood_count", "label": "Large Wood Count", "type": "integer"}]}'  WHERE fc_name = 'structural_elements_areas';
