/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_constraint.sql **/
EXEC p_DropIdx 'IDX_FA_INVENTSCHEME_FBILLNO', 'T_FA_INVENTSCHEME';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_INVENTSCHEME_FBILLNO') CREATE INDEX IDX_FA_INVENTSCHEME_FBILLNO ON T_FA_INVENTSCHEME ( FNUMBER );

 EXEC P_ALTERPK 'PK_FA_INVENTORY_RECORD', 'T_FA_INVENTORY_RECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_INVENTORY_RECORD') CREATE INDEX IDX_FA_INVENTORY_RECORD ON T_FA_INVENTORY_RECORD ( FINVENTSCHEMEENTRYID ,FINVENTORYTASKID );


 EXEC P_ALTERPK 'PK_FA_INVENTSCHEMEENTRY_L', 'T_FA_INVENTSCHEMEENTRY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_INVENTSCHEMEENTRY_L') CREATE INDEX IDX_FA_INVENTSCHEMEENTRY_L ON T_FA_INVENTSCHEMEENTRY_L ( FENTRYID ,FLOCALEID );


 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FA_CARREA_FUSEID') CREATE INDEX IDX_FA_CARREA_FUSEID ON T_FA_CARD_REAL ( FHEADUSEPERSONID );


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