Make sure new column name cannot be the same as an existing column name.
This commit is contained in:
parent
c5097487e2
commit
e03b1be9d1
|
@ -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."
|
||||
|
|
Loading…
Reference in New Issue