Fixed #13711 -- Error raised when auto-generated field is too long for the database.

Fixed #13528 -- Corrected the auto-truncation of model names in case of multi-db.