refs #5541 Debug fixes, fetch delete id index usage fix
gitea/mylogger/pipeline/head This commit looks good
Details
gitea/mylogger/pipeline/head This commit looks good
Details
This commit is contained in:
parent
810fb55416
commit
16391f146d
10
mylogger.js
10
mylogger.js
|
@ -167,7 +167,9 @@ module.exports = class MyLogger {
|
|||
`SELECT id FROM ${sqlTable}
|
||||
WHERE changedModel = ?
|
||||
AND changedModelId = ?
|
||||
AND action = 'delete'`
|
||||
AND action = 'delete'
|
||||
AND (originFk IS NULL OR originFk = ?)
|
||||
LIMIT 1`
|
||||
);
|
||||
logInfo.updateStmt = await db.prepare(
|
||||
`UPDATE ${sqlTable}
|
||||
|
@ -542,7 +544,7 @@ module.exports = class MyLogger {
|
|||
|
||||
if (!changes.length) return;
|
||||
|
||||
if (this.debug)
|
||||
if (this.conf.debug)
|
||||
console.debug('Evt:'.blue,
|
||||
`[${action}]`[actionColor[action]], `${tableName}: ${changes.length} changes`);
|
||||
|
||||
|
@ -644,14 +646,14 @@ module.exports = class MyLogger {
|
|||
: modelId;
|
||||
|
||||
let deleteRow;
|
||||
if (this.debug)
|
||||
if (this.conf.debug)
|
||||
console.debug('Log:'.blue,
|
||||
`[${action}]`[actionColor[action]], `${modelName}: ${modelId}`);
|
||||
|
||||
try {
|
||||
if (isDelete) {
|
||||
[[deleteRow]] = await logInfo.fetchStmt.execute([
|
||||
modelName, modelId
|
||||
modelName, modelId, originFk
|
||||
]);
|
||||
if (deleteRow)
|
||||
await logInfo.updateStmt.execute([
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "mylogger",
|
||||
"version": "0.1.14",
|
||||
"version": "0.1.15",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "mylogger",
|
||||
"version": "0.1.14",
|
||||
"version": "0.1.15",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"colors": "^1.4.0",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "mylogger",
|
||||
"version": "0.1.14",
|
||||
"version": "0.1.15",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "MySQL and MariaDB logger using binary log",
|
||||
"license": "GPL-3.0",
|
||||
|
|
Loading…
Reference in New Issue