/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_ROLLCONFIG', 'T_EB_ROLLCONFIG', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_ROLLTEMPLATE', 'T_EB_ROLLTEMPLATE', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_ROLLINIT', 'T_EB_ROLLINIT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ROLLINIT_P1') CREATE INDEX IDX_EB_ROLLINIT_P1 ON T_EB_ROLLINIT ( FSRCAUDITTRIAL );


 EXEC P_ALTERPK 'PK_T_EB_ROLLCONFIG_L', 'T_EB_ROLLCONFIG_L', 'FPKID', '1';

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


EXEC p_DropIdx 'IDX_EB_CT_MODEL_NUMBER', 'T_EB_STRUCTOFCHANGETYPE';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CT_MODEL_NUMBER') CREATE INDEX IDX_EB_CT_MODEL_NUMBER ON T_EB_STRUCTOFCHANGETYPE ( FMODELID ,FNUMBER );

 EXEC P_ALTERPK 'PK_T_EB_INTEGRATION_LOG', 'T_EB_INTEGRATION_LOG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ING_LOG') CREATE INDEX IDX_EB_ING_LOG ON T_EB_INTEGRATION_LOG ( FINTEGRATIONID );


 EXEC P_ALTERPK 'PK_T_EB_INTEGRATION_LOGDET', 'T_EB_INTEGRATION_LOGDET', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_ING_LOGID') CREATE INDEX IDX_EB_ING_LOGID ON T_EB_INTEGRATION_LOGDET ( FLOGID );




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