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

fix(SQLite): field length lost when editing a table, fixes #664

This commit is contained in:
2023-09-19 18:12:49 +02:00
parent 7e36260cdb
commit b321e64b83
2 changed files with 7 additions and 2 deletions

View File

@ -296,7 +296,13 @@ export class SQLiteClient extends AntaresCore {
// ADD FIELDS
fields.forEach(field => {
const typeInfo = this.getTypeInfo(field.type);
const length = typeInfo?.length ? field.enumValues || field.numLength || field.charLength || field.datePrecision : false;
const length = typeInfo?.length
? field.enumValues ||
field.numLength ||
field.numPrecision ||
field.charLength ||
field.datePrecision
: false;
newColumns.push(`"${field.name}"
${field.type.toUpperCase()}${length ? `(${length})` : ''}