|
|
|
@ -44,14 +44,10 @@ exports.save = async function (ctx) { |
|
|
|
// the column if you want to change the type
|
|
|
|
if (oldTable && oldTable.schema) { |
|
|
|
for (let propKey of Object.keys(tableToSave.schema)) { |
|
|
|
let column = tableToSave.schema[propKey] |
|
|
|
let oldColumn = oldTable.schema[propKey] |
|
|
|
if (oldColumn && oldColumn.type === "internal") { |
|
|
|
oldColumn.type = "auto" |
|
|
|
} |
|
|
|
if (oldColumn && oldColumn.type !== column.type) { |
|
|
|
ctx.throw(400, "Cannot change the type of a column") |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|