fix: add attachments support to migrator & backup

This commit is contained in:
thecodrr
2021-10-28 13:37:55 +05:00
parent 3e184345a3
commit 23e584f272
4 changed files with 7 additions and 0 deletions

View File

@@ -24,6 +24,7 @@ class Migrations {
const content = await this._db.content.all(); const content = await this._db.content.all();
const collections = [ const collections = [
{ index: this._db.attachments.all, dbCollection: this._db.attachments },
{ {
index: this._db.notebooks.raw, index: this._db.notebooks.raw,
dbCollection: this._db.notebooks, dbCollection: this._db.notebooks,

View File

@@ -62,6 +62,7 @@ export default class Attachments extends Collection {
const encryptedKey = await this._encryptKey(key); const encryptedKey = await this._encryptKey(key);
const attachmentItem = { const attachmentItem = {
type: "attachment",
id: id(), id: id(),
noteIds: noteId ? [noteId] : [], noteIds: noteId ? [noteId] : [],
iv, iv,

View File

@@ -117,6 +117,10 @@ export default class Backup {
// properly. // properly.
reindex(data); reindex(data);
const collections = [ const collections = [
{
index: data["attachments"],
dbCollection: this._db.attachments,
},
{ {
index: data["notebooks"], index: data["notebooks"],
dbCollection: this._db.notebooks, dbCollection: this._db.notebooks,

View File

@@ -30,6 +30,7 @@ export const migrations = {
note: false, note: false,
notebook: false, notebook: false,
tag: false, tag: false,
attachment: false,
trash: false, trash: false,
tiny: false, tiny: false,
settings: false, settings: false,