1
1
mirror of https://github.com/Fabio286/antares.git synced 2025-06-05 21:59:22 +02:00

fix: fields default not correctly set in table filler

This commit is contained in:
2021-07-01 19:18:57 +02:00
parent 7ca69e51ae
commit faa07a077c
4 changed files with 20 additions and 13 deletions

View File

@ -333,8 +333,15 @@ export class MySQLClient extends AntaresCore {
const details = fieldArr.slice(2).join(' ');
let defaultValue = null;
if (details.includes('DEFAULT'))
if (details.includes('DEFAULT')) {
defaultValue = details.match(/(?<=DEFAULT ).*?$/gs)[0].split(' COMMENT')[0];
const defaultValueArr = defaultValue.split('');
if (defaultValueArr[0] === '\'') {
defaultValueArr.shift();
defaultValueArr.pop();
defaultValue = defaultValueArr.join('');
}
}
const typeAndLength = nameAndType[1].replace(')', '').split('(');