Do not allow template names to be longer than the DB fields (see #6819)