|
|
|
|
@ -29,6 +29,8 @@ function compareRows(table, rsLeft, rsRight, column) {
|
|
|
|
|
const leftIds = Object.keys(rsLeft);
|
|
|
|
|
const rightIds = Object.keys(rsRight);
|
|
|
|
|
|
|
|
|
|
console.log(`${table} - ${leftIds.length}/${rightIds.length}`);
|
|
|
|
|
|
|
|
|
|
checkMissing(table, "right", leftIds, rightIds);
|
|
|
|
|
checkMissing(table, "left", rightIds, leftIds);
|
|
|
|
|
|
|
|
|
|
@ -61,15 +63,29 @@ async function main() {
|
|
|
|
|
compareRows(table, rsLeft, rsRight, column);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await compare("branches", "branchId", "SELECT branchId, noteId, parentNoteId, notePosition, dateCreated, dateModified, isDeleted, prefix, hash FROM branches");
|
|
|
|
|
await compare("notes", "noteId", "SELECT noteId, title, content, dateModified, isProtected, isDeleted, hash FROM notes");
|
|
|
|
|
await compare("note_history", "noteHistoryId", "SELECT noteRevisionId, noteId, title, content, dateModifiedFrom, dateModifiedTo, isProtected, hash FROM note_revisions");
|
|
|
|
|
await compare("images", "imageId", "SELECT imageId, format, checksum, name, isDeleted, dateCreated, dateModified, hash FROM images");
|
|
|
|
|
await compare("note_images", "noteImageId", "SELECT noteImageId, noteId, imageId, isDeleted, dateCreated, dateModified, hash FROM note_images");
|
|
|
|
|
await compare("recent_notes", "branchId", "SELECT branchId, notePath, dateCreated, isDeleted, hash FROM recent_notes");
|
|
|
|
|
await compare("options", "name", `SELECT optionId, name, value, hash, dateCreated, dateModified FROM options WHERE isSynced = 1`);
|
|
|
|
|
await compare("labels", "labelId", "SELECT labelId, noteId, name, value, dateCreated, dateModified, hash FROM labels");
|
|
|
|
|
await compare("api_tokens", "apiTokenId", "SELECT apiTokenId, token, dateCreated, isDeleted, hash FROM api_tokens");
|
|
|
|
|
await compare("branches", "branchId",
|
|
|
|
|
"SELECT branchId, noteId, parentNoteId, notePosition, dateCreated, dateModified, isDeleted, prefix, hash FROM branches");
|
|
|
|
|
|
|
|
|
|
await compare("notes", "noteId",
|
|
|
|
|
"SELECT noteId, title, content, dateModified, isProtected, isDeleted, hash FROM notes");
|
|
|
|
|
|
|
|
|
|
await compare("note_history", "noteHistoryId",
|
|
|
|
|
"SELECT noteRevisionId, noteId, title, content, dateModifiedFrom, dateModifiedTo, isProtected, hash FROM note_revisions");
|
|
|
|
|
|
|
|
|
|
await compare("links", "linkId",
|
|
|
|
|
"SELECT linkId, noteId, targetNoteId, type, isDeleted, dateCreated, dateModified, hash FROM links");
|
|
|
|
|
|
|
|
|
|
await compare("recent_notes", "branchId",
|
|
|
|
|
"SELECT branchId, notePath, dateCreated, isDeleted, hash FROM recent_notes");
|
|
|
|
|
|
|
|
|
|
await compare("options", "name",
|
|
|
|
|
`SELECT name, value, dateCreated, dateModified, hash FROM options WHERE isSynced = 1`);
|
|
|
|
|
|
|
|
|
|
await compare("attributes", "attributeId",
|
|
|
|
|
"SELECT attributeId, noteId, type, name, value, dateCreated, dateModified, hash FROM attributes");
|
|
|
|
|
|
|
|
|
|
await compare("api_tokens", "apiTokenId",
|
|
|
|
|
"SELECT apiTokenId, token, dateCreated, isDeleted, hash FROM api_tokens");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
(async () => {
|
|
|
|
|
|