/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SBD_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BD_MATERIALMFTINFO', 'T_BD_MATERIALMFTINFO', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_MTFINFO_MASTER') CREATE INDEX IDX_BD_MTFINFO_MASTER ON T_BD_MATERIALMFTINFO ( FMASTERID );


 EXEC P_ALTERPK 'PK_T_BD_MATERIALMFTINFO_L', 'T_BD_MATERIALMFTINFO_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_MATERIALMTFINFOGROUP_L', 'T_BD_MATERIALMTFINFOGROUP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PDM_MANUFACTURESTRATEGY', 'T_PDM_MANUFACTURESTRATEGY', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_PDM_MANUFACTURESTRATEGY_L', 'T_PDM_MANUFACTURESTRATEGY_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_MATERIALMFTINFO_M', 'T_BD_MATERIALMFTINFO_M', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BD_MTFM_MODIFYT_S') CREATE INDEX IDX_BD_MTFM_MODIFYT_S ON T_BD_MATERIALMFTINFO_M ( FSUPPLYORGUNITID );


 EXEC P_ALTERPK 'PK_T_BD_MATERIALMTFINFOGROUP', 'T_BD_MATERIALMTFINFOGROUP', 'FID', '1';

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



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