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

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


 EXEC P_ALTERPK 'PK_T_FA_CHANGE_ITEM_L', 'T_FA_CHANGE_ITEM_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_CHANGETYPE', 'T_FA_CHANGETYPE', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_CHANGETYPE_ENTRY', 'T_FA_CHANGETYPE_ENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_CHANGETYPE_L', 'T_FA_CHANGETYPE_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_CHANGEBILLFINENTRY', 'T_FA_CHANGEBILLFINENTRY', 'FDETAILID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_CHANGEBILLREALENTRY', 'T_FA_CHANGEBILLREALENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_FA_CHANGEFIELDENTRY', 'T_FA_CHANGEFIELDENTRY', 'FENTRYID', '1';

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



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