mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 10:40:41 +01:00
unifying surrogate keys for event log and options, fixes #103
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
const build = require('./build');
|
||||
const packageJson = require('../../package');
|
||||
|
||||
const APP_DB_VERSION = 95;
|
||||
const APP_DB_VERSION = 96;
|
||||
|
||||
module.exports = {
|
||||
appVersion: packageJson.version,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
const sql = require('./sql');
|
||||
const dateUtils = require('./date_utils');
|
||||
const utils = require('./utils');
|
||||
const log = require('./log');
|
||||
|
||||
async function addEvent(comment) {
|
||||
@@ -8,9 +9,10 @@ async function addEvent(comment) {
|
||||
|
||||
async function addNoteEvent(noteId, comment) {
|
||||
await sql.insert('event_log', {
|
||||
noteId : noteId,
|
||||
comment: comment,
|
||||
dateCreated: dateUtils.nowDate()
|
||||
eventId: utils.newEntityId(),
|
||||
noteId : noteId,
|
||||
comment: comment,
|
||||
dateCreated: dateUtils.nowDate()
|
||||
});
|
||||
|
||||
log.info("Event log for " + noteId + ": " + comment);
|
||||
|
||||
@@ -207,13 +207,12 @@ const primaryKeys = {
|
||||
"notes": "noteId",
|
||||
"branches": "branchId",
|
||||
"note_revisions": "noteRevisionId",
|
||||
"option": "name",
|
||||
"recent_notes": "branchId",
|
||||
"images": "imageId",
|
||||
"note_images": "noteImageId",
|
||||
"labels": "labelId",
|
||||
"api_tokens": "apiTokenId",
|
||||
"options": "name"
|
||||
"options": "optionId"
|
||||
};
|
||||
|
||||
async function getEntityRow(entityName, entityId) {
|
||||
|
||||
Reference in New Issue
Block a user