diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui.js index ff2531185..68d1eed93 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/static/js/table.ui.js @@ -407,9 +407,16 @@ export default class TableSchema extends BaseUISchema { readonly: this.inCatalog, },{ id: 'spcname', label: gettext('Tablespace'), - type: 'select', options: this.fieldOptions.spcname, + mode: ['properties', 'create', 'edit'], deps: ['is_partitioned'], - readonly: this.inCatalog, + readonly: this.inCatalog, type: (state)=>{ + return { + type: 'select', options: this.fieldOptions.spcname, + controlProps: { + allowClear: obj.isNew(state) ? true : false, + } + }; + } },{ id: 'partition', type: 'group', label: gettext('Partitions'), mode: ['edit', 'create'], min_version: 100000, diff --git a/web/regression/javascript/schema_ui_files/table.ui.spec.js b/web/regression/javascript/schema_ui_files/table.ui.spec.js index dcb90e652..c686e8d86 100644 --- a/web/regression/javascript/schema_ui_files/table.ui.spec.js +++ b/web/regression/javascript/schema_ui_files/table.ui.spec.js @@ -171,6 +171,7 @@ describe('TableSchema', ()=>{ deferredPromise.then((depChange)=>{ expect(depChange()).toEqual({ columns: oftypeColumns, + primary_key: [], }); expect(schemaObj.changeColumnOptions).toHaveBeenCalledWith(oftypeColumns); done(); @@ -206,6 +207,7 @@ describe('TableSchema', ()=>{ deferredPromise.then((depChange)=>{ expect(depChange()).toEqual({ columns: oftypeColumns, + primary_key: [], }); expect(schemaObj.changeColumnOptions).toHaveBeenCalledWith(oftypeColumns); done();