Fix tests
This commit is contained in:
parent
e1c092d65d
commit
8afb0e3c91
|
@ -304,8 +304,8 @@ function shouldCopyRelationship(
|
||||||
* @param fetchedColumn The fetched column to check for the type in the external database.
|
* @param fetchedColumn The fetched column to check for the type in the external database.
|
||||||
*/
|
*/
|
||||||
function shouldCopySpecialColumn(
|
function shouldCopySpecialColumn(
|
||||||
column: { type: string },
|
column: { type: FieldType },
|
||||||
fetchedColumn: { type: string } | undefined
|
fetchedColumn: { type: FieldType } | undefined
|
||||||
) {
|
) {
|
||||||
const isFormula = column.type === FieldType.FORMULA
|
const isFormula = column.type === FieldType.FORMULA
|
||||||
// column has been deleted, remove - formulas will never exist, always copy
|
// column has been deleted, remove - formulas will never exist, always copy
|
||||||
|
@ -348,12 +348,13 @@ function copyExistingPropsOver(
|
||||||
}
|
}
|
||||||
const column = existingTableSchema[key]
|
const column = existingTableSchema[key]
|
||||||
|
|
||||||
|
const existingColumnType = column?.type
|
||||||
|
const updatedColumnType = table.schema[key]?.type
|
||||||
|
|
||||||
// If the db column type changed to a non-compatible one, we want to re-fetch it
|
// If the db column type changed to a non-compatible one, we want to re-fetch it
|
||||||
if (
|
if (
|
||||||
table.schema[key].type !== existingTableSchema[key].type &&
|
updatedColumnType !== existingColumnType &&
|
||||||
!SWITCHABLE_TYPES[existingTableSchema[key].type]?.includes(
|
!SWITCHABLE_TYPES[existingColumnType]?.includes(updatedColumnType)
|
||||||
table.schema[key].type
|
|
||||||
)
|
|
||||||
) {
|
) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue