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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_DISCOUNT_RATE') CREATE INDEX IDX_FA_DISCOUNT_RATE ON T_FA_DISCOUNT_RATE ( FORGID ,FCURRENCYID ,FEFFECTIVEDATE );


 EXEC P_ALTERPK 'PK_T_FA_DISCOUNT_RATE_ENTRY', 'T_FA_DISCOUNT_RATE_ENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_DISCOUNT_RATE_L', 'T_FA_DISCOUNT_RATE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_PAYMENT_ITEM', 'T_FA_PAYMENT_ITEM', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_PAYMENT_ITEM_L', 'T_FA_PAYMENT_ITEM_L', 'FPKID', '1';

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



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