/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\EB_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_EB_CHKATTACHMENT', 'T_EB_CHKATTACHMENT', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_EB_CHKNOTEDETAIL', 'T_EB_CHKNOTEDETAIL', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CHKNOTEDETAIL_P1') CREATE INDEX IDX_EB_CHKNOTEDETAIL_P1 ON T_EB_CHKNOTEDETAIL ( FSEQ );


 EXEC P_ALTERPK 'PK_T_EB_CHKNOTEINFO', 'T_EB_CHKNOTEINFO', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_CHKNOTEINFO_P1') CREATE INDEX IDX_EB_CHKNOTEINFO_P1 ON T_EB_CHKNOTEINFO ( FMODEL );


 EXEC P_ALTERPK 'PK_T_EB_EXECUTECASE', 'T_EB_EXECUTECASE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_EXECUTECASE_P1') CREATE INDEX IDX_EB_EXECUTECASE_P1 ON T_EB_EXECUTECASE ( FMODELID ,FBUSINESSMODELID );


 EXEC P_ALTERPK 'PK_T_EB_EXECUTECASE_RULE', 'T_EB_EXECUTECASE_RULE', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_EXECUTECASE_RULE_P2') CREATE INDEX IDX_EB_EXECUTECASE_RULE_P2 ON T_EB_EXECUTECASE_RULE ( FSEQ );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_EXECUTECASE_RULE_P3') CREATE INDEX IDX_EB_EXECUTECASE_RULE_P3 ON T_EB_EXECUTECASE_RULE ( FBIZRULEID );


 EXEC P_ALTERPK 'PK_T_EB_EXECUTECASERECORD', 'T_EB_EXECUTECASERECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_EXECUTECASERECORD_P1') CREATE INDEX IDX_EB_EXECUTECASERECORD_P1 ON T_EB_EXECUTECASERECORD ( FCASENUMBER );

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_EXECUTECASERECORD_P3') CREATE INDEX IDX_EB_EXECUTECASERECORD_P3 ON T_EB_EXECUTECASERECORD ( FEXECUTESTATUS );



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