/**Begin D:\work\svn\pdm\PDM_UPGRADE\PDM1\FA_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_FA_CARDSYNCENTRY', 'T_FA_CARDSYNCENTRY', 'FENTRYID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FACARDSYNC_CARD') CREATE INDEX IDX_FACARDSYNC_CARD ON T_FA_CARDSYNCENTRY ( FFINCARDID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FACARDSYNC_BOOK') CREATE INDEX IDX_FACARDSYNC_BOOK ON T_FA_CARDSYNCENTRY ( FORGID ,FDEPREUSEID ,FSYNCSTATUS );


 EXEC P_ALTERPK 'PK_T_FA_BOOKSYNCTASK', 'T_FA_BOOKSYNCTASK', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FABOOKTASK_BATCH') CREATE INDEX IDX_FABOOKTASK_BATCH ON T_FA_BOOKSYNCTASK ( FBATCHNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FABOOKTASK_ORG') CREATE INDEX IDX_FABOOKTASK_ORG ON T_FA_BOOKSYNCTASK ( FORGID ,FSYNCTYPE ,FSTATUS ,FDESTDEPREUSEID );


 EXEC P_ALTERPK 'PK_T_FA_BOOKSYNCTASKENTRY', 'T_FA_BOOKSYNCTASKENTRY', 'FENTRYID', '1';

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



/**End D:\work\svn\pdm\PDM_UPGRADE\PDM1\FA_constraint.sql **/
