/**Begin D:\PDM_UPGRADE\PDM1\TSRBD_constraint.sql **/
EXEC P_ALTERPK 'PK_TSRBD_REWARDRULE', 'T_TSRBD_REWARDRULE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_TSRBD_RDETAIL_ORGID') CREATE INDEX IDX_TSRBD_RDETAIL_ORGID ON T_TSRBD_REWARDRULE ( FCREATEORGID );


EXEC P_ALTERPK 'PK_TSRBD_REWARDONBOARD', 'T_TSRBD_REWARDONBOARD', 'FENTRYID', '1';

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


EXEC P_ALTERPK 'PK_TSRBD_REWARDPROCESS', 'T_TSRBD_REWARDPROCESS', 'FENTRYID', '1';

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


EXEC P_ALTERPK 'PK_TSRBD_REWARDRESULT', 'T_TSRBD_REWARDRESULT', 'FENTRYID', '1';

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


EXEC P_ALTERPK 'PK_TSRBD_REWARDRULE_L', 'T_TSRBD_REWARDRULE_L', 'FPKID', '1';

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



/**End D:\PDM_UPGRADE\PDM1\TSRBD_constraint.sql **/
