diff --git a/.gitattributes b/.gitattributes index 2f8b47a8f..7b00e7d63 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,19 +1,21 @@ +# Mark files as auto-generated to simplify reviews. package-lock.json linguist-generated=true **/package-lock.json linguist-generated=true +apps/server/src/assets/doc_notes/en/User[[:space:]]Guide/** linguist-generated -apps/server/src/assets/doc_notes/en/User[[:space:]]Guide/** linguist-generated=true +# Ignore from GitHub language stats. apps/server/src/assets/doc_notes/en/User[[:space:]]Guide/**/*.html eol=lf +apps/server/src/assets/doc_notes/** linguist-vendored=true +apps/edit-docs/demo/** linguist-vendored=true +docs/** linguist-vendored=true +# Normalize line endings. docs/**/*.md eol=lf docs/**/*.json eol=lf - demo/**/*.html eol=lf demo/**/*.json eol=lf demo/**/*.svg eol=lf demo/**/*.txt eol=lf demo/**/*.js eol=lf demo/**/*.css eol=lf - *.sh eol=lf - -apps/client/src/libraries/** linguist-vendored \ No newline at end of file diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..156ca6d39 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22.16.0 \ No newline at end of file diff --git a/_regroup/jsdoc-conf.json b/_regroup/jsdoc-conf.json deleted file mode 100644 index b61bbacb6..000000000 --- a/_regroup/jsdoc-conf.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "templates": { - "default": { - "includeDate": false - } - } -} diff --git a/_regroup/package.json b/_regroup/package.json index 6b6f96740..80e210e1d 100644 --- a/_regroup/package.json +++ b/_regroup/package.json @@ -38,7 +38,7 @@ "@playwright/test": "1.52.0", "@stylistic/eslint-plugin": "4.4.0", "@types/express": "5.0.1", - "@types/node": "22.15.24", + "@types/node": "22.15.29", "@types/yargs": "17.0.33", "@vitest/coverage-v8": "3.1.4", "eslint": "9.27.0", diff --git a/_regroup/trilium.iml b/_regroup/trilium.iml deleted file mode 100644 index bfa02661b..000000000 --- a/_regroup/trilium.iml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/apps/client/src/translations/cn/translation.json b/apps/client/src/translations/cn/translation.json index 455723f0e..fa2460f26 100644 --- a/apps/client/src/translations/cn/translation.json +++ b/apps/client/src/translations/cn/translation.json @@ -274,15 +274,15 @@ "revision_last_edited": "此修订版本上次编辑于 {{date}}", "confirm_delete_all": "您是否要删除此笔记的所有修订版本?", "no_revisions": "此笔记暂无修订版本...", - "restore_button": "", + "restore_button": "恢复", "confirm_restore": "您是否要恢复此修订版本?这将使用此修订版本覆盖笔记的当前标题和内容。", - "delete_button": "", + "delete_button": "删除", "confirm_delete": "您是否要删除此修订版本?", "revisions_deleted": "笔记修订版本已删除。", "revision_restored": "笔记修订版本已恢复。", "revision_deleted": "笔记修订版本已删除。", "snapshot_interval": "笔记快照保存间隔: {{seconds}}秒。", - "maximum_revisions": "当前笔记的最历史数量: {{number}}。", + "maximum_revisions": "当前笔记的最大历史数量: {{number}}。", "settings": "笔记修订设置", "download_button": "下载", "mime": "MIME 类型:", @@ -806,7 +806,7 @@ "open_full": "展开显示", "collapse": "折叠到正常大小", "title": "笔记地图", - "fix-nodes": "修复节点", + "fix-nodes": "固定节点", "link-distance": "链接距离" }, "note_paths": { @@ -1213,7 +1213,7 @@ "color": "字体颜色", "bg_color": "背景颜色", "visibility_title": "高亮列表可见性", - "visibility_description": "您可以通过添加 #hideHighlightWidget 标签来隐藏每个笔记的高亮小部件。", + "visibility_description": "您可以通过添加 #hideHighlightWidget 标签来隐藏单个笔记的高亮小部件。", "shortcut_info": "您可以在选项 -> 快捷键中为快速切换右侧面板(包括高亮列表)配置键盘快捷键(名称为 'toggleRightPane')。" }, "table_of_contents": { @@ -1547,7 +1547,7 @@ "close_other_tabs": "关闭其他标签页", "close_right_tabs": "关闭右侧标签页", "close_all_tabs": "关闭所有标签页", - "reopen_last_tab": "重新打开最后一个关闭的标签页", + "reopen_last_tab": "重新打开关闭的标签页", "move_tab_to_new_window": "将此标签页移动到新窗口", "copy_tab_to_new_window": "将此标签页复制到新窗口", "new_tab": "新标签页" @@ -1616,7 +1616,7 @@ "auto-detect-language": "自动检测" }, "highlighting": { - "title": "", + "title": "代码块", "description": "控制文本笔记中代码块的语法高亮,代码笔记不会受到影响。", "color-scheme": "颜色方案" }, @@ -1627,21 +1627,21 @@ "theme_group_dark": "深色主题" }, "classic_editor_toolbar": { - "title": "格式化" + "title": "格式" }, "editor": { "title": "编辑器" }, "editing": { "editor_type": { - "label": "格式化工具栏", + "label": "格式工具栏", "floating": { "title": "浮动", "description": "编辑工具出现在光标附近;" }, "fixed": { "title": "固定", - "description": "编辑工具出现在 \"格式化\" 功能区标签中。" + "description": "编辑工具出现在 \"格式\" 功能区标签中。" }, "multiline-toolbar": "如果工具栏无法完全显示,则分多行显示。" } diff --git a/apps/client/src/widgets/buttons/create_ai_chat_button.ts b/apps/client/src/widgets/buttons/create_ai_chat_button.ts deleted file mode 100644 index 1ccd52cda..000000000 --- a/apps/client/src/widgets/buttons/create_ai_chat_button.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { t } from "../../services/i18n.js"; -import options from "../../services/options.js"; -import CommandButtonWidget from "./command_button.js"; - -export default class CreateAiChatButton extends CommandButtonWidget { - constructor() { - super(); - - this.icon("bx bx-bot") - .title(t("ai.create_new_ai_chat")) - .titlePlacement("bottom") - .command("createAiChat") - .class("icon-action"); - } - - isEnabled() { - return options.get("aiEnabled") === "true"; - } - - async refreshWithNote() { - if (this.isEnabled()) { - this.$widget.show(); - } else { - this.$widget.hide(); - } - } -} diff --git a/apps/client/src/widgets/buttons/note_actions.ts b/apps/client/src/widgets/buttons/note_actions.ts index 020da9318..6989d8152 100644 --- a/apps/client/src/widgets/buttons/note_actions.ts +++ b/apps/client/src/widgets/buttons/note_actions.ts @@ -186,7 +186,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget { this.$convertNoteIntoAttachmentButton.toggle(note.isEligibleForConversionToAttachment()); - this.toggleDisabled(this.$findInTextButton, ["text", "code", "book"].includes(note.type)); + this.toggleDisabled(this.$findInTextButton, ["text", "code", "book", "mindMap"].includes(note.type)); this.toggleDisabled(this.$showAttachmentsButton, !isInOptions); this.toggleDisabled(this.$showSourceButton, ["text", "code", "relationMap", "mermaid", "canvas", "mindMap", "geoMap"].includes(note.type)); diff --git a/apps/client/src/widgets/find.ts b/apps/client/src/widgets/find.ts index fc8bebb88..c5b3470b2 100644 --- a/apps/client/src/widgets/find.ts +++ b/apps/client/src/widgets/find.ts @@ -188,7 +188,7 @@ export default class FindWidget extends NoteContextAwareWidget { return; } - if (!["text", "code", "render"].includes(this.note?.type ?? "")) { + if (!["text", "code", "render", "mindMap"].includes(this.note?.type ?? "")) { return; } @@ -250,6 +250,8 @@ export default class FindWidget extends NoteContextAwareWidget { case "text": const readOnly = await this.noteContext?.isReadOnly(); return readOnly ? this.htmlHandler : this.textHandler; + case "mindMap": + return this.htmlHandler; default: console.warn("FindWidget: Unsupported note type for find widget", this.note?.type); } @@ -352,7 +354,7 @@ export default class FindWidget extends NoteContextAwareWidget { } isEnabled() { - return super.isEnabled() && ["text", "code", "render"].includes(this.note?.type ?? ""); + return super.isEnabled() && ["text", "code", "render", "mindMap"].includes(this.note?.type ?? ""); } async entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) { diff --git a/apps/client/src/widgets/find_in_html.ts b/apps/client/src/widgets/find_in_html.ts index 304bea656..0bf2bd376 100644 --- a/apps/client/src/widgets/find_in_html.ts +++ b/apps/client/src/widgets/find_in_html.ts @@ -85,7 +85,7 @@ export default class FindInHtml { if (this.$results?.length) { const $current = this.$results.eq(this.currentIndex); this.$results.removeClass(FIND_RESULT_SELECTED_CSS_CLASSNAME); - $current[0].scrollIntoView(); + $current[0].scrollIntoView({ block: 'center', inline: 'center'}); $current.addClass(FIND_RESULT_SELECTED_CSS_CLASSNAME); } } diff --git a/apps/client/src/widgets/note_type.ts b/apps/client/src/widgets/note_type.ts index 63190f208..055cdf565 100644 --- a/apps/client/src/widgets/note_type.ts +++ b/apps/client/src/widgets/note_type.ts @@ -38,7 +38,6 @@ const NOTE_TYPES: NoteTypeMapping[] = [ // Misc note types { type: "render", mime: "", title: t("note_types.render-note"), selectable: true }, { type: "webView", mime: "", title: t("note_types.web-view"), selectable: true }, - { type: "aiChat", mime: "application/json", title: t("note_types.ai-chat"), selectable: true }, // Code notes { type: "code", mime: "text/plain", title: t("note_types.code"), selectable: true }, @@ -50,7 +49,8 @@ const NOTE_TYPES: NoteTypeMapping[] = [ { type: "image", title: t("note_types.image"), selectable: false }, { type: "launcher", mime: "", title: t("note_types.launcher"), selectable: false }, { type: "noteMap", mime: "", title: t("note_types.note-map"), selectable: false }, - { type: "search", title: t("note_types.saved-search"), selectable: false } + { type: "search", title: t("note_types.saved-search"), selectable: false }, + { type: "aiChat", mime: "application/json", title: t("note_types.ai-chat"), selectable: false } ]; const NOT_SELECTABLE_NOTE_TYPES = NOTE_TYPES.filter((nt) => !nt.selectable).map((nt) => nt.type); diff --git a/apps/client/src/widgets/tab_row.ts b/apps/client/src/widgets/tab_row.ts index 92b81f6dd..6d0fc2fba 100644 --- a/apps/client/src/widgets/tab_row.ts +++ b/apps/client/src/widgets/tab_row.ts @@ -378,16 +378,45 @@ export default class TabRowWidget extends BasicWidget { } scrollTabContainer(direction: number, behavior: ScrollBehavior = "smooth") { - const currentScrollLeft = this.$tabScrollingContainer[0]?.scrollLeft; - this.$tabScrollingContainer[0].scrollTo({ - left: currentScrollLeft + direction, + this.$tabScrollingContainer[0].scrollBy({ + left: direction, behavior }); }; setupScrollEvents() { - this.$tabScrollingContainer[0].addEventListener('wheel', (event) => { - this.scrollTabContainer(event.deltaY * 1.5); + let deltaX = 0; + let isScrolling = false; + const stepScroll = () => { + if (Math.abs(deltaX) > 5) { + const step = Math.round(deltaX * 0.2); + deltaX -= step; + this.scrollTabContainer(step, "instant"); + requestAnimationFrame(stepScroll); + } else { + this.scrollTabContainer(deltaX, "instant"); + deltaX = 0; + isScrolling = false; + } + }; + this.$tabScrollingContainer[0].addEventListener('wheel', async (event) => { + if (!event.shiftKey && event.deltaX === 0) { + event.preventDefault(); + // Clamp deltaX between TAB_CONTAINER_MIN_WIDTH and TAB_CONTAINER_MIN_WIDTH * 3 + deltaX += Math.sign(event.deltaY) * Math.max(Math.min(Math.abs(event.deltaY), TAB_CONTAINER_MIN_WIDTH * 3), TAB_CONTAINER_MIN_WIDTH); + if (!isScrolling) { + isScrolling = true; + stepScroll(); + } + } else if (event.shiftKey) { + event.preventDefault(); + if (event.deltaY > 0) { + await appContext.tabManager.activateNextTabCommand(); + } else { + await appContext.tabManager.activatePreviousTabCommand(); + } + this.activeTabEl.scrollIntoView(); + } }); this.$scrollButtonLeft[0].addEventListener('click', () => this.scrollTabContainer(-200)); diff --git a/apps/client/src/widgets/type_widgets/mind_map.ts b/apps/client/src/widgets/type_widgets/mind_map.ts index 18867bc83..898de7a26 100644 --- a/apps/client/src/widgets/type_widgets/mind_map.ts +++ b/apps/client/src/widgets/type_widgets/mind_map.ts @@ -286,4 +286,13 @@ export default class MindMapWidget extends TypeWidget { utils.downloadSvgAsPng(this.note.title, svg); } + async executeWithContentElementEvent({ resolve, ntxId }: EventData<"executeWithContentElement">) { + if (!this.isNoteContext(ntxId)) { + return; + } + + await this.initialized; + + resolve(this.$content.find('.main-node-container')); + } } diff --git a/apps/desktop/src/electron-main.ts b/apps/desktop/src/electron-main.ts index 8a9ebae03..c8c28ac77 100644 --- a/apps/desktop/src/electron-main.ts +++ b/apps/desktop/src/electron-main.ts @@ -22,6 +22,12 @@ async function main() { electron.app.commandLine.appendSwitch("enable-experimental-web-platform-features"); electron.app.commandLine.appendSwitch("lang", options.getOptionOrNull("formattingLocale") ?? "en"); + // Electron 36 crashes with "Using GTK 2/3 and GTK 4 in the same process is not supported" on some distributions. + // See https://github.com/electron/electron/issues/46538 for more info. + if (process.platform === "linux") { + electron.app.commandLine.appendSwitch("gtk-version", "3"); + } + // Quit when all windows are closed, except on macOS. There, it's common // for applications and their menu bar to stay active until the user quits // explicitly with Cmd + Q. diff --git a/apps/dump-db/src/main.ts b/apps/dump-db/src/main.ts index e00f1c615..28f9065d4 100644 --- a/apps/dump-db/src/main.ts +++ b/apps/dump-db/src/main.ts @@ -1,5 +1,3 @@ -#!/usr/bin/env node - import yargs from "yargs"; import { hideBin } from "yargs/helpers"; import dumpService from "./inc/dump.js"; diff --git a/apps/server-e2e/src/layout/tab_bar.spec.ts b/apps/server-e2e/src/layout/tab_bar.spec.ts index c064dbf57..cb82f8f82 100644 --- a/apps/server-e2e/src/layout/tab_bar.spec.ts +++ b/apps/server-e2e/src/layout/tab_bar.spec.ts @@ -115,7 +115,7 @@ test("Search works when dismissing a tab", async ({ page, context }) => { await app.getTab(0).click(); await app.openAndClickNoteActionMenu("Search in note"); - await expect(app.findAndReplaceWidget).toBeVisible(); + await expect(app.findAndReplaceWidget.first()).toBeVisible(); }); test("New tab displays workspaces", async ({ page, context }) => { diff --git a/apps/server/package.json b/apps/server/package.json index 204086f0f..2b8836251 100644 --- a/apps/server/package.json +++ b/apps/server/package.json @@ -87,8 +87,8 @@ "mime-types": "3.0.1", "multer": "2.0.0", "normalize-strings": "1.1.1", - "ollama": "0.5.15", - "openai": "4.103.0", + "ollama": "0.5.16", + "openai": "4.104.0", "rand-token": "1.0.1", "safe-compare": "1.1.4", "sanitize-filename": "1.6.3", diff --git a/apps/server/scripts/build-server.sh b/apps/server/scripts/build-server.sh index 313726c86..b81e2901a 100644 --- a/apps/server/scripts/build-server.sh +++ b/apps/server/scripts/build-server.sh @@ -21,7 +21,7 @@ fi echo "Selected Arch: $ARCH" # Set Node.js version and architecture-specific filename -NODE_VERSION=22.14.0 +NODE_VERSION=22.16.0 script_dir=$(realpath $(dirname $0)) BUILD_DIR="$script_dir/../dist" @@ -43,7 +43,7 @@ rm -rf $BUILD_DIR/node/lib/node_modules/{npm,corepack} \ $BUILD_DIR/node_modules/electron* \ $BUILD_DIR/electron*.{js,map} -printf "#!/bin/sh\n./node/bin/node src/main\n" > $BUILD_DIR/trilium.sh +printf "#!/bin/sh\n./node/bin/node main.cjs\n" > $BUILD_DIR/trilium.sh chmod 755 $BUILD_DIR/trilium.sh VERSION=`jq -r ".version" package.json` diff --git a/apps/server/src/assets/db/migrations/0215__content_structure.sql b/apps/server/src/assets/db/migrations/0215__content_structure.sql deleted file mode 100644 index da4afcf6b..000000000 --- a/apps/server/src/assets/db/migrations/0215__content_structure.sql +++ /dev/null @@ -1,13 +0,0 @@ -CREATE TABLE IF NOT EXISTS "blobs" ( - `blobId` TEXT NOT NULL, - `content` TEXT NULL DEFAULT NULL, - `dateModified` TEXT NOT NULL, - `utcDateModified` TEXT NOT NULL, - PRIMARY KEY(`blobId`) -); - -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); diff --git a/apps/server/src/assets/db/migrations/0217__drop_content_tables.sql b/apps/server/src/assets/db/migrations/0217__drop_content_tables.sql deleted file mode 100644 index 549fd6919..000000000 --- a/apps/server/src/assets/db/migrations/0217__drop_content_tables.sql +++ /dev/null @@ -1,4 +0,0 @@ -DROP TABLE note_contents; -DROP TABLE note_revision_contents; - -DELETE FROM entity_changes WHERE entityName IN ('note_contents', 'note_revision_contents'); diff --git a/apps/server/src/assets/db/migrations/0218__rename_note_revision_to_revision.sql b/apps/server/src/assets/db/migrations/0218__rename_note_revision_to_revision.sql deleted file mode 100644 index c67c52393..000000000 --- a/apps/server/src/assets/db/migrations/0218__rename_note_revision_to_revision.sql +++ /dev/null @@ -1,26 +0,0 @@ -CREATE TABLE IF NOT EXISTS "revisions" (`revisionId` TEXT NOT NULL PRIMARY KEY, - `noteId` TEXT NOT NULL, - type TEXT DEFAULT '' NOT NULL, - mime TEXT DEFAULT '' NOT NULL, - `title` TEXT NOT NULL, - `isProtected` INT NOT NULL DEFAULT 0, - blobId TEXT DEFAULT NULL, - `utcDateLastEdited` TEXT NOT NULL, - `utcDateCreated` TEXT NOT NULL, - `utcDateModified` TEXT NOT NULL, - `dateLastEdited` TEXT NOT NULL, - `dateCreated` TEXT NOT NULL); - -INSERT INTO revisions (revisionId, noteId, type, mime, title, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, blobId) -SELECT noteRevisionId, noteId, type, mime, title, isProtected, utcDateLastEdited, utcDateCreated, utcDateModified, dateLastEdited, dateCreated, blobId FROM note_revisions; - -DROP TABLE note_revisions; - -CREATE INDEX `IDX_revisions_noteId` ON `revisions` (`noteId`); -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'; diff --git a/apps/server/src/assets/db/migrations/0219__attachments.sql b/apps/server/src/assets/db/migrations/0219__attachments.sql deleted file mode 100644 index 246360bfe..000000000 --- a/apps/server/src/assets/db/migrations/0219__attachments.sql +++ /dev/null @@ -1,23 +0,0 @@ -CREATE TABLE IF NOT EXISTS "attachments" -( - attachmentId TEXT not null primary key, - ownerId TEXT not null, - role TEXT not null, - mime TEXT not null, - title TEXT not null, - isProtected INT not null DEFAULT 0, - position INT default 0 not null, - blobId TEXT DEFAULT null, - dateModified TEXT NOT NULL, - utcDateModified TEXT not null, - utcDateScheduledForErasureSince TEXT DEFAULT NULL, - isDeleted INT not null, - deleteId TEXT DEFAULT NULL); - -CREATE INDEX IDX_attachments_ownerId_role - on attachments (ownerId, role); - -CREATE INDEX IDX_attachments_utcDateScheduledForErasureSince - on attachments (utcDateScheduledForErasureSince); - -CREATE INDEX IF NOT EXISTS IDX_attachments_blobId on attachments (blobId); diff --git a/apps/server/src/assets/db/migrations/0221__remove_hideIncludedImages_main_option.sql b/apps/server/src/assets/db/migrations/0221__remove_hideIncludedImages_main_option.sql deleted file mode 100644 index 5e4ec083b..000000000 --- a/apps/server/src/assets/db/migrations/0221__remove_hideIncludedImages_main_option.sql +++ /dev/null @@ -1,2 +0,0 @@ -DELETE FROM options WHERE name = 'hideIncludedImages_main'; -DELETE FROM entity_changes WHERE entityName = 'options' AND entityId = 'hideIncludedImages_main'; \ No newline at end of file diff --git a/apps/server/src/assets/db/migrations/0222__rename_openTabs_to_openNoteContexts.sql b/apps/server/src/assets/db/migrations/0222__rename_openTabs_to_openNoteContexts.sql deleted file mode 100644 index c4d719bce..000000000 --- a/apps/server/src/assets/db/migrations/0222__rename_openTabs_to_openNoteContexts.sql +++ /dev/null @@ -1,2 +0,0 @@ -UPDATE options SET name = 'openNoteContexts' WHERE name = 'openTabs'; -UPDATE entity_changes SET entityId = 'openNoteContexts' WHERE entityName = 'options' AND entityId = 'openTabs'; diff --git a/apps/server/src/assets/db/migrations/0223__NOOP.sql b/apps/server/src/assets/db/migrations/0223__NOOP.sql deleted file mode 100644 index e0ac49d1e..000000000 --- a/apps/server/src/assets/db/migrations/0223__NOOP.sql +++ /dev/null @@ -1 +0,0 @@ -SELECT 1; diff --git a/apps/server/src/assets/db/migrations/0224__fix_blobIds.sql b/apps/server/src/assets/db/migrations/0224__fix_blobIds.sql deleted file mode 100644 index 725e9d1f2..000000000 --- a/apps/server/src/assets/db/migrations/0224__fix_blobIds.sql +++ /dev/null @@ -1,14 +0,0 @@ -UPDATE blobs SET blobId = REPLACE(blobId, '+', 'X'); -UPDATE blobs SET blobId = REPLACE(blobId, '/', 'Y'); - -UPDATE notes SET blobId = REPLACE(blobId, '+', 'X'); -UPDATE notes SET blobId = REPLACE(blobId, '/', 'Y'); - -UPDATE attachments SET blobId = REPLACE(blobId, '+', 'X'); -UPDATE attachments SET blobId = REPLACE(blobId, '/', 'Y'); - -UPDATE revisions SET blobId = REPLACE(blobId, '+', 'X'); -UPDATE revisions SET blobId = REPLACE(blobId, '/', 'Y'); - -UPDATE entity_changes SET entityId = REPLACE(entityId, '+', 'X') WHERE entityName = 'blobs'; -UPDATE entity_changes SET entityId = REPLACE(entityId, '/', 'Y') WHERE entityName = 'blobs'; diff --git a/apps/server/src/assets/db/migrations/0225__create_blobId_indices.sql b/apps/server/src/assets/db/migrations/0225__create_blobId_indices.sql deleted file mode 100644 index bd3445447..000000000 --- a/apps/server/src/assets/db/migrations/0225__create_blobId_indices.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE INDEX IF NOT EXISTS IDX_notes_blobId on notes (blobId); -CREATE INDEX IF NOT EXISTS IDX_revisions_blobId on revisions (blobId); -CREATE INDEX IF NOT EXISTS IDX_attachments_blobId on attachments (blobId); diff --git a/apps/server/src/assets/db/migrations/0226__rename_noteSize_label.sql b/apps/server/src/assets/db/migrations/0226__rename_noteSize_label.sql deleted file mode 100644 index cd2239af4..000000000 --- a/apps/server/src/assets/db/migrations/0226__rename_noteSize_label.sql +++ /dev/null @@ -1 +0,0 @@ -UPDATE attributes SET value = 'contentAndAttachmentsAndRevisionsSize' WHERE name = 'orderBy' AND value = 'noteSize'; diff --git a/apps/server/src/assets/db/migrations/0227__disable_image_compression.sql b/apps/server/src/assets/db/migrations/0227__disable_image_compression.sql deleted file mode 100644 index a5350deff..000000000 --- a/apps/server/src/assets/db/migrations/0227__disable_image_compression.sql +++ /dev/null @@ -1,2 +0,0 @@ --- emergency disabling of image compression since it appears to make problems in migration to 0.61 -UPDATE options SET value = 'false' WHERE name = 'compressImages'; diff --git a/apps/server/src/assets/db/migrations/0228__fix_blobIds.sql b/apps/server/src/assets/db/migrations/0228__fix_blobIds.sql deleted file mode 100644 index 339a6100a..000000000 --- a/apps/server/src/assets/db/migrations/0228__fix_blobIds.sql +++ /dev/null @@ -1,17 +0,0 @@ --- + is normally replaced by X and / by Y, but this can temporarily cause UNIQUE key exception --- this might create blob duplicates, but cleanup will eventually take care of it - -UPDATE blobs SET blobId = REPLACE(blobId, '+', 'A'); -UPDATE blobs SET blobId = REPLACE(blobId, '/', 'B'); - -UPDATE notes SET blobId = REPLACE(blobId, '+', 'A'); -UPDATE notes SET blobId = REPLACE(blobId, '/', 'B'); - -UPDATE attachments SET blobId = REPLACE(blobId, '+', 'A'); -UPDATE attachments SET blobId = REPLACE(blobId, '/', 'B'); - -UPDATE revisions SET blobId = REPLACE(blobId, '+', 'A'); -UPDATE revisions SET blobId = REPLACE(blobId, '/', 'B'); - -UPDATE entity_changes SET entityId = REPLACE(entityId, '+', 'A') WHERE entityName = 'blobs'; -UPDATE entity_changes SET entityId = REPLACE(entityId, '/', 'B') WHERE entityName = 'blobs'; diff --git a/apps/server/src/assets/db/migrations/0229__add_oauth_user_data_table.sql b/apps/server/src/assets/db/migrations/0229__add_oauth_user_data_table.sql deleted file mode 100644 index ea2db4ef9..000000000 --- a/apps/server/src/assets/db/migrations/0229__add_oauth_user_data_table.sql +++ /dev/null @@ -1,14 +0,0 @@ --- Add the oauth user data table -CREATE TABLE IF NOT EXISTS "user_data" -( - tmpID INT, - username TEXT, - email TEXT, - userIDEncryptedDataKey TEXT, - userIDVerificationHash TEXT, - salt TEXT, - derivedKey TEXT, - isSetup TEXT DEFAULT "false", - UNIQUE (tmpID), - PRIMARY KEY (tmpID) -); \ No newline at end of file diff --git a/apps/server/src/assets/db/migrations/0230__vector_embeddings.sql b/apps/server/src/assets/db/migrations/0230__vector_embeddings.sql deleted file mode 100644 index 45f14fddf..000000000 --- a/apps/server/src/assets/db/migrations/0230__vector_embeddings.sql +++ /dev/null @@ -1,46 +0,0 @@ --- Add tables for vector embeddings storage and management --- This migration adds embedding support to the main document.db database - --- Store embeddings for notes -CREATE TABLE IF NOT EXISTS "note_embeddings" ( - "embedId" TEXT NOT NULL PRIMARY KEY, - "noteId" TEXT NOT NULL, - "providerId" TEXT NOT NULL, - "modelId" TEXT NOT NULL, - "dimension" INTEGER NOT NULL, - "embedding" BLOB NOT NULL, - "version" INTEGER NOT NULL DEFAULT 1, - "dateCreated" TEXT NOT NULL, - "utcDateCreated" TEXT NOT NULL, - "dateModified" TEXT NOT NULL, - "utcDateModified" TEXT NOT NULL -); - -CREATE INDEX "IDX_note_embeddings_noteId" ON "note_embeddings" ("noteId"); -CREATE INDEX "IDX_note_embeddings_providerId_modelId" ON "note_embeddings" ("providerId", "modelId"); - --- Table to track which notes need embedding updates -CREATE TABLE IF NOT EXISTS "embedding_queue" ( - "noteId" TEXT NOT NULL PRIMARY KEY, - "operation" TEXT NOT NULL, -- CREATE, UPDATE, DELETE - "dateQueued" TEXT NOT NULL, - "utcDateQueued" TEXT NOT NULL, - "priority" INTEGER NOT NULL DEFAULT 0, - "attempts" INTEGER NOT NULL DEFAULT 0, - "lastAttempt" TEXT NULL, - "error" TEXT NULL, - "failed" INTEGER NOT NULL DEFAULT 0, - "isProcessing" INTEGER NOT NULL DEFAULT 0 -); - --- Table to store embedding provider configurations -CREATE TABLE IF NOT EXISTS "embedding_providers" ( - "providerId" TEXT NOT NULL PRIMARY KEY, - "name" TEXT NOT NULL, - "priority" INTEGER NOT NULL DEFAULT 0, - "config" TEXT NOT NULL, -- JSON config object - "dateCreated" TEXT NOT NULL, - "utcDateCreated" TEXT NOT NULL, - "dateModified" TEXT NOT NULL, - "utcDateModified" TEXT NOT NULL -); \ No newline at end of file diff --git a/apps/server/src/assets/db/migrations/0231__session_store.sql b/apps/server/src/assets/db/migrations/0231__session_store.sql deleted file mode 100644 index de245d25c..000000000 --- a/apps/server/src/assets/db/migrations/0231__session_store.sql +++ /dev/null @@ -1,5 +0,0 @@ -CREATE TABLE IF NOT EXISTS sessions ( - id TEXT PRIMARY KEY, - data TEXT, - expires INTEGER -); \ No newline at end of file diff --git a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged version for Linux.html b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged version for Linux.html index fb75e87d3..6d92fef26 100644 --- a/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged version for Linux.html +++ b/apps/server/src/assets/doc_notes/en/User Guide/User Guide/Installation & Setup/Server Installation/1. Installing the server/Packaged version for Linux.html @@ -3,8 +3,9 @@

Steps