We're updating the issue view to help you get more done.Learn more

When reinstated, deprecated columns do not update to the new property definition

If an object property is removed, the column is marked as "_deprecated_" in the database.

If the property is then reinstated, the column is simply reinstated, but any differences in attributes (e.g. column length) are not applied to the column.

The attached zip file contains a folder of object definitions to be placed in /support/tests/resources/PresideObjectService/, for use with the following two tests (to be added to PresideObjectServiceTest.cfc):

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 <cffunction name="test004a_dbsync_shouldModifyColumnLength_whenDeprecatedPropertyReinstatedAndChanged" returntype="void"> <cfscript> var columns = ""; var poService = _getService( objectDirectories=[ "/tests/resources/PresideObjectService/componentWithPropertyChangedToRelationShip/1_originalProperty" ] ); poService.dbSync(); columns = _getDbTableColumns( "ptest_object_a" ); super.assertEquals( "20", columns.test_property.column_size, "The test_property column did not have a length of 20" ); poService = _getService( objectDirectories=[ "/tests/resources/PresideObjectService/componentWithPropertyChangedToRelationShip/2_deprecatedProperty" ] ); poService.dbSync(); columns = _getDbTableColumns( "ptest_object_a" ); super.assert( StructKeyExists( columns, "__deprecated__test_property" ), "The test_property column was not deprecated" ); poService = _getService( objectDirectories=[ "/tests/resources/PresideObjectService/componentWithPropertyChangedToRelationShip/3a_propertyChanged" ] ); poService.dbSync(); columns = _getDbTableColumns( "ptest_object_a" ); super.assertEquals( "30", columns.test_property.column_size, "The test_property column has not been modified to a length of 30" ); </cfscript> </cffunction> <cffunction name="test004b_dbsync_shouldModifyColumnLength_whenDeprecatedPropertyReinstatedAndChangedToRelationship" returntype="void"> <cfscript> var columns = ""; var poService = _getService( objectDirectories=[ "/tests/resources/PresideObjectService/componentWithPropertyChangedToRelationShip/1_originalProperty" ] ); poService.dbSync(); columns = _getDbTableColumns( "ptest_object_a" ); super.assertEquals( "20", columns.test_property.column_size, "The test_property column did not have a length of 20" ); poService = _getService( objectDirectories=[ "/tests/resources/PresideObjectService/componentWithPropertyChangedToRelationShip/2_deprecatedProperty" ] ); poService.dbSync(); columns = _getDbTableColumns( "ptest_object_a" ); super.assert( StructKeyExists( columns, "__deprecated__test_property" ), "The test_property column was not deprecated" ); poService = _getService( objectDirectories=[ "/tests/resources/PresideObjectService/componentWithPropertyChangedToRelationShip/3b_propertyChangedToRelationship" ] ); poService.dbSync(); columns = _getDbTableColumns( "ptest_object_a" ); super.assertEquals( "35", columns.test_property.column_size, "The test_property column has not been modified to a length of 35" ); </cfscript> </cffunction>

Status

Assignee

Dominic Watson

Reporter

Seb Duggan

Accepted

Yes

Fix versions

Affects versions

10.7.40
10.8.0

Priority

Medium