Azure / azure-documentdb-datamigrationtool

Azure DocumentDB Data Migration Tool
MIT License
387 stars 183 forks source link

Updated to carry source TimeStamp and empty RowKey scenarios #62

Closed sarmut closed 5 years ago

sarmut commented 5 years ago

Cosmos DB table adapter ignores the source 'Timestamp' column value which comes from the Azure Table storage. The destination (Cosmos DB Table) automatically creates a 'Timestamp' field and puts the last modified time in it, which is not the same timestamp as exist in the corresponding source (Azure Table storage). If a user wants to compare the data consistency after the migration, based on timestamp, then the destination needs to carry the source timestamp value.

Also added the source ETag value for the same purpose.

The 3rd change is, Cosmos DB table does not allow empty string value in the 'RowKey' field, which Azure Table storage allows. So if the source table (Azure Table) contains Empty string in the RowKey field, then this record won't be inserted in Cosmos DB table. This PR copies the PartitionKey value into RowKey field in this case, to make the migration succeed.