code: func RemoveTeamMember(cmd *m.RemoveTeamMemberCommand) error {
  	return inTransaction(func(sess *DBSession) error {
  		if _, err := teamExists(cmd.OrgId, cmd.TeamId, sess); err != nil {
  			return err
  		}
  
  		if cmd.ProtectLastAdmin {
  			_, err := isLastAdmin(sess, cmd.OrgId, cmd.TeamId, cmd.UserId)
  			if err != nil {
  				return err
  			}
  		}
  
  		var rawSql = "DELETE FROM team_member WHERE org_id=? and team_id=? and user_id=?"
  		res, err := sess.Exec(rawSql, cmd.OrgId, cmd.TeamId, cmd.UserId)
  		if err != nil {
  			return err
  		}
  		rows, err := res.RowsAffected()
  		if rows == 0 {
  			return m.ErrTeamMemberNotFound
  		}
  
  		return err
  	})
  }
docs: // RemoveTeamMember removes a member from a team