/**Begin D:\PDM\PDM_UPGRADE\pdm1\BCM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BCM_BATCHEXPORTDETAIL', 'T_BCM_BATCHEXPORTDETAIL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_BEDETAIL_MODEL') CREATE INDEX IDX_BCM_BEDETAIL_MODEL ON T_BCM_BATCHEXPORTDETAIL ( FMODELID );


 EXEC P_ALTERPK 'PK_T_BCM_BATCHEXPORTDETAIL_L', 'T_BCM_BATCHEXPORTDETAIL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_BATCHEXPORTORG', 'T_BCM_BATCHEXPORTORG', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BCM_BATCHEXPORTRPT', 'T_BCM_BATCHEXPORTRPT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_BMC_BATCHEXPORTPLAN', 'T_BMC_BATCHEXPORTPLAN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BATCHEXPORTPLAN_USER_MODEL') CREATE INDEX IDX_BATCHEXPORTPLAN_USER_MODEL ON T_BMC_BATCHEXPORTPLAN ( FUSERID ,FMODELID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BATCHEXPORTPLAN_PLAN') CREATE INDEX IDX_BATCHEXPORTPLAN_PLAN ON T_BMC_BATCHEXPORTPLAN ( FPLANID );


 EXEC P_ALTERPK 'PK_T_BMC_BATCHEXPORTPLAN_L', 'T_BMC_BATCHEXPORTPLAN_L', 'FPKID', '1';

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


 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BCM_EXPORTFILERULE_PLAN') CREATE INDEX IDX_BCM_EXPORTFILERULE_PLAN ON T_BCM_EXPORTFILENAMERULE ( FPLANID );


/**End D:\PDM\PDM_UPGRADE\pdm1\BCM_constraint.sql **/
