Fixed #18389 -- Fixed the way contribute_to_class is called

Now this method is only called only if the object is an instance.
This allows to have field classes as model class attributes.
Fixed #22424 -- MySQL doesn't accept migrations' one-off default values for longtext and longblob.
wip