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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_PLANPENTRY') CREATE INDEX IDX_POM_PLANPENTRY ON T_POM_PLANPENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_POM_PLANPROGRAM', 'T_POM_PLANPROGRAM', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_PLANPROGRAM') CREATE INDEX IDX_POM_PLANPROGRAM ON T_POM_PLANPROGRAM ( FNUMBER ,FCREATEORGID );


 EXEC P_ALTERPK 'PK_T_POM_PLANPROGRAM_L', 'T_POM_PLANPROGRAM_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_PLANPROGRAM_L') CREATE INDEX IDX_POM_PLANPROGRAM_L ON T_POM_PLANPROGRAM_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_POM_PLANPROORGENTRY', 'T_POM_PLANPROORGENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_PLANPROORGENTRY') CREATE INDEX IDX_POM_PLANPROORGENTRY ON T_POM_PLANPROORGENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_POM_PLANPROSCENTRY', 'T_POM_PLANPROSCENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_POM_PLANPROSCENTRY') CREATE INDEX IDX_POM_PLANPROSCENTRY ON T_POM_PLANPROSCENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_POM_ALLOCATIONPLAN', 'T_POM_ALLOCATIONPLAN', 'FID', '1';

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