formatting

This commit is contained in:
azivner 2018-12-16 23:17:13 +01:00
parent d74771b28c
commit f2605aaa3e
3 changed files with 841 additions and 728 deletions

View File

@ -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 () => {

907
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,8 +3,8 @@
"description": "Trilium database compare tool",
"version": "0.0.1",
"dependencies": {
"colors": "^1.1.2",
"diff": "^3.4.0",
"sqlite": "^2.8.0"
"colors": "^1.3.3",
"diff": "^3.5.0",
"sqlite": "^3.0.0"
}
}