/**Begin C:\PDM_UPGRADE\PDM1\SRM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_SRM_ACCESSNODE', 'T_SRM_ACCESSNODE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ACCESSNODE_BIZOBJECT') CREATE INDEX IDX_ACCESSNODE_BIZOBJECT ON T_SRM_ACCESSNODE ( FBIZOBJECT );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ACCESSNODE_NUMBER') CREATE INDEX IDX_ACCESSNODE_NUMBER ON T_SRM_ACCESSNODE ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_SRM_ACCESSNODE_L', 'T_SRM_ACCESSNODE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_SRM_ENTERTYPEENTRY', 'T_SRM_ENTERTYPEENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_ENTERTYPE_NODEID') CREATE INDEX IDX_ENTERTYPE_NODEID ON T_SRM_ENTERTYPEENTRY ( FACCESSNODEID );

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


 EXEC P_ALTERPK 'PK_T_SRM_APTITUDE_NODEENTRY', 'T_SRM_APTITUDE_NODEENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_APTITUDEENTRY_NODEID') CREATE INDEX IDX_APTITUDEENTRY_NODEID ON T_SRM_APTITUDE_NODEENTRY ( FACCESSNODEID );


 EXEC P_ALTERPK 'PK_T_SRM_APPROVEDETAIL', 'T_SRM_APPROVEDETAIL', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_APPROVEDETAIL_NODEID') CREATE INDEX IDX_APPROVEDETAIL_NODEID ON T_SRM_APPROVEDETAIL ( FACCESSNODEID );

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



/**End C:\PDM_UPGRADE\PDM1\SRM_constraint.sql **/
