From 0a56e3b782863e999ae8af20bbe77c6c4aa06bcf Mon Sep 17 00:00:00 2001 From: Jan Prochazka Date: Sat, 15 May 2021 21:30:48 +0200 Subject: [PATCH] delete commented code --- .../src/backend/Analyser.js | 94 ------------------- 1 file changed, 94 deletions(-) diff --git a/plugins/dbgate-plugin-mysql/src/backend/Analyser.js b/plugins/dbgate-plugin-mysql/src/backend/Analyser.js index 4e4f9c30..a7d0f6f8 100644 --- a/plugins/dbgate-plugin-mysql/src/backend/Analyser.js +++ b/plugins/dbgate-plugin-mysql/src/backend/Analyser.js @@ -151,100 +151,6 @@ class Analyser extends DatabaseAnalyser { })), }; } - - // getDeletedObjectsForField(nameArray, objectTypeField) { - // return this.structure[objectTypeField] - // .filter(x => !nameArray.includes(x.pureName)) - // .map(x => ({ - // oldName: _.pick(x, ['pureName']), - // action: 'remove', - // objectTypeField, - // objectId: x.pureName, - // })); - // } - - // getDeletedObjects(nameArray) { - // return [ - // ...this.getDeletedObjectsForField(nameArray, 'tables'), - // ...this.getDeletedObjectsForField(nameArray, 'views'), - // ...this.getDeletedObjectsForField(nameArray, 'procedures'), - // ...this.getDeletedObjectsForField(nameArray, 'functions'), - // ...this.getDeletedObjectsForField(nameArray, 'triggers'), - // ]; - // } - - // async getModifications() { - // const tableModificationsQueryData = await this.driver.query(this.pool, this.createQuery('tableModifications')); - // const procedureModificationsQueryData = await this.driver.query( - // this.pool, - // this.createQuery('procedureModifications') - // ); - // const functionModificationsQueryData = await this.driver.query( - // this.pool, - // this.createQuery('functionModifications') - // ); - - // const allModifications = _.compact([ - // ...tableModificationsQueryData.rows.map(x => { - // if (x.objectType == 'BASE TABLE') return { ...x, objectTypeField: 'tables' }; - // if (x.objectType == 'VIEW') return { ...x, objectTypeField: 'views' }; - // return null; - // }), - // ...procedureModificationsQueryData.rows.map(x => ({ - // objectTypeField: 'procedures', - // modifyDate: x.Modified, - // pureName: x.Name, - // })), - // ...functionModificationsQueryData.rows.map(x => ({ - // objectTypeField: 'functions', - // modifyDate: x.Modified, - // pureName: x.Name, - // })), - // ]); - - // // console.log('allModifications', allModifications); - // // console.log( - // // 'DATES', - // // this.structure.procedures.map((x) => x.modifyDate) - // // ); - // // console.log('MOD - SRC', modifications); - // // console.log( - // // 'MODs', - // // this.structure.tables.map((x) => x.modifyDate) - // // ); - // const modifications = allModifications.map(x => { - // const { objectType, modifyDate, pureName } = x; - // const field = objectTypeToField(objectType); - - // if (!field || !this.structure[field]) return null; - // // @ts-ignore - // const obj = this.structure[field].find(x => x.pureName == pureName); - - // // object not modified - // if (obj && Math.abs(new Date(modifyDate).getTime() - new Date(obj.modifyDate).getTime()) < 1000) return null; - - // // console.log('MODIFICATION OF ', field, pureName, modifyDate, obj.modifyDate); - - // /** @type {import('dbgate-types').DatabaseModification} */ - // const action = obj - // ? { - // newName: { pureName }, - // oldName: _.pick(obj, ['pureName']), - // action: 'change', - // objectTypeField: field, - // objectId: pureName, - // } - // : { - // newName: { pureName }, - // action: 'add', - // objectTypeField: field, - // objectId: pureName, - // }; - // return action; - // }); - - // return [..._.compact(modifications), ...this.getDeletedObjects([...allModifications.map(x => x.pureName)])]; - // } } module.exports = Analyser;