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

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


 EXEC P_ALTERPK 'PK_POM_RESTRUCTURBILL', 'T_POM_RESTRUCTURBILL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_POM_RETRESTRUCTSTOCKS', 'T_POM_RETRESTRUCTSTOCKS', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_POM_SCRAPRESTRUCTSTOCKS', 'T_POM_SCRAPRESTRUCTSTOCKS', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_POM_SRCRESTRUCTOPENTRY', 'T_POM_SRCRESTRUCTOPENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_POM_TORESTRUCTOPENTRY', 'T_POM_TORESTRUCTOPENTRY', 'FENTRYID', '1';

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



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