diff --git a/compare.js b/compare.js index 09820e24e..461ed68db 100644 --- a/compare.js +++ b/compare.js @@ -25,7 +25,7 @@ function checkMissing(table, name, ids1, ids2) { } } -function compareRows(table, rsLeft, rsRight) { +function compareRows(table, rsLeft, rsRight, column) { const leftIds = Object.keys(rsLeft); const rightIds = Object.keys(rsRight); @@ -39,7 +39,7 @@ function compareRows(table, rsLeft, rsRight) { const right = JSON.stringify(rsRight[id], null, 2); if (left !== right) { - console.log("Table " + table + " row id=" + id + " differs:"); + console.log("Table " + table + " row with " + column + "=" + id + " differs:"); console.log("Left: ", left); console.log("Right: ", right); printDiff(left, right); @@ -58,13 +58,13 @@ async function main() { const rsLeft = await sql.getIndexed(dbLeft, column, query); const rsRight = await sql.getIndexed(dbRight, column, query); - compareRows(table, rsLeft, rsRight); + compareRows(table, rsLeft, rsRight, column); } await compare("notes_tree", "note_tree_id", "SELECT note_tree_id, note_id, note_pid, note_pos, date_modified, is_deleted, prefix FROM notes_tree"); await compare("notes", "note_id", "SELECT note_id, note_title, note_text, date_modified, is_protected, is_deleted FROM notes"); await compare("notes_history", "note_history_id", "SELECT note_history_id, note_id, note_title, note_text, date_modified_from, date_modified_to, is_protected FROM notes_history"); - await compare("recent_notes", "note_path", "SELECT note_path, date_accessed, is_deleted FROM recent_notes"); + await compare("recent_notes", "note_tree_id", "SELECT note_tree_id, note_path, date_accessed, is_deleted FROM recent_notes"); await compare("options", "opt_name", "SELECT opt_name, opt_value FROM options " + "WHERE opt_name IN ('username', 'password_verification_hash', 'encrypted_data_key', 'protected_session_timeout', 'history_snapshot_time_interval')"); }