/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\POM_constraint.sql **/
 EXEC P_ALTERPK 'PK_IM_POM_MROSWS', 'T_POM_MROSWS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_MROSWS_FORGID') CREATE INDEX IDX_POM_MROSWS_FORGID ON T_POM_MROSWS ( FORGID );

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


 EXEC P_ALTERPK 'PK_POM_PARTREPLACERECORD', 'T_POM_PARTREPLACERECORD', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_POM_PARTREPLECEENTRY', 'T_POM_PARTREPLECEENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_POM_PARTREPLECEENTRY_L', 'T_POM_PARTREPLECEENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_PARTREPLECEENTRY_L_0') CREATE INDEX IDX_POM_PARTREPLECEENTRY_L_0 ON T_POM_PARTREPLECEENTRY_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_POM_MROSWSENTRY', 'T_POM_MROSWSENTRY', 'FENTRYID', '1';

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



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