fix single table inheritance bug caused by using 'type' as column name