/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\POM_constraint.sql **/

 EXEC P_ALTERPK 'PK_POM_MROELECCONTROL', 'T_POM_MROELECCONTROL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MROELECCONTROL_FBILLNO') CREATE INDEX IDX_MROELECCONTROL_FBILLNO ON T_POM_MROELECCONTROL ( FBILLNO );


 EXEC P_ALTERPK 'PK_POM_MROELECENTRY', 'T_POM_MROELECENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_POM_MROELECSUBENTRY', 'T_POM_MROELECSUBENTRY', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_MROELECSUBENTRY_FK') CREATE INDEX IDX_POM_MROELECSUBENTRY_FK ON T_POM_MROELECSUBENTRY ( FENTRYID );


 EXEC P_ALTERPK 'PK_POM_MROCODERULE_NOS', 'T_POM_MROCODERULE_NOS', 'FNUMBER', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_RULENOS_PJ') CREATE INDEX IDX_POM_RULENOS_PJ ON T_POM_MROCODERULE_NOS ( FPROJECTKEYS );


 EXEC P_ALTERPK 'PK_POM_MROCODERULE_SEQ', 'T_POM_MROCODERULE_SEQ', 'FPROJECTKEYS', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_CODERULE_SEQ') CREATE INDEX IDX_POM_CODERULE_SEQ ON T_POM_MROCODERULE_SEQ ( FCURRENTSEQ );


 EXEC P_ALTERPK 'PK_POM_TRANSTYPECODERULE', 'T_POM_TRANSTYPECODERULE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_TYPERULE_TYPEID') CREATE INDEX IDX_POM_TYPERULE_TYPEID ON T_POM_TRANSTYPECODERULE ( FMROTRANSTYPEID );



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