/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_FA_CARD_VERSION2', 'T_FA_CARD_VERSION2', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_CARD_VERSION2' AND KSQL_INDNAME = 'IDX_FA_CARD_VS2_AFTREALCARDID') CREATE INDEX IDX_FA_CARD_VS2_AFTREALCARDID ON T_FA_CARD_VERSION2 ( FAFTREALCARDID ,FCARDMASTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_CARD_VERSION2' AND KSQL_INDNAME = 'IDX_FA_CARD_VS2_SRCBILLID') CREATE INDEX IDX_FA_CARD_VS2_SRCBILLID ON T_FA_CARD_VERSION2 ( FSRCBILLID ,FSRCBILLENTITYNAME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_CARD_VERSION2' AND KSQL_INDNAME = 'IDX_FA_CARD_VS2_MASTERID') CREATE INDEX IDX_FA_CARD_VS2_MASTERID ON T_FA_CARD_VERSION2 ( FCARDMASTERID ,FVERSIONTIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_FUTURE_CHG_FIN_REL' AND KSQL_INDNAME = 'IDX_FA_FUTURE_FMASTERID') CREATE INDEX IDX_FA_FUTURE_FMASTERID ON T_FA_FUTURE_CHG_FIN_REL ( FMASTERID,FCHGDATEPERIODID);

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