mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
fix: add attachments support to migrator & backup
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user