This commit is contained in:
parent
c007d316e8
commit
c3c5d2118e
|
@ -19,6 +19,8 @@ dstDb:
|
|||
user: root
|
||||
password: password
|
||||
database: util
|
||||
userField:
|
||||
- editorFk
|
||||
showFields:
|
||||
- name
|
||||
- description
|
||||
|
@ -27,7 +29,7 @@ castTypes:
|
|||
tinyint: boolean
|
||||
logs:
|
||||
item:
|
||||
logTable: vn.itemLog
|
||||
logTable: itemLog
|
||||
mainTable: item
|
||||
tables:
|
||||
- name: item
|
||||
|
|
|
@ -77,6 +77,7 @@ module.exports = class MyLogger {
|
|||
showField,
|
||||
relation,
|
||||
idName,
|
||||
userField: tableConf.userField || conf.userField
|
||||
});
|
||||
|
||||
return tableInfo;
|
||||
|
@ -199,7 +200,7 @@ module.exports = class MyLogger {
|
|||
);
|
||||
|
||||
for (const {col, type, def} of dbCols) {
|
||||
if (!tableInfo.exclude.has(col) && col != 'editorFk')
|
||||
if (!tableInfo.exclude.has(col) && col != tableInfo.userField)
|
||||
tableInfo.columns.set(col, {type, def});
|
||||
|
||||
const castType = conf.castTypes[type];
|
||||
|
@ -653,7 +654,7 @@ module.exports = class MyLogger {
|
|||
if (!isDelete || !deleteRow) {
|
||||
await logInfo.addStmt.execute([
|
||||
originFk,
|
||||
row.editorFk || null,
|
||||
row[tableInfo.userField] || null,
|
||||
action,
|
||||
created,
|
||||
modelName,
|
||||
|
|
|
@ -1,13 +1,20 @@
|
|||
{
|
||||
"name": "mylogger",
|
||||
"version": "0.1.10",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mylogger",
|
||||
"version": "0.1.10",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"colors": "^1.4.0",
|
||||
"mysql2": "^2.3.3",
|
||||
"require-yaml": "^0.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"../zongji": {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mylogger",
|
||||
"version": "0.1.9",
|
||||
"version": "0.1.10",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "MySQL and MariaDB logger using binary log",
|
||||
"license": "GPL-3.0",
|
||||
|
|
Loading…
Reference in New Issue