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:
parent
3bb87436f3
commit
f92efb10c7
|
@ -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 ");
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue