Block timeOnly changes in the api
This commit is contained in:
parent
2cc329994a
commit
b3bea1e839
|
@ -73,6 +73,16 @@ function validate(table: Table, oldTable?: Table) {
|
||||||
`Column "${key}" has subtype "${column.subtype}" - this is not supported.`
|
`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.`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue