add min_length to Field and refactor db_type()