/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FMM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_PDM_ROUTE', 'T_PDM_ROUTE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_PDM_ROUTE_L', 'T_PDM_ROUTE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_PDM_ROUTEACTIVE', 'T_PDM_ROUTEACTIVE', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PDM_ROUTEACTIVE') CREATE INDEX IDX_PDM_ROUTEACTIVE ON T_PDM_ROUTEACTIVE ( FENTRYID ,FSEQ );


 EXEC P_ALTERPK 'PK_T_PDM_ROUTEOPERATION', 'T_PDM_ROUTEOPERATION', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PDM_ROUTEOPERATION_E', 'T_PDM_ROUTEOPERATION_E', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PDM_ROUTEPROCESS', 'T_PDM_ROUTEPROCESS', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PDM_ROUTERELATION', 'T_PDM_ROUTERELATION', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_PDM_ROUTESOURCE', 'T_PDM_ROUTESOURCE', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PDM_ROUTESOURCE') CREATE INDEX IDX_PDM_ROUTESOURCE ON T_PDM_ROUTESOURCE ( FENTRYID ,FSEQ );


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