/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BCM_constraint.sql **/
 EXEC p_AlterPK 'PK_T_BCM_ISGROUPMAP', 'T_BCM_ISGROUPMAP', 'fid', '1';
 EXEC P_ALTERPK 'PK_T_BCM_BASECVTFORMULA', 'T_BCM_BASECVTFORMULA', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_BASECVTF_MODEL') CREATE INDEX IDX_BCM_BASECVTF_MODEL ON T_BCM_BASECVTFORMULA ( FMODELID ,FSCENARIOID );


 EXEC P_ALTERPK 'PK_T_BCM_USERDEFCVTFORMULA', 'T_BCM_USERDEFCVTFORMULA', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_USERDEFCVTF_MODEL') CREATE INDEX IDX_BCM_USERDEFCVTF_MODEL ON T_BCM_USERDEFCVTFORMULA ( FMODELID ,FSCENARIOID ,FTEMPLATEID );


 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_ADJPROCESS_JBU') CREATE INDEX IDX_BCM_ADJPROCESS_JBU ON T_BCM_RPTADJUST ( FJOURNALTYPE ,FBUSSNESSTYPE ,FUPDATECYCLE );

 EXEC P_ALTERPK 'PK_T_BCM_UDCFROWCOLMEMB', 'T_BCM_UDCFROWCOLMEMB', 'FENTRYID', '1';

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



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