Fixed false error is shown while adding a new foreign key from the table dialog when a foreign key already exists with Auto FK Index set to true. Fixes #5886

This commit is contained in:
Yogesh Mahajan authored and Akshay Joshi committed 2020-12-01 11:35:01 +05:30
1 parent abd0748a77
commit 783b7516a7
2 files changed
+8 -5

No files matched your search

@@ -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;