Skip to content

Commit f34191d

Browse files
committed
Use key accessors when checking competing foreign key definitions
Signed-off-by: minleejae <mmj9808@gmail.com>
1 parent dd8b5c3 commit f34191d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/main/java/net/sf/jsqlparser/statement/alter/AlterExpression.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,8 @@ private ForeignKeyConstraint getForeignKeyConstraint() {
390390
private ForeignKeyConstraint foreignKeyForUpdate(boolean create) {
391391
ForeignKeyConstraint foreignKey = getForeignKeyConstraint();
392392
if (foreignKey == null && create) {
393-
if (constraint != null || index != null || pkColumns != null || ukColumns != null) {
393+
if (constraint != null || index != null || getPkColumns() != null
394+
|| getUkColumns() != null) {
394395
throw new IllegalStateException(
395396
"Foreign-key setters cannot replace an existing definition; use setConstraint");
396397
}

0 commit comments

Comments
 (0)