Fixing issue #2276 - allows reverting a SQL column to null if no input.

This commit is contained in:
mike12345567 2021-10-06 17:52:12 +01:00
parent 3cea3dd510
commit d482b01263
1 changed files with 6 additions and 1 deletions

View File

@ -178,7 +178,12 @@ module External {
manyRelationships: ManyRelationship[] = [] manyRelationships: ManyRelationship[] = []
for (let [key, field] of Object.entries(table.schema)) { for (let [key, field] of Object.entries(table.schema)) {
// if set already, or not set just skip it // if set already, or not set just skip it
if (!row[key] || newRow[key] || field.autocolumn) { if ((!row[key] && row[key] !== "") || newRow[key] || field.autocolumn) {
continue
}
// if its an empty string then it means return the column to null (if possible)
if (row[key] === "") {
newRow[key] = null
continue continue
} }
// parse floats/numbers // parse floats/numbers