Skip to content

Build your personal knowledge base with Trilium Notes

added also "sqlConsoleHome"

zadam16c4b8aa4365
diff --git a/src/routes/api/date_notes.js b/src/routes/api/date_notes.js
index 6ff16b2e4a..413d20f836 100644
--- a/src/routes/api/date_notes.js
+++ b/src/routes/api/date_notes.js
@@ -42,10 +42,12 @@ function getDateNotesForMonth(req) {
function createSqlConsole() {
const today = dateUtils.localNowDate();
- const todayNote = dateNoteService.getDateNote(today);
+ const sqlConsoleHome =
+ attributeService.getNoteWithLabel('sqlConsoleHome')
+ || dateNoteService.getDateNote(today);
const {note} = noteService.createNewNote({
- parentNoteId: todayNote.noteId,
+ parentNoteId: sqlConsoleHome.noteId,
title: 'SQL Console',
content: "SELECT title, isDeleted, isProtected FROM notes WHERE noteId = ''\n\n\n\n",
type: 'code',
diff --git a/src/services/attributes.js b/src/services/attributes.js
index 5a5fc53223..6d526eb8cc 100644
--- a/src/services/attributes.js
+++ b/src/services/attributes.js
@@ -37,6 +37,7 @@ const BUILTIN_ATTRIBUTES = [
{ type: 'label', name: 'workspaceIconClass' },
{ type: 'label', name: 'workspaceTabBackgroundColor' },
{ type: 'label', name: 'searchHome' },
+ { type: 'label', name: 'sqlConsoleHome' },
// relation names
{ type: 'relation', name: 'runOnNoteCreation', isDangerous: true },