Commits

Yury Shulaev committed 6759cb1

don't add identical relations

  • Participants
  • Parent commits bfa092c

Comments (0)

Files changed (1)

js/wwwsqldesigner.js

 }
 
 SQL.Designer.prototype.addRelation = function(row1, row2) {
+	for (var i = 0; i < this.relations.length; i++) {
+		if (this.relations[i].row1 == row1 && this.relations[i].row2 == row2) {
+			return this.relations[i];
+		}
+	}
+
 	var r = new SQL.Relation(this, row1, row2);
 	this.relations.push(r);
 	return r;