/**Begin D:\PDM_UPGRADE\PDM1\BASE_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BD_APPLICATIONFIELD', 'T_BD_APPLICATIONFIELD', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_APPLICATIONFIELD_ID') CREATE INDEX IDX_BD_APPLICATIONFIELD_ID ON T_BD_APPLICATIONFIELD ( FID );


 EXEC P_ALTERPK 'PK_T_BD_INVOICETYPE', 'T_BD_INVOICETYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_INVOICETYPE_NUM') CREATE INDEX IDX_BD_INVOICETYPE_NUM ON T_BD_INVOICETYPE ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_BD_INVOICETYPE_L', 'T_BD_INVOICETYPE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_INVOICETYPE_L_ID') CREATE INDEX IDX_BD_INVOICETYPE_L_ID ON T_BD_INVOICETYPE_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_BD_INVOICETYPEGROUP', 'T_BD_INVOICETYPEGROUP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_INVOICETYPEGROUP_NUM') CREATE INDEX IDX_BD_INVOICETYPEGROUP_NUM ON T_BD_INVOICETYPEGROUP ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_BD_INVOICETYPEGROUP_L', 'T_BD_INVOICETYPEGROUP_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_INVOICETYPEGROUP_L_ID') CREATE INDEX IDX_BD_INVOICETYPEGROUP_L_ID ON T_BD_INVOICETYPEGROUP_L ( FID ,FLOCALEID );



/**End D:\PDM_UPGRADE\PDM1\BASE_constraint.sql **/
