From 87988d5c3ac45175cda8adbde9fef5b8e31e39e8 Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Sat, 3 Apr 2021 18:53:46 +0200 Subject: [PATCH] db analyser fix --- packages/api/src/controllers/plugins.js | 2 +- packages/tools/src/DatabaseAnalyser.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/api/src/controllers/plugins.js b/packages/api/src/controllers/plugins.js index d84e3111..3df63ff9 100644 --- a/packages/api/src/controllers/plugins.js +++ b/packages/api/src/controllers/plugins.js @@ -29,7 +29,7 @@ const hasPermission = require('../utility/hasPermission'); const preinstallPluginMinimalVersions = { 'dbgate-plugin-mssql': '1.2.0', - 'dbgate-plugin-mysql': '1.2.1', + 'dbgate-plugin-mysql': '1.2.0', 'dbgate-plugin-postgres': '1.2.0', 'dbgate-plugin-csv': '1.0.8', 'dbgate-plugin-excel': '1.0.6', diff --git a/packages/tools/src/DatabaseAnalyser.ts b/packages/tools/src/DatabaseAnalyser.ts index 0667fa93..3515ba9c 100644 --- a/packages/tools/src/DatabaseAnalyser.ts +++ b/packages/tools/src/DatabaseAnalyser.ts @@ -40,7 +40,7 @@ export class DatabaseAnalyser { return this._runAnalysis(); } - mergeAnalyseResult(newlyAnalysed, extractObjectId) { + mergeAnalyseResult(newlyAnalysed) { if (this.structure == null) { return { ...DatabaseAnalyser.createEmptyStructure(), @@ -52,12 +52,12 @@ export class DatabaseAnalyser { for (const field of ['tables', 'views', 'functions', 'procedures', 'triggers']) { const removedIds = this.modifications .filter(x => x.action == 'remove' && x.objectTypeField == field) - .map(x => extractObjectId(x)); + .map(x => x.objectId); const newArray = newlyAnalysed[field] || []; - const addedChangedIds = newArray.map(x => extractObjectId(x)); + const addedChangedIds = newArray.map(x => x.objectId); const removeAllIds = [...removedIds, ...addedChangedIds]; res[field] = _sortBy( - [...this.structure[field].filter(x => !removeAllIds.includes(extractObjectId(x))), ...newArray], + [...this.structure[field].filter(x => !removeAllIds.includes(x.objectId)), ...newArray], x => x.pureName ); }