Fix switch

This commit is contained in:
Adria Navarro 2024-04-26 09:15:00 +02:00
parent 92b3cb2d92
commit 34d97ab16a
1 changed files with 13 additions and 2 deletions

View File

@ -54,7 +54,8 @@ function generateSchema(
) { ) {
continue continue
} }
switch (column.type) { const columnType = column.type
switch (columnType) {
case FieldType.STRING: case FieldType.STRING:
case FieldType.OPTIONS: case FieldType.OPTIONS:
case FieldType.LONGFORM: case FieldType.LONGFORM:
@ -128,8 +129,18 @@ function generateSchema(
.references(`${tableName}.${relatedPrimary}`) .references(`${tableName}.${relatedPrimary}`)
} }
break break
case FieldType.FORMULA:
// This is allowed, but nothing to do on the external datasource
break
case FieldType.ATTACHMENTS:
case FieldType.ATTACHMENT_SINGLE:
case FieldType.AUTO:
case FieldType.JSON:
case FieldType.INTERNAL:
throw `${column.type} is not a valid SQL type`
default: default:
utils.unreachable(column.type) utils.unreachable(columnType)
} }
} }