1002848 IDEMPIERE-1132 Improve AD_Index; AD_View; foreign keys management. Always create foreign key with the DEFERRABLE INITIALLY DEFERRED clause.

This commit is contained in:
Heng Sin Low 2013-11-08 17:52:00 +08:00
parent 3bb87436f3
commit f92efb10c7
2 changed files with 4 additions and 0 deletions

View File

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

View File

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