refs #5541 Custom user field
gitea/mylogger/pipeline/head This commit looks good Details

This commit is contained in:
Juan Ferrer 2023-04-13 18:31:43 +02:00
parent c007d316e8
commit c3c5d2118e
4 changed files with 14 additions and 4 deletions

View File

@ -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

View File

@ -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,

7
package-lock.json generated
View File

@ -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": {

View File

@ -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",