/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\POM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_POM_MGSRCENTRY', 'T_POM_MGSRCENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_ODENTRYID') CREATE INDEX IDX_POM_ODENTRYID ON T_POM_MGSRCENTRY ( FORDERENTRYID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_ODSE_PRODUCTID') CREATE INDEX IDX_POM_ODSE_PRODUCTID ON T_POM_MGSRCENTRY ( FPRODUCTID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_ODSE_ORDERID') CREATE INDEX IDX_POM_ODSE_ORDERID ON T_POM_MGSRCENTRY ( FORDERID );


 EXEC P_ALTERPK 'PK_T_POM_MGSRCENTRY_E', 'T_POM_MGSRCENTRY_E', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_POM_MGTARENTRY', 'T_POM_MGTARENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_ODST_PRODUCT') CREATE INDEX IDX_POM_ODST_PRODUCT ON T_POM_MGTARENTRY ( FPRODUCTMERGEID );


 EXEC P_ALTERPK 'PK_T_POM_MGTARENTRY_E', 'T_POM_MGTARENTRY_E', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_POM_ORDERMERGE', 'T_POM_ORDERMERGE', 'FID', '1';

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



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