2Pack is not creating foreign keys

Description

When 2Pack is creating new tables or new columns, it is not creating the foreign keys as they are created using synchronize column.

Environment

None

Activity

Show:
RedhuanO
January 14, 2016, 7:30 PM
Edited

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;
}

RedhuanO
January 16, 2016, 3:54 AM

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

Hiep Lq
February 13, 2016, 3:41 PM

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

Fixed

Assignee

Carlos Ruiz

Reporter

Carlos Ruiz

Labels

None

Tested By

None

Priority

Major
Configure