Best practices for upgrading schemas?

Martin Aspeli optilude at gmx.net
Tue Oct 16 01:20:51 UTC 2007


Jon Baldivieso wrote:
> I'm thinking about upgrading PressRoom's Press Contact content type; I 
> want to add a new field to its schema.  What's the preferred time to 
> make sure migrate old instances of that content type to the new schema? 
>  Do I hook into Extensions.Install's install() method?  (I'm assuming 
> that contentmigrations has the code for walking the catalog and touching 
> each instance of these objects, but I'm not sure the best point at which 
> to make that option available.)

Are you sure you need a migration at all? If you need a migration, using 
  Install.py's reinstall==True mode may help, but if you're on 3.0.2 you 
can also use the upgrade-step support in GenericSetup (chapter 19 of my 
book covers this; I'm not sure where else it may be documented, apart 
from the GS tests).

Martin

-- 
Author of `Professional Plone Development`, a book for developers who
want to work with Plone. See http://martinaspeli.net/plone-book





More information about the Product-Developers mailing list