/**Begin D:\PDM_UPGRADE\PDM1\IFM_constraint.sql **/
EXEC p_DropIdx 'IDX_IFM_PRODUCT_ID', 'T_IFM_PRODUCT';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_PRODUCT_NUMBER') CREATE INDEX IDX_IFM_PRODUCT_NUMBER ON T_IFM_PRODUCT ( FNUMBER );

 EXEC p_AlterPK 'PK_T_IFM_PRODUCT_ENTRY', 'T_IFM_PRODUCT_ENTRY', 'FENTRYID', '1';
EXEC p_DropIdx 'IDX_IFM_PRODUCT_ENTRY_ID', 'T_IFM_PRODUCT_ENTRY';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_PRODUCT_ENTRY_ID') CREATE INDEX IDX_IFM_PRODUCT_ENTRY_ID ON T_IFM_PRODUCT_ENTRY ( FID );

 EXEC p_AlterPK 'PK_IFM_PRODUCT_ENTRY_L', 'T_IFM_PRODUCT_ENTRY_L', 'FPKID', '1';
EXEC p_DropIdx 'IDX_IFM_PRODUCT_ENTRY_L_ID', 'T_IFM_PRODUCT_ENTRY_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_PRODUCT_ENTRY_L_ID') CREATE INDEX IDX_IFM_PRODUCT_ENTRY_L_ID ON T_IFM_PRODUCT_ENTRY_L ( FENTRYID );

 EXEC p_AlterPK 'PK_T_IFM_PRODUCT_L', 'T_IFM_PRODUCT_L', 'FPKID', '1';
EXEC p_DropIdx 'IDX_IFM_PRODUCT_L_ID', 'T_IFM_PRODUCT_L';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_PRODUCT_L_ID') CREATE INDEX IDX_IFM_PRODUCT_L_ID ON T_IFM_PRODUCT_L ( FID );

 EXEC P_ALTERPK 'PK_T_IFM_DEDUCTION', 'T_IFM_DEDUCTION', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IFM_DEDUCTION_BILLNO') CREATE INDEX IDX_IFM_DEDUCTION_BILLNO ON T_IFM_DEDUCTION ( FBILLNO );


 EXEC P_ALTERPK 'PK_T_IFM_DEDUCTION_L', 'T_IFM_DEDUCTION_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_IFM_DEDUCTION_ENTRY', 'T_IFM_DEDUCTION_ENTRY', 'FENTRYID', '1';

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


 EXEC P_ALTERPK 'PK_T_IFM_DEDUCTION_ENTRY_L', 'T_IFM_DEDUCTION_ENTRY_L', 'FPKID', '1';

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



/**End D:\PDM_UPGRADE\PDM1\IFM_constraint.sql **/
