1
0
Fork 0
mirror of synced 2024-09-09 22:16:26 +12:00

Block timeOnly changes in the api

This commit is contained in:
Adria Navarro 2024-05-22 17:18:58 +02:00
parent 2cc329994a
commit b3bea1e839

View file

@ -73,6 +73,16 @@ function validate(table: Table, oldTable?: Table) {
`Column "${key}" has subtype "${column.subtype}" - this is not supported.`
)
}
if (column.type === FieldType.DATETIME) {
const oldColumn = oldTable?.schema[key] as typeof column
if (column.timeOnly !== oldColumn.timeOnly) {
throw new Error(
`Column "${key}" can not change from time to datetime or viceversa.`
)
}
}
}
}