Merge remote-tracking branch 'origin/stable'

This commit is contained in:
zadam 2020-03-09 21:00:38 +01:00
commit c67613a557
7 changed files with 30 additions and 7 deletions

View File

@ -0,0 +1,22 @@
CREATE TABLE IF NOT EXISTS "sync_mig" (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`entityName` TEXT NOT NULL,
`entityId` TEXT NOT NULL,
`sourceId` TEXT NOT NULL,
`isSynced` INTEGER default 0 not null,
`utcSyncDate` TEXT NOT NULL);
INSERT INTO sync_mig (entityName, entityId, sourceId, isSynced, utcSyncDate)
SELECT entityName, entityId, sourceId, 1, utcSyncDate FROM sync;
DROP TABLE sync;
ALTER TABLE sync_mig RENAME TO sync;
CREATE UNIQUE INDEX `IDX_sync_entityName_entityId` ON `sync` (
`entityName`,
`entityId`
);
CREATE INDEX `IDX_sync_utcSyncDate` ON `sync` (
`utcSyncDate`
);

View File

@ -2,7 +2,7 @@
"name": "trilium", "name": "trilium",
"productName": "Trilium Notes", "productName": "Trilium Notes",
"description": "Trilium Notes", "description": "Trilium Notes",
"version": "0.40.4", "version": "0.40.5",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"main": "electron.js", "main": "electron.js",
"bin": { "bin": {

View File

@ -1,9 +1,9 @@
"use strict"; "use strict";
const app_info = require('../../services/app_info'); const appInfo = require('../../services/app_info');
async function getAppInfo() { async function getAppInfo() {
return app_info; return appInfo;
} }
module.exports = { module.exports = {

View File

@ -4,7 +4,7 @@ const build = require('./build');
const packageJson = require('../../package'); const packageJson = require('../../package');
const {TRILIUM_DATA_DIR} = require('./data_dir'); const {TRILIUM_DATA_DIR} = require('./data_dir');
const APP_DB_VERSION = 157; const APP_DB_VERSION = 158;
const SYNC_VERSION = 14; const SYNC_VERSION = 14;
const CLIPPER_PROTOCOL_VERSION = "1.0"; const CLIPPER_PROTOCOL_VERSION = "1.0";

View File

@ -1 +1 @@
module.exports = { buildDate:"2020-02-24T22:59:22+01:00", buildRevision: "fb55cdaea6b1367129e11118b8b6fd2eadebad5f" }; module.exports = { buildDate:"2020-03-08T21:05:52+01:00", buildRevision: "e4039ea5e1c6ac87e0947bc77b6bdcbb29a23092" };

View File

@ -546,7 +546,7 @@ class ConsistencyChecks {
${entityName} ${entityName}
LEFT JOIN sync ON sync.entityName = '${entityName}' AND entityId = ${key} LEFT JOIN sync ON sync.entityName = '${entityName}' AND entityId = ${key}
WHERE WHERE
sync.id IS NULL AND ` + (entityName === 'options' ? 'isSynced = 1' : '1'), sync.id IS NULL AND ` + (entityName === 'options' ? 'options.isSynced = 1' : '1'),
async ({entityId}) => { async ({entityId}) => {
if (this.autoFix) { if (this.autoFix) {
await syncTableService.addEntitySync(entityName, entityId); await syncTableService.addEntitySync(entityName, entityId);

View File

@ -9,7 +9,8 @@ async function insertEntitySync(entityName, entityId, sourceId) {
entityName: entityName, entityName: entityName,
entityId: entityId, entityId: entityId,
utcSyncDate: dateUtils.utcNowDateTime(), utcSyncDate: dateUtils.utcNowDateTime(),
sourceId: sourceId || cls.getSourceId() || sourceIdService.getCurrentSourceId() sourceId: sourceId || cls.getSourceId() || sourceIdService.getCurrentSourceId(),
isSynced: 1
}; };
sync.id = await sql.replace("sync", sync); sync.id = await sql.replace("sync", sync);