delete commented code

This commit is contained in:
Jan Prochazka 2021-05-15 21:30:48 +02:00
parent 87e75c6ba1
commit 0a56e3b782

View File

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