Ensure that the default value for a column should be used if it is made empty. #5308

pull/5349/head
Nikhil Mohite 2022-09-22 11:40:22 +05:30 committed by Akshay Joshi
parent 033ee23eba
commit 3765131d21
2 changed files with 7 additions and 0 deletions

View File

@ -23,3 +23,5 @@ Housekeeping
Bug fixes
*********
| `Issue #5308 <https://github.com/pgadmin-org/pgadmin4/issues/5308>`_ - Ensure that the default value for a column should be used if it is made empty.

View File

@ -1248,6 +1248,11 @@ export function ResultSet() {
let row = newRows[otherInfo.indexes[0]];
let clientPK = rowKeyGetter(row);
// Check if column is pk and value is null set it to default value.
if(otherInfo.column.has_default_val && _.isNull(row[otherInfo.column.key])) {
row[otherInfo.column.key] = undefined;
}
if(clientPK in (dataChangeStore.added || {})) {
/* No need to track this */
} else if(clientPK in (dataChangeStore.updated || {})) {