2Pack is not creating foreign keys
Description
Environment
Attachments
relates to
Activity

Hiep Lq
redo for red1 case:
create a virtual column with name is [tableName]_ID

RedhuanO
I managed to replicate the error for virtual column. Tested patch attached.

RedhuanO
Creating constraint keys should not include virtual columns. If done manually in Window, Tab & Field the Synchronize Column also does not appear as its Display Logic is @IsView@='N' & @ColumnSQL@='' thus the column exists in AD_Column without existing in actual database table.
Therefore the following would have been necessary (see ColumnSQLException.patch attached):
+++ b/org.adempiere.pipo/src/org/adempiere/pipo2/PackInHandler.java
if (table.isView()) {
continue;
}
if (column.getColumnSQL()!=null) {
log.fine("*** FINE checking for VIRTUAL COLUMN - getColumnSQL:"+column.getColumnSQL());
if (!column.getColumnSQL().isEmpty())
continue;
}
When 2Pack is creating new tables or new columns, it is not creating the foreign keys as they are created using synchronize column.