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

Attachments

2

Activity

Show:

Hiep Lq February 13, 2016 at 3:41 PM

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

RedhuanO January 16, 2016 at 3:54 AM

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

RedhuanO January 14, 2016 at 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;
}

Fixed

Details

Assignee

Reporter

Priority

Created July 29, 2015 at 4:22 PM
Updated April 6, 2016 at 3:36 PM
Resolved February 17, 2016 at 2:43 PM