/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_constraint.sql **/
 EXEC P_ALTERPK 'PK_IM_CLOSEACCTRECORD', 'T_IM_CLOSEACCTRECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_CLOSRED_FOID') CREATE INDEX IDX_IM_CLOSRED_FOID ON T_IM_CLOSEACCTRECORD ( FORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_CLOSRED_FWID') CREATE INDEX IDX_IM_CLOSRED_FWID ON T_IM_CLOSEACCTRECORD ( FWAREHOUSEID );


 EXEC P_ALTERPK 'PK_IM_INVBALANCE', 'T_IM_INVBALANCE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_INVBC_FOID') CREATE INDEX IDX_IM_INVBC_FOID ON T_IM_INVBALANCE ( FORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_INVBC_FWID') CREATE INDEX IDX_IM_INVBC_FWID ON T_IM_INVBALANCE ( FWAREHOUSEID );


 EXEC P_ALTERPK 'PK_IM_INVSNAPSHOOT', 'T_IM_INVSNAPSHOOT', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_IVNSN_FFID') CREATE INDEX IDX_IM_IVNSN_FFID ON T_IM_INVSNAPSHOOT ( FFORMID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_IM_IVNSN_FBID') CREATE INDEX IDX_IM_IVNSN_FBID ON T_IM_INVSNAPSHOOT ( FBILLID );



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