Treat bigint as string

This commit is contained in:
Adria Navarro 2024-08-02 13:44:20 +02:00
parent e8e4f064a5
commit d8f55498ad
2 changed files with 2 additions and 3 deletions

View File

@ -1886,7 +1886,7 @@ describe.each([
[FieldType.INTERNAL]: generator.guid(),
[FieldType.BARCODEQR]: generator.guid(),
[FieldType.SIGNATURE_SINGLE]: setup.structures.basicAttachment(),
[FieldType.BIGINT]: generator.integer(),
[FieldType.BIGINT]: generator.integer().toString(),
[FieldType.BB_REFERENCE]: [{ _id: config.getUser()._id }],
[FieldType.BB_REFERENCE_SINGLE]: { _id: config.getUser()._id },
}
@ -1967,7 +1967,6 @@ describe.each([
expectedRowData["attachment_single"].sample,
false
),
bigint: stringified(expectedRowData["bigint"]),
boolean: stringified(expectedRowData["boolean"]),
json: stringified(expectedRowData["json"]),
number: stringified(expectedRowData["number"]),

View File

@ -164,7 +164,7 @@ export function parse(rows: Rows, table: Table): Rows {
const columnSchema = schema[columnName]
const { type: columnType } = columnSchema
if ([FieldType.NUMBER, FieldType.BIGINT].includes(columnType)) {
if ([FieldType.NUMBER].includes(columnType)) {
// If provided must be a valid number
parsedRow[columnName] = columnData ? Number(columnData) : columnData
} else if (