feat: add row count mismatch error handling in processMigrationJob and update SQL query to exclude additional graph-related columns
This commit is contained in:
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
@@ -233,5 +234,9 @@ func processMigrationJob(
|
||||
result.RowsLoaded = atomic.LoadInt64(&rowsLoaded)
|
||||
result.RowsFailed = atomic.LoadInt64(&rowsFailed)
|
||||
|
||||
if result.RowsRead != result.RowsLoaded {
|
||||
result.Error = fmt.Errorf("Row count mismatch: extracted %d rows but loaded %d rows (failed: %d)", result.RowsRead, result.RowsLoaded, result.RowsFailed)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ JOIN sys.types t ON c.user_type_id = t.user_type_id
|
||||
LEFT JOIN sys.types bt ON t.is_user_defined = 1 AND bt.user_type_id = t.system_type_id
|
||||
JOIN sys.tables st ON c.object_id = st.object_id
|
||||
JOIN sys.schemas s ON st.schema_id = s.schema_id
|
||||
WHERE s.name = @schema AND st.name = @table AND c.name NOT LIKE 'graph_id%'
|
||||
WHERE s.name = @schema AND st.name = @table AND c.name NOT LIKE 'graph_id%' AND c.name NOT LIKE 'node_id%' AND c.name NOT LIKE 'edge_id%'
|
||||
ORDER BY c.column_id;`
|
||||
|
||||
type rawColumnMssql struct {
|
||||
|
||||
Reference in New Issue
Block a user