content migration fixes

This commit is contained in:
zadam
2019-03-27 21:04:25 +01:00
parent 29c60581a6
commit 07e9013152
33 changed files with 358 additions and 919 deletions

View File

@@ -58,7 +58,7 @@ async function sync() {
};
}
else {
log.info("sync failed: " + e.message);
log.info("sync failed: " + e.message + e.stack);
return {
success: false,
@@ -262,6 +262,12 @@ async function getEntityRow(entityName, entityId) {
const entity = await sql.getRow(`SELECT * FROM ${entityName} WHERE ${primaryKey} = ?`, [entityId]);
if (!entity) {
console.log(entityName, entityId);
console.log(`SELECT * FROM ${entityName} WHERE ${primaryKey} = '${entityId}'`);
}
if (['note_contents', 'note_revisions'].includes(entityName) && entity.content !== null) {
if (typeof entity.content === 'string') {
entity.content = Buffer.from(entity.content, 'UTF-8');