Hi, Please find the attached patch which fixes the false error shown while adding a new foreign key from table dialogue in case of an already existing foreign key with Auto FK Index=True to table.
Thanks, Yogesh Mahajan EnterpriseDB
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js index 302728bad..a36d385ae 100644 --- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js +++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/constraints/foreign_key/static/js/foreign_key.js @@ -1097,11 +1097,13 @@ define('pgadmin.node.foreign_key', [ var coveringindex = this.get('coveringindex'), autoindex = this.get('autoindex'); - if (autoindex && (_.isUndefined(coveringindex) || _.isNull(coveringindex) || - String(coveringindex).replace(/^\s+|\s+$/g, '') == '')) { - msg = gettext('Please specify covering index name.'); - this.errorModel.set('coveringindex', msg); - return msg; + if (this.isNew()){ + if (autoindex && (_.isUndefined(coveringindex) || _.isNull(coveringindex) || + String(coveringindex).replace(/^\s+|\s+$/g, '') == '')) { + msg = gettext('Please specify covering index name.'); + this.errorModel.set('coveringindex', msg); + return msg; + } } return null;