mirror of
https://github.com/zadam/trilium.git
synced 2025-10-29 17:26:38 +01:00
Compare commits
6 Commits
v0.63.1-be
...
v0.62.6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e76093e75c | ||
|
|
4f8073daa7 | ||
|
|
47fb96faa8 | ||
|
|
6e33553146 | ||
|
|
807941e6a5 | ||
|
|
1e30c0702e |
@@ -8,3 +8,6 @@ CREATE TABLE IF NOT EXISTS "blobs" (
|
||||
|
||||
ALTER TABLE notes ADD blobId TEXT DEFAULT NULL;
|
||||
ALTER TABLE note_revisions ADD blobId TEXT DEFAULT NULL;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS IDX_notes_blobId on notes (blobId);
|
||||
CREATE INDEX IF NOT EXISTS IDX_note_revisions_blobId on note_revisions (blobId);
|
||||
|
||||
@@ -21,5 +21,6 @@ CREATE INDEX `IDX_revisions_utcDateCreated` ON `revisions` (`utcDateCreated`);
|
||||
CREATE INDEX `IDX_revisions_utcDateLastEdited` ON `revisions` (`utcDateLastEdited`);
|
||||
CREATE INDEX `IDX_revisions_dateCreated` ON `revisions` (`dateCreated`);
|
||||
CREATE INDEX `IDX_revisions_dateLastEdited` ON `revisions` (`dateLastEdited`);
|
||||
CREATE INDEX IF NOT EXISTS IDX_revisions_blobId on revisions (blobId);
|
||||
|
||||
UPDATE entity_changes SET entityName = 'revisions' WHERE entityName = 'note_revisions';
|
||||
|
||||
@@ -19,3 +19,5 @@ CREATE INDEX IDX_attachments_ownerId_role
|
||||
|
||||
CREATE INDEX IDX_attachments_utcDateScheduledForErasureSince
|
||||
on attachments (utcDateScheduledForErasureSince);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS IDX_attachments_blobId on attachments (blobId);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "trilium",
|
||||
"productName": "Trilium Notes",
|
||||
"description": "Trilium Notes",
|
||||
"version": "0.62.5",
|
||||
"version": "0.62.6",
|
||||
"license": "AGPL-3.0-only",
|
||||
"main": "electron.js",
|
||||
"bin": {
|
||||
|
||||
@@ -1 +1 @@
|
||||
module.exports = { buildDate:"2024-01-08T00:05:13+01:00", buildRevision: "ee608fcf46a2052f21d94a8a72fc023dcaf955f7" };
|
||||
module.exports = { buildDate:"2024-01-21T23:49:23+01:00", buildRevision: "4f8073daa7cff1b8b6737ae45792b2e87c2adf33" };
|
||||
|
||||
@@ -48,6 +48,14 @@ function isEntityEventsDisabled() {
|
||||
return !!namespace.get('disableEntityEvents');
|
||||
}
|
||||
|
||||
function setMigrationRunning(running) {
|
||||
namespace.set('migrationRunning', !!running);
|
||||
}
|
||||
|
||||
function isMigrationRunning() {
|
||||
return !!namespace.get('migrationRunning');
|
||||
}
|
||||
|
||||
function disableSlowQueryLogging(disable) {
|
||||
namespace.set('disableSlowQueryLogging', disable);
|
||||
}
|
||||
@@ -102,5 +110,7 @@ module.exports = {
|
||||
putEntityChange,
|
||||
ignoreEntityChangeIds,
|
||||
disableSlowQueryLogging,
|
||||
isSlowQueryLoggingDisabled
|
||||
isSlowQueryLoggingDisabled,
|
||||
setMigrationRunning,
|
||||
isMigrationRunning
|
||||
};
|
||||
|
||||
@@ -5,12 +5,13 @@ const log = require('./log');
|
||||
const utils = require('./utils');
|
||||
const resourceDir = require('./resource_dir');
|
||||
const appInfo = require('./app_info');
|
||||
const cls = require('./cls.js');
|
||||
|
||||
async function migrate() {
|
||||
const currentDbVersion = getDbVersion();
|
||||
|
||||
if (currentDbVersion < 214) {
|
||||
log.error("Direct migration from your current version is not supported. Please upgrade to the latest v0.60.X first and only then to this version.");
|
||||
log.error("Direct migration from your current version is not supported. Please upgrade to the latest v0.60.4 first and only then to this version.");
|
||||
|
||||
utils.crash();
|
||||
return;
|
||||
@@ -18,7 +19,7 @@ async function migrate() {
|
||||
|
||||
// backup before attempting migration
|
||||
await backupService.backupNow(
|
||||
// creating a special backup for versions 0.60.X, the changes in 0.61 are major.
|
||||
// creating a special backup for version 0.60.4, the changes in 0.61 are major.
|
||||
currentDbVersion === 214
|
||||
? `before-migration-v060`
|
||||
: 'before-migration'
|
||||
@@ -51,6 +52,9 @@ async function migrate() {
|
||||
// all migrations are executed in one transaction - upgrade either succeeds, or the user can stay at the old version
|
||||
// otherwise if half of the migrations succeed, user can't use any version - DB is too "new" for the old app,
|
||||
// and too old for the new app version.
|
||||
|
||||
cls.setMigrationRunning(true);
|
||||
|
||||
sql.transactional(() => {
|
||||
for (const mig of migrations) {
|
||||
try {
|
||||
|
||||
@@ -895,6 +895,11 @@ function scanForLinks(note, content) {
|
||||
* Things which have to be executed after updating content, but asynchronously (separate transaction)
|
||||
*/
|
||||
async function asyncPostProcessContent(note, content) {
|
||||
if (cls.isMigrationRunning()) {
|
||||
// this is rarely needed for migrations, but can cause trouble by e.g. triggering downloads
|
||||
return;
|
||||
}
|
||||
|
||||
if (note.hasStringContent() && !utils.isString(content)) {
|
||||
content = content.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user