Fixing some issues with types being lost when fetching SQL tables, after making changes to tables within Budibase.
This commit is contained in:
parent
0d5eefa727
commit
6d6e83f7c8
|
@ -207,11 +207,20 @@ function shouldCopySpecialColumn(
|
|||
column: { type: string },
|
||||
fetchedColumn: { type: string } | undefined
|
||||
) {
|
||||
const specialTypes = [
|
||||
FieldTypes.OPTIONS,
|
||||
FieldTypes.LONGFORM,
|
||||
FieldTypes.ARRAY,
|
||||
FieldTypes.FORMULA,
|
||||
]
|
||||
if (column && !fetchedColumn) {
|
||||
return true
|
||||
}
|
||||
const fetchedIsNumber =
|
||||
!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER
|
||||
return (
|
||||
column.type === FieldTypes.OPTIONS ||
|
||||
column.type === FieldTypes.ARRAY ||
|
||||
((!fetchedColumn || fetchedColumn.type === FieldTypes.NUMBER) &&
|
||||
column.type === FieldTypes.BOOLEAN)
|
||||
specialTypes.indexOf(column.type) !== -1 ||
|
||||
(fetchedIsNumber && column.type === FieldTypes.BOOLEAN)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue