Deprecate parent composite primary keys - leave management via table index

Description

Hi,

Actually, when we want to define a composite primary key, we have to check the 'Parent link column' checkbox and then synchronize.
But we can't define the order of the column.

Eg: C_InvoiceTax has a PK which consists of C_TAX_ID and C_INVOICE_ID. If i want to change the order, i have

A new "AD_CompositePKSeqNo" field should be added to handle that ? Or maybe that can be done using the new AD_TableIndex table ?

WDYT ?

Regards,

Nicolas

Environment

None

Activity

Carlos Ruiz 
September 5, 2014 at 9:18 PM

Added IsKey to table index to define that index being created is a primary key.

Carlos Ruiz 
August 3, 2014 at 10:48 AM

Table index is creating unique key and postgresql REQUIRES a primary key to work.

Translation tables are not working with error:
org.postgresql.util.PSQLException: No primary key found for table C_CountryGroup_Trl.

Discovered at workshop Burg 2014.

Nicolas Micoud 
May 12, 2014 at 7:06 AM

Hi Carlos,

I agree, your solution makes sense.

+1 for me !

Regards,

Nicolas

Carlos Ruiz 
May 7, 2014 at 11:22 PM

Hi ,

I think the creation of the composite primary key is not consistent in the app.

  • if you use packin to create a new table with composite key - then the primary key is not created

  • if you create a table with a few columns not parent and push synchronize - the primary key is not created

  • if you push the synchronize column with all the parent columns created - the primary key is created

  • if you push the synchronize column with some of the parent columns created - the primary key is created wrongly and it can't be fixed later in the app

In other words - composite primary key is being created on MTable.getSQLCreate, and that's just called if the table does not exist and is useful just if all the parent columns are already defined - otherwise it can create a problem.

So, my vote would be to drop that code that creates composite primary keys and move the management of those keys exclusively to table index.

WDYT?

Regards,

Carlos Ruiz

Fixed

Details

Assignee

Reporter

Priority

Created April 14, 2014 at 9:07 PM
Updated December 9, 2014 at 7:55 PM
Resolved September 5, 2014 at 9:18 PM