1
0
Fork 0
mirror of synced 2024-07-05 22:40:39 +12:00

Make sure new column name cannot be the same as an existing column name.

This commit is contained in:
Sam Rose 2023-10-25 16:41:37 +01:00
parent c5097487e2
commit e03b1be9d1
No known key found for this signature in database

View file

@ -17,8 +17,8 @@
$: error = checkNewColumnName(newColumnName)
const checkNewColumnName = newColumnName => {
if (column.schema.name === newColumnName) {
return "New column name can't be the same as the existing column name."
if (newColumnName in $definition.schema) {
return "New column name can't be the same as an existing column name."
}
if (newColumnName.match(ValidColumnNameRegex) === null) {
return "Illegal character; must be alpha-numeric."