When creating new versions of a model one might change already defined classes in that model and add or remove attributes from that class definition.
Gemstone is able to handle different versions of classes and allows the programmer to migrate instances of old class versions to a specific new version of that class.
The job of migration can be very difficult and this is my first attempt in PUM is to at least do the initialize stuff (in the initialize method) also in the migration support method. The generated code looks for all current attributes (in den new model) defined and if they are new, they simply initialize them with the value from that model.
migrateFrom: oldValue instVarMap: unusedParameter | oldNames | oldNames := oldValue class allInstVarNames. (oldNames includes: #'studyMembership') ifFalse:[ studyMembership := StringKeyValueDictionary new ]. (oldNames includes: #'quotas') ifFalse:[ quotas := Set new ]. (oldNames includes: #'quotaFullAppointmentHandling') ifFalse:[ quotaFullAppointmentHandling := CATIEnumQuotaFullAppointmentHandling noHandling ]. ^self