fix: index deletion issue

This commit is contained in:
Fabio Di Stasio 2020-12-01 17:29:16 +01:00
parent 41505bde65
commit f8cf90a89e
2 changed files with 7 additions and 7 deletions

View File

@ -329,8 +329,6 @@ export class MySQLClient extends AntaresCore {
options
} = params;
console.log(params);
let sql = `ALTER TABLE \`${table}\` `;
const alterColumns = [];

View File

@ -303,11 +303,13 @@ export default {
this.originalIndexes.forEach(originalIndex => {
const lI = this.localIndexes.findIndex(localIndex => localIndex._id === originalIndex._id);
if (JSON.stringify(originalIndex) !== JSON.stringify(this.localIndexes[lI])) {
indexChanges.changes.push({
...this.localIndexes[lI],
oldName: originalIndex.name,
oldType: originalIndex.type
});
if (this.localIndexes[lI]) {
indexChanges.changes.push({
...this.localIndexes[lI],
oldName: originalIndex.name,
oldType: originalIndex.type
});
}
}
});