Skip to content

Commit

Permalink
fix(MySQL): wrong value for fields "on update" in some conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabio286 committed Dec 9, 2021
1 parent 813aa32 commit 359e14a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/ipc-handlers/connection.js
Expand Up @@ -52,7 +52,7 @@ export default connections => {
return { status: 'success' };
}
catch (err) {
return { status: 'error', response: err };
return { status: 'error', response: err.toString() };
}
});

Expand Down
4 changes: 3 additions & 1 deletion src/main/libs/clients/MySQLClient.js
Expand Up @@ -440,7 +440,9 @@ export class MySQLClient extends AntaresCore {
charset: field.CHARACTER_SET_NAME,
collation: field.COLLATION_NAME,
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
};
});
Expand Down

0 comments on commit 359e14a

Please sign in to comment.