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:
@ -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('(');
|
||||
|
||||
|
Reference in New Issue
Block a user