diff --git a/_Project-ID-ADempiere/sqls_3.1.3/006_fix_2pack_pk_name.sql b/_Project-ID-ADempiere/sqls_3.1.3/006_fix_2pack_pk_name.sql new file mode 100644 index 0000000000..b1bf6a714d --- /dev/null +++ b/_Project-ID-ADempiere/sqls_3.1.3/006_fix_2pack_pk_name.sql @@ -0,0 +1,58 @@ +--Delete field pk_name in window Pack Out Tab Pakage Details _> Reason: do not is nessesary becouse this field are in header + +DELETE FROM ad_field_trl + WHERE ad_field_id = 50094; + +DELETE FROM ad_field + WHERE ad_field_id = 50094; + +--SET ID Export Package AS Reference vs Pk_Name + +UPDATE ad_field + SET seqno = 30, + isdisplayed = 'Y' + WHERE ad_field_id = 50091; + +--Delete Pk_Name in the Table and History of Changes + +DELETE FROM ad_changelog + WHERE ad_column_id = 50126 AND ad_table_id = 50006; + +DELETE FROM ad_column_trl + WHERE ad_column_id = 50126; + +DELETE FROM ad_column + WHERE ad_column_id = 50126 AND ad_table_id = 50006; + +--Set PK_Name AS REference to Table Header + +UPDATE ad_column + SET isidentifier = 'Y', + seqno = 1 + WHERE ad_column_id = 50086; + +ALTER TABLE ad_package_exp_detail DROP COLUMN pk_name; + +ALTER TABLE ad_package_exp RENAME COLUMN pk_name TO name; + +UPDATE ad_column + SET ad_element_id = 469, + columnname = 'Name', + name = 'Name' + WHERE ad_column_id = 50086; + +ALTER TABLE ad_package_exp_common RENAME COLUMN pk_name TO NAME; + +UPDATE ad_column + SET ad_element_id = 469, + columnname = 'Name', + name = 'Name' + WHERE ad_column_id = 50146; + +DELETE FROM ad_element_trl + WHERE ad_element_id = 50021; + +DELETE FROM ad_element + WHERE ad_element_id = 50021; + +COMMIT ;