Menu

A CRM migration can pass the row count and fail the account history
📰

A CRM migration can pass the row count and fail the account history

DEV Community: database·Muhammad Abdullah·6 days ago
#lPwG7Bcu
#devtodatabase#devto#dev#activityid#owner
Reading 0:00
15s threshold

A migration can move every activity record and still show a customer’s history on the wrong account. Before cutover, check a few important records by their relationships and by the staff role that needs to open them.

A small test with a real failure condition

This synthetic fixture uses account and activity IDs already mapped to the same identifiers in both exports. The source links A101 to C001 and A102 to C002. The test destination still contains two rows, but A102 is attached to C001. A count check passes. The relationship check fails.

Run this JavaScript in a local console with the synthetic fixture. For a real rehearsal, use approved exports in a controlled workspace and validate that activity IDs are unique in each input before using this example.

function compareActivityLinks ( source , destination ) { const byId = new Map ( destination . map ( row => [ row . activityId , row ])); return source . flatMap ( expected => { const actual = byId . get ( expected . activityId ); if ( !…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.