Skip to content

Build your personal knowledge base with Trilium Notes

fix old migration to avoid unique constraints problems, closes #3447

zadame05e4bec3227
diff --git a/db/migrations/0192__add_memberId_to_entity_changes.sql b/db/migrations/0192__add_memberId_to_entity_changes.sql
index ecf132df57..89d2904c50 100644
--- a/db/migrations/0192__add_memberId_to_entity_changes.sql
+++ b/db/migrations/0192__add_memberId_to_entity_changes.sql
@@ -1,4 +1,7 @@
-CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
+DROP TABLE entity_changes;
+-- not preserving the data because of https://github.com/zadam/trilium/issues/3447
+
+CREATE TABLE IF NOT EXISTS "entity_changes" (
`id` INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
`entityName` TEXT NOT NULL,
`entityId` TEXT NOT NULL,
@@ -11,13 +14,6 @@ CREATE TABLE IF NOT EXISTS "mig_entity_changes" (
`utcDateChanged` TEXT NOT NULL
);
-INSERT INTO mig_entity_changes (id, entityName, entityId, hash, isErased, changeId, componentId, instanceId, isSynced, utcDateChanged)
-SELECT id, entityName, entityId, hash, isErased, changeId, '', '', isSynced, utcDateChanged FROM entity_changes;
-
-DROP TABLE entity_changes;
-
-ALTER TABLE mig_entity_changes RENAME TO entity_changes;
-
CREATE UNIQUE INDEX `IDX_entityChanges_entityName_entityId` ON "entity_changes" (
`entityName`,
`entityId`
diff --git a/package-lock.json b/package-lock.json
index 701daf498b..993167d59c 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -5,6 +5,7 @@
"requires": true,
"packages": {
"": {
+ "name": "trilium",
"version": "0.57.5",
"hasInstallScript": true,
"license": "AGPL-3.0-only",
@@ -57,7 +58,7 @@
"rimraf": "3.0.2",
"safe-compare": "1.1.4",
"sanitize-filename": "1.6.3",
- "sanitize-html": "2.8.0",
+ "sanitize-html": "2.8.1",
"sax": "1.2.4",
"semver": "7.3.8",
"serve-favicon": "2.5.0",
@@ -8670,9 +8671,9 @@
}
},
"node_modules/sanitize-html": {
- "version": "2.8.0",
- "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.8.0.tgz",
- "integrity": "sha512-ZsGyc6avnqgvEm3eMKrcy8xa7WM1MrGrfkGsUgQee2CU+vg3PCfNCexXwBDF/6dEPvaQ4k/QqRjnYKHL8xgNjg==",
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.8.1.tgz",
+ "integrity": "sha512-qK5neD0SaMxGwVv5txOYv05huC3o6ZAA4h5+7nJJgWMNFUNRjcjLO6FpwAtKzfKCZ0jrG6xTk6eVFskbvOGblg==",
"dependencies": {
"deepmerge": "^4.2.2",
"escape-string-regexp": "^4.0.0",
@@ -17231,9 +17232,9 @@
}
},
"sanitize-html": {
- "version": "2.8.0",
- "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.8.0.tgz",
- "integrity": "sha512-ZsGyc6avnqgvEm3eMKrcy8xa7WM1MrGrfkGsUgQee2CU+vg3PCfNCexXwBDF/6dEPvaQ4k/QqRjnYKHL8xgNjg==",
+ "version": "2.8.1",
+ "resolved": "https://registry.npmjs.org/sanitize-html/-/sanitize-html-2.8.1.tgz",
+ "integrity": "sha512-qK5neD0SaMxGwVv5txOYv05huC3o6ZAA4h5+7nJJgWMNFUNRjcjLO6FpwAtKzfKCZ0jrG6xTk6eVFskbvOGblg==",
"requires": {
"deepmerge": "^4.2.2",
"escape-string-regexp": "^4.0.0",