mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-29 19:12:27 +08:00
fixed recent notes according to updated schema
This commit is contained in:
parent
1fdea480d3
commit
e9e92f93b3
@ -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')");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user