/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_FA_DEPREDETAILENTRY', 'T_FA_DEPREDETAILENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_DEPREDETAILSUBENTRY', 'T_FA_DEPREDETAILSUBENTRY', 'FDETAILID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_DEPREDETAILSUBENTRY_FID') CREATE INDEX IDX_FA_DEPREDETAILSUBENTRY_FID ON T_FA_DEPREDETAILSUBENTRY ( FENTRYID );


 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_DEPRESPLITDETAIL') CREATE INDEX IDX_FA_DEPRESPLITDETAIL ON T_FA_DEPRESPLITDETAIL ( FORGID ,FDEPREUSEID ,FPERIODID );

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


 EXEC P_ALTERPK 'PK_T_FA_DEPRESPLITDETAIL_L', 'T_FA_DEPRESPLITDETAIL_L', 'FPKID', '1';

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



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