Each Record should have a primary key - M_ProductPrice

Description

Each Record should have a primary key: Primary keys are needed to audit changes in the database. That is needed for pricing.

We dont think that we need primary keys for Storage (too much overhead) and not for translations. There are some more tables to think about.

Environment

None

Activity

Show:
Chuck Boecking
October 6, 2015, 12:52 PM

Hi Carlos,

Thank you for the feedback. I updated the migration scripts to remove the ad_treenode references. I updated the SQL to reflect your advice. Will you please test the "Primary Key Steps V2.sql" on an oracle machine to make sure the syntax does not throw an error?

After you give the thumbs up on the oracle syntax, I will copy "Primary Key Steps V2.sql" into each of the migrations files, and perform on last round of testing on a new system to ensure the patch and scripts work as expected.

Thanks,
Chuck

Carlos Ruiz
October 7, 2015, 1:00 PM

Hi , the oracle syntax is slightly different for alter table.

I think easiest way is to generate migration script this way:

  • add the M_ProductPrice_ID as an ID reference

  • ***

  • then change the column to be the primary key

in the migration script you add the update nextidfunc in the middle (***)

then you create the unique index for the previous pkey columns - defining it in the dictionary

Chuck Boecking
October 8, 2015, 9:37 PM

Carlos,

  1. I have updated the migrations scripts per your feedback.

  2. I checked the oracle syntax for the two commands I added to the Oracle migration script (NOT TESTED)

  3. I added the unique constraint through the dictionary per advice

  4. I tested on postgresql per the above text matrix. All Passed

Will you please execute the oracle script against an Oracle instance? Once Oracle is tested, this ticket is ready for release.

Chuck

Carlos Ruiz
October 16, 2015, 3:20 PM

Thanks , I committed the fixes for this ticket and my peer review.

Closing this ticket for M_ProductPrice - if there are more tables that you want to work please open specific ticket for each.

Murilo Habermann Torquato
January 12, 2016, 9:35 PM

Hi Carlos,

I found a small mistake on this Issue. The M_ProductPrice_ID is always being passed as 0 to the X_ class constructor:

It should be:

Assignee

Chuck Boecking

Reporter

Diego Ruiz

Labels

Tested By

None

Priority

Minor
Configure