fix(MySQL): wrong value for fields "on update" in some conditions

This commit is contained in:
Fabio Di Stasio 2021-12-09 12:22:38 +01:00
parent 813aa320d9
commit 359e14a9eb
2 changed files with 4 additions and 2 deletions

View File

@ -52,7 +52,7 @@ export default connections => {
return { status: 'success' }; return { status: 'success' };
} }
catch (err) { catch (err) {
return { status: 'error', response: err }; return { status: 'error', response: err.toString() };
} }
}); });

View File

@ -440,7 +440,9 @@ export class MySQLClient extends AntaresCore {
charset: field.CHARACTER_SET_NAME, charset: field.CHARACTER_SET_NAME,
collation: field.COLLATION_NAME, collation: field.COLLATION_NAME,
autoIncrement: field.EXTRA.includes('auto_increment'), autoIncrement: field.EXTRA.includes('auto_increment'),
onUpdate: field.EXTRA.toLowerCase().includes('on update') ? field.EXTRA.replace('on update', '') : '', onUpdate: field.EXTRA.toLowerCase().includes('on update')
? field.EXTRA.substr(field.EXTRA.indexOf('on update') + 9, field.EXTRA.length)
: '',
comment: field.COLUMN_COMMENT comment: field.COLUMN_COMMENT
}; };
}); });