/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_MODELUPLOAD_L', 'T_EB_MODELUPLOAD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_MODELUPLOAD', 'T_EB_MODELUPLOAD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_MODELUPLOAD_P1') CREATE INDEX IDX_EB_MODELUPLOAD_P1 ON T_EB_MODELUPLOAD ( FSRCMODEL ,FTARMODEL );


 EXEC P_ALTERPK 'PK_T_EB_MODELUPLOAD_DIMMAP', 'T_EB_MODELUPLOAD_DIMMAP', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_APPROVALTYPE', 'T_EB_APPROVALTYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_APPROVALTYPE_L', 'T_EB_APPROVALTYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_DIM_MEMBERMAP', 'T_EB_DIM_MEMBERMAP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_DIMMAP_MODEL') CREATE INDEX IDX_EB_DIMMAP_MODEL ON T_EB_DIM_MEMBERMAP ( FSRCMODEL ,FTARMODEL );


 EXEC P_ALTERPK 'PK_T_EB_MODELUPLOAD_LOG', 'T_EB_MODELUPLOAD_LOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_MODELUPLOAD') CREATE INDEX IDX_EB_MODELUPLOAD ON T_EB_MODELUPLOAD_LOG ( FMODELUPLOAD );


 EXEC P_ALTERPK 'PK_T_EB_DIM_MEMBERMAPVAL', 'T_EB_DIM_MEMBERMAPVAL', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_RECEIVEPARAMETER', 'T_EB_RECEIVEPARAMETER', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_RECEIVEPARAMETER_TIME') CREATE INDEX IDX_EB_RECEIVEPARAMETER_TIME ON T_EB_RECEIVEPARAMETER ( FSTARTDATE ,FENDDATE );


 EXEC P_ALTERPK 'PK_T_EB_PROJECTIMPL', 'T_EB_PROJECTIMPL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_PROJECTIMPL_P1') CREATE INDEX IDX_EB_PROJECTIMPL_P1 ON T_EB_PROJECTIMPL ( FUSERID );


 EXEC P_ALTERPK 'PK_T_EB_RECEIVEPARAMETER_L', 'T_EB_RECEIVEPARAMETER_L', 'FPKID', '1';

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



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