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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_INVOPERATORMAT' AND KSQL_INDNAME = 'IDX_IM_INVOPERMAT_FOPERATOR') CREATE INDEX IDX_IM_INVOPERMAT_FOPERATOR ON T_IM_INVOPERATORMAT ( FOPERATORID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_INVOPERATORMAT' AND KSQL_INDNAME = 'IDX_IM_INVOPERMAT_FOPGROUP') CREATE INDEX IDX_IM_INVOPERMAT_FOPGROUP ON T_IM_INVOPERATORMAT ( FOPERATORGROUPID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_INVOPERATORMAT' AND KSQL_INDNAME = 'IDX_IM_INVOPERMAT_FDEPT') CREATE INDEX IDX_IM_INVOPERMAT_FDEPT ON T_IM_INVOPERATORMAT ( FDEPTID );


 EXEC P_ALTERPK 'PK_T_IM_INVOPERATORMAT_L', 'T_IM_INVOPERATORMAT_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_IM_INVOPERATORMAT_L' AND KSQL_INDNAME = 'IDX_IM_INVOPERAMAT_L_FLOCAL') CREATE INDEX IDX_IM_INVOPERAMAT_L_FLOCAL ON T_IM_INVOPERATORMAT_L ( FID ,FLOCALEID );



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