/**Begin D:\PDM_UPGRADE\PDM_NEW\BOS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_ORG_CHANGERECORD', 'T_ORG_CHANGERECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_ORG_CHANGERECORD') CREATE INDEX IDX_T_ORG_CHANGERECORD ON T_ORG_CHANGERECORD ( FNUMBER ,FCHANGETYPE ,FEXECUTIONSTATUS ,FEXECUTIONDATE );


 EXEC P_ALTERPK 'PK_T_ORG_CHANGERECORD_L', 'T_ORG_CHANGERECORD_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_ORG_CHANGEENTRY', 'T_ORG_CHANGEENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_ORG_CHANGEENTRY') CREATE INDEX IDX_T_ORG_CHANGEENTRY ON T_ORG_CHANGEENTRY ( FID ,FORGID ,FVIEWID ,FBIZID );


 EXEC P_ALTERPK 'PK_T_ORG_CHANGECHECKENTRY', 'T_ORG_CHANGECHECKENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_ORG_CHANGECHECKDETAIL', 'T_ORG_CHANGECHECKDETAIL', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_ORG_CHANGECHECKDETAIL') CREATE INDEX IDX_T_ORG_CHANGECHECKDETAIL ON T_ORG_CHANGECHECKDETAIL ( FENTRYID ,FENTITYID ,FBDNUMBER );



/**End D:\PDM_UPGRADE\PDM_NEW\BOS_constraint.sql **/
