cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Update data table entries when modifying data shape field of type infotable

Update data table entries when modifying data shape field of type infotable

Correct the following flawed behavior :

 

DataTable does not reflect changes on its DataShape.

For a given DataTable
my.CustomDataTable

using a given DataShape

my.CustomDataShape

This DataShape has a field of type infotable, using another DataShape :

InfoTable property1 (my.CustomSubDataShape)

This data shape has a single field

String subProperty1


In summary, my entities are :

DataTable my.CustomDataTable (my.CustomDataShape)
DataShape my.CustomDataShape
InfoTable property1 (my.CustomSubDataShape)
DataShape my.CustomSubDataShape
String subProperty1


Now I want to modify the second DataShape. For example I add a new field. My entites become :

DataTable my.CustomDataTable (my.CustomDataShape)
DataShape my.CustomDataShape
InfoTable property1 (my.CustomSubDataShape)
DataShape my.CustomSubDataShape
String subProperty1
String subProperty2

Existing entries in the DataTable are not updated with the updated DataShape.

2 Comments
StefanBode
10-Marble

Changing the type/configuration in datatables (especially if doing real database design) is not an easy task at all. Often these changes require a migration script running on the datatable to reflect the changes in the right way. In the ThingWorx world, I would introduce a NEW datatable with the changed configuration and then migrate the entities into the new datatable. Afterward the old datatable can be removed and references must be rebound.

GM_7064835
4-Participant

Performing an ALTER TABLE is such an easy task in modern databases. Why would it be so difficult in ThingWorx?

As for the work around of moving data to a new datatable, it would require an insane amount of work and tests. This is in no way an acceptable solution.