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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_ORGUSEPERIOD_MASTER') CREATE UNIQUE INDEX IDX_FA_ORGUSEPERIOD_MASTER ON T_FA_CARD_VERSION ( FORGID ,FDEPREUSEID ,FMASTERID,FBIZPERIODID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_ORGUSE_MASTER') CREATE INDEX IDX_FA_ORGUSE_MASTER ON T_FA_CARD_VERSION ( FMASTERID ,FORGID );

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_VERSION_FREALCARDID') CREATE INDEX IDX_FA_VERSION_FREALCARDID ON T_FA_CARD_VERSION ( FREALCARDID );


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