fix export/import for multi-valued attributes

This commit is contained in:
azivner
2018-03-03 09:30:18 -05:00
parent d169f67901
commit 8c7d159012
3 changed files with 19 additions and 7 deletions

View File

@@ -62,12 +62,14 @@ async function createAttribute(noteId, name, value = "", sourceId = null) {
const now = utils.nowDate();
const attributeId = utils.newAttributeId();
const position = 1 + await sql.getValue(`SELECT COALESCE(MAX(position), 0) FROM attributes WHERE noteId = ?`, [noteId]);
await sql.insert("attributes", {
attributeId: attributeId,
noteId: noteId,
name: name,
value: value,
position: position,
dateModified: now,
dateCreated: now,
isDeleted: false