core: fix database image is malformed error when deleting vault

This commit is contained in:
Abdullah Atta
2024-02-23 19:50:32 +05:00
parent 681681d0ab
commit 61007b92a2
2 changed files with 2 additions and 2 deletions

View File

@@ -185,7 +185,7 @@ test("delete vault without deleting all locked notes", () =>
await db.vault.delete();
expect(await db.relations.from(vault, "note").has(id)).toBe(false);
expect(await db.relations.from(vault, "note").has(id)).toBe(true);
expect(await db.vaults.default()).toBeUndefined();
}));

View File

@@ -56,7 +56,7 @@ export async function createTriggers(db: Kysely<RawDatabaseSchema>) {
content_fts: sql.lit("delete"),
rowid: sql.ref("old.rowid"),
id: sql.ref("old.id"),
data: sql.ref("old.data"),
data: sql`IIF(old.locked == 1, '', old.data)`,
noteId: sql.ref("old.noteId")
})
)