/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_OPEN_APIBODYENTRY', 'T_OPEN_APIBODYENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_OPEN_APIBODY_PENTRYID') CREATE INDEX IDX_T_OPEN_APIBODY_PENTRYID ON T_OPEN_APIBODYENTRY ( FPARENTENTRYID );


 EXEC P_ALTERPK 'PK_T_OPEN_APIHEADERENTRY', 'T_OPEN_APIHEADERENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_OPEN_APIQUERYPARAMENTRY', 'T_OPEN_APIQUERYPARAMENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_OPEN_APIRESPENTRY', 'T_OPEN_APIRESPENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_OPEN_APIRESP_PENTRYID') CREATE INDEX IDX_T_OPEN_APIRESP_PENTRYID ON T_OPEN_APIRESPENTRY ( FPARENTENTRYID );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_constraint.sql **/
