unify audit fields, fixes #102

This commit is contained in:
azivner
2018-05-26 12:38:25 -04:00
parent 933cce1b94
commit 03bf33630e
9 changed files with 56 additions and 11 deletions

View File

@@ -3,7 +3,7 @@
const build = require('./build');
const packageJson = require('../../package');
const APP_DB_VERSION = 93;
const APP_DB_VERSION = 94;
module.exports = {
appVersion: packageJson.version,

View File

@@ -10,7 +10,7 @@ async function addNoteEvent(noteId, comment) {
await sql.insert('event_log', {
noteId : noteId,
comment: comment,
dateAdded: dateUtils.nowDate()
dateCreated: dateUtils.nowDate()
});
log.info("Event log for " + noteId + ": " + comment);

View File

@@ -127,7 +127,7 @@ async function updateOptions(entity, sourceId) {
async function updateRecentNotes(entity, sourceId) {
const orig = await sql.getRowOrNull("SELECT * FROM recent_notes WHERE branchId = ?", [entity.branchId]);
if (orig === null || orig.dateAccessed < entity.dateAccessed) {
if (orig === null || orig.dateCreated < entity.dateCreated) {
await sql.transactional(async () => {
await sql.replace('recent_notes', entity);