diff --git a/org.adempiere.base.process/src/org/compiere/process/ColumnSync.java b/org.adempiere.base.process/src/org/compiere/process/ColumnSync.java index 3910590bef..5ba2df5619 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ColumnSync.java +++ b/org.adempiere.base.process/src/org/compiere/process/ColumnSync.java @@ -286,6 +286,8 @@ public class ColumnSync extends SvrProcess else if (fkConstraintType.equals(MColumn.FKCONSTRAINTTYPE_SetNull)) fkConstraint.append(" ON DELETE SET NULL"); + fkConstraint.append(" DEFERRABLE INITIALLY DEFERRED"); + fkConstraintSql.append(DB.SQLSTATEMENT_SEPARATOR); fkConstraintSql.append("ALTER TABLE ").append(table.getTableName()); fkConstraintSql.append(" ADD "); diff --git a/org.adempiere.base/src/org/compiere/process/CreateForeignKey.java b/org.adempiere.base/src/org/compiere/process/CreateForeignKey.java index c05966429b..16619b8cb1 100644 --- a/org.adempiere.base/src/org/compiere/process/CreateForeignKey.java +++ b/org.adempiere.base/src/org/compiere/process/CreateForeignKey.java @@ -444,6 +444,8 @@ public class CreateForeignKey extends SvrProcess { else if (fkConstraintType.equals(MColumn.FKCONSTRAINTTYPE_SetNull)) fkConstraint.append(" ON DELETE SET NULL"); + fkConstraint.append(" DEFERRABLE INITIALLY DEFERRED"); + column.setFKConstraintName(fkConstraintName); column.setFKConstraintType(fkConstraintType); column.saveEx();