mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-28 18:42:28 +08:00
refactor(migration): remove async import from migration scripts
This commit is contained in:
parent
b4310b5275
commit
16ad054d2a
@ -1,3 +1,6 @@
|
|||||||
|
import sql from "../../src/services/sql";
|
||||||
|
import utils from "../../src/services/utils";
|
||||||
|
|
||||||
interface NoteContentsRow {
|
interface NoteContentsRow {
|
||||||
noteId: string;
|
noteId: string;
|
||||||
content: string | Buffer;
|
content: string | Buffer;
|
||||||
@ -11,10 +14,7 @@ interface NoteRevisionContents {
|
|||||||
utcDateModified: string;
|
utcDateModified: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async () => {
|
export default () => {
|
||||||
const sql = (await import("../../src/services/sql")).default;
|
|
||||||
const utils = (await import("../../src/services/utils")).default;
|
|
||||||
|
|
||||||
const existingBlobIds = new Set();
|
const existingBlobIds = new Set();
|
||||||
|
|
||||||
for (const noteId of sql.getColumn<string>(`SELECT noteId FROM note_contents`)) {
|
for (const noteId of sql.getColumn<string>(`SELECT noteId FROM note_contents`)) {
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
export default async () => {
|
import becca from "../../src/becca/becca";
|
||||||
const beccaLoader = (await import("../../src/becca/becca_loader")).default;
|
import becca_loader from "../../src/becca/becca_loader";
|
||||||
const becca = (await import("../../src/becca/becca")).default;
|
import cls from "../../src/services/cls";
|
||||||
const cls = (await import("../../src/services/cls")).default;
|
import log from "../../src/services/log";
|
||||||
const log = (await import("../../src/services/log")).default;
|
import sql from "../../src/services/sql";
|
||||||
const sql = (await import("../../src/services/sql")).default;
|
|
||||||
|
|
||||||
|
export default () => {
|
||||||
cls.init(() => {
|
cls.init(() => {
|
||||||
// emergency disabling of image compression since it appears to make problems in migration to 0.61
|
// emergency disabling of image compression since it appears to make problems in migration to 0.61
|
||||||
sql.execute(`UPDATE options SET value = 'false' WHERE name = 'compressImages'`);
|
sql.execute(`UPDATE options SET value = 'false' WHERE name = 'compressImages'`);
|
||||||
|
|
||||||
beccaLoader.load();
|
becca_loader.load();
|
||||||
|
|
||||||
for (const note of Object.values(becca.notes)) {
|
for (const note of Object.values(becca.notes)) {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user