/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SRC_constraint.sql **/
 EXEC P_ALTERPK 'PK_SRC_CONTRACTENTRY', 'T_SRC_CONTRACTENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRC_CONTRACTENTRY_PROID') CREATE INDEX IDX_SRC_CONTRACTENTRY_PROID ON T_SRC_CONTRACTENTRY ( FPROJECTID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRC_CONTRACTENTRY_EID') CREATE INDEX IDX_SRC_CONTRACTENTRY_EID ON T_SRC_CONTRACTENTRY ( FENTRYSTATUS );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRC_CONTRACTENTRY_PID') CREATE INDEX IDX_SRC_CONTRACTENTRY_PID ON T_SRC_CONTRACTENTRY ( FPURLISTID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRC_CONTRACTENTRY_SID') CREATE INDEX IDX_SRC_CONTRACTENTRY_SID ON T_SRC_CONTRACTENTRY ( FSUPPLIERID ,FSUPPLIERTYPE );

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


 EXEC P_ALTERPK 'PK_SRC_FEESURPLUS', 'T_SRC_FEESURPLUS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRC_FEESURPLUS_SID') CREATE INDEX IDX_SRC_FEESURPLUS_SID ON T_SRC_FEESURPLUS ( FSOURCEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRC_FEESURPLUS_SUP') CREATE INDEX IDX_SRC_FEESURPLUS_SUP ON T_SRC_FEESURPLUS ( FSUPPLIERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SRC_FEESURPLUS_BID') CREATE INDEX IDX_SRC_FEESURPLUS_BID ON T_SRC_FEESURPLUS ( FBILLID );



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