mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fixed false sync error reporting
This commit is contained in:
parent
fc6669d254
commit
af529f82e5
@ -16,8 +16,11 @@ const RecentNote = require('../entities/recent_note');
|
|||||||
const Option = require('../entities/option');
|
const Option = require('../entities/option');
|
||||||
|
|
||||||
async function getHash(entityConstructor, whereBranch) {
|
async function getHash(entityConstructor, whereBranch) {
|
||||||
let contentToHash = await sql.getValue(`SELECT GROUP_CONCAT(hash) FROM ${entityConstructor.tableName} `
|
// subselect is necessary to have correct ordering in GROUP_CONCAT
|
||||||
+ (whereBranch ? `WHERE ${whereBranch} ` : '') + `ORDER BY ${entityConstructor.primaryKeyName}`);
|
const query = `SELECT GROUP_CONCAT(hash) FROM (SELECT hash FROM ${entityConstructor.tableName} `
|
||||||
|
+ (whereBranch ? `WHERE ${whereBranch} ` : '') + `ORDER BY ${entityConstructor.primaryKeyName})`;
|
||||||
|
|
||||||
|
let contentToHash = await sql.getValue(query);
|
||||||
|
|
||||||
if (!contentToHash) { // might be null in case of no rows
|
if (!contentToHash) { // might be null in case of no rows
|
||||||
contentToHash = "";
|
contentToHash = "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user