/**Begin D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BCM_ADJUSTEXPORTPLAN', 'T_BCM_ADJUSTEXPORTPLAN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_ADJUSTEXPORTPLAN' AND KSQL_INDNAME = 'IDX_BCM_ADJUSTEXPORTPLAN') CREATE INDEX IDX_BCM_ADJUSTEXPORTPLAN ON T_BCM_ADJUSTEXPORTPLAN ( FMODELID ,FCREATORID ,FAPPLYSCOPE );


 EXEC P_ALTERPK 'PK_T_BCM_ADJUSTEXPORTPLAN_L', 'T_BCM_ADJUSTEXPORTPLAN_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_ADJUSTEXPORTPLAN_L' AND KSQL_INDNAME = 'IDX_BCM_ADJUSTEXPORTPLAN_L') CREATE INDEX IDX_BCM_ADJUSTEXPORTPLAN_L ON T_BCM_ADJUSTEXPORTPLAN_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_BCM_ADJEXPORTORGSCOPE', 'T_BCM_ADJEXPORTORGSCOPE', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_ADJEXPORTORGSCOPE' AND KSQL_INDNAME = 'IDX_BCM_ADJEXPORTORGSCOPE') CREATE INDEX IDX_BCM_ADJEXPORTORGSCOPE ON T_BCM_ADJEXPORTORGSCOPE ( FID );


 EXEC P_ALTERPK 'PK_T_BCM_ADJUSTUSERCONFIG', 'T_BCM_ADJUSTUSERCONFIG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_ADJUSTUSERCONFIG' AND KSQL_INDNAME = 'IDX_BCM_ADJUSTUSERCONFIG_USER') CREATE INDEX IDX_BCM_ADJUSTUSERCONFIG_USER ON T_BCM_ADJUSTUSERCONFIG ( FMODELID ,FUSERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BCM_ADJUSTUSERCONFIG' AND KSQL_INDNAME = 'IDX_BCM_ADJUSTUSERCONFIG_PLAN') CREATE INDEX IDX_BCM_ADJUSTUSERCONFIG_PLAN ON T_BCM_ADJUSTUSERCONFIG ( FEXPORTPLANID );



/**End D:\DBA\1.4\PDM_UPGRADE\PDM1\BCM_constraint.sql **/
