mirror of
https://github.com/zadam/trilium.git
synced 2025-11-02 03:16:11 +01:00
fix initial document setup
This commit is contained in:
@@ -77,16 +77,21 @@ async function createInitialDatabase(username, password) {
|
||||
await sql.executeScript(schema);
|
||||
|
||||
const Note = require("../entities/note");
|
||||
const NoteContent = require("../entities/note_content");
|
||||
const Branch = require("../entities/branch");
|
||||
|
||||
const rootNote = await new Note({
|
||||
noteId: 'root',
|
||||
title: 'root',
|
||||
content: '',
|
||||
type: 'text',
|
||||
mime: 'text/html'
|
||||
}).save();
|
||||
|
||||
const rootNoteContent = await new NoteContent({
|
||||
noteId: rootNote.noteId,
|
||||
content: ''
|
||||
}).save();
|
||||
|
||||
await new Branch({
|
||||
branchId: 'root',
|
||||
noteId: 'root',
|
||||
@@ -96,7 +101,7 @@ async function createInitialDatabase(username, password) {
|
||||
}).save();
|
||||
|
||||
const tarImportService = require("./import/tar");
|
||||
await tarImportService.importTar(demoFile, rootNote);
|
||||
await tarImportService.importTar(null, demoFile, rootNote);
|
||||
|
||||
const startNoteId = await sql.getValue("SELECT noteId FROM branches WHERE parentNoteId = 'root' AND isDeleted = 0 ORDER BY notePosition");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user