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