mirror of
https://github.com/dbgate/dbgate
synced 2024-11-07 20:26:23 +00:00
db analyser fix
This commit is contained in:
parent
d4bd6e03c9
commit
87988d5c3a
@ -29,7 +29,7 @@ const hasPermission = require('../utility/hasPermission');
|
|||||||
|
|
||||||
const preinstallPluginMinimalVersions = {
|
const preinstallPluginMinimalVersions = {
|
||||||
'dbgate-plugin-mssql': '1.2.0',
|
'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-postgres': '1.2.0',
|
||||||
'dbgate-plugin-csv': '1.0.8',
|
'dbgate-plugin-csv': '1.0.8',
|
||||||
'dbgate-plugin-excel': '1.0.6',
|
'dbgate-plugin-excel': '1.0.6',
|
||||||
|
@ -40,7 +40,7 @@ export class DatabaseAnalyser {
|
|||||||
return this._runAnalysis();
|
return this._runAnalysis();
|
||||||
}
|
}
|
||||||
|
|
||||||
mergeAnalyseResult(newlyAnalysed, extractObjectId) {
|
mergeAnalyseResult(newlyAnalysed) {
|
||||||
if (this.structure == null) {
|
if (this.structure == null) {
|
||||||
return {
|
return {
|
||||||
...DatabaseAnalyser.createEmptyStructure(),
|
...DatabaseAnalyser.createEmptyStructure(),
|
||||||
@ -52,12 +52,12 @@ export class DatabaseAnalyser {
|
|||||||
for (const field of ['tables', 'views', 'functions', 'procedures', 'triggers']) {
|
for (const field of ['tables', 'views', 'functions', 'procedures', 'triggers']) {
|
||||||
const removedIds = this.modifications
|
const removedIds = this.modifications
|
||||||
.filter(x => x.action == 'remove' && x.objectTypeField == field)
|
.filter(x => x.action == 'remove' && x.objectTypeField == field)
|
||||||
.map(x => extractObjectId(x));
|
.map(x => x.objectId);
|
||||||
const newArray = newlyAnalysed[field] || [];
|
const newArray = newlyAnalysed[field] || [];
|
||||||
const addedChangedIds = newArray.map(x => extractObjectId(x));
|
const addedChangedIds = newArray.map(x => x.objectId);
|
||||||
const removeAllIds = [...removedIds, ...addedChangedIds];
|
const removeAllIds = [...removedIds, ...addedChangedIds];
|
||||||
res[field] = _sortBy(
|
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
|
x => x.pureName
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user