[ZODB-Dev] Support for graceful ZODB Class renaming

Pieter Nagel pieter@nagel.co.za
Sun, 19 Jan 2003 16:19:55 +0200


On Sun, Jan 19, 2003 at 02:30:24PM +0100, holger krekel wrote:

> interesting approach.  Do you also cope with exported data (say to
> xml) which gets reimported later when the scheme has already changed? 
>
> Do you have a history list of Migrators that would get applied? 

I assume you mean you backup your database to an export file periodically,
and you want to reimport the backup at a future date after the schema has
undergone N development iterations of change.

The answer is no. This far I only needed to handle the case where N=1, and
so I only keep one Migrator at hand.

It should be easily doable. You need to store a numerical schema version
in the database, keep the current schema version in the code, and keep a
list of all Migrators that you ever used in the code.

Then combine & run all the Migrators from V to current; where V is the
schema version stored inside the exported file.

-- 
     ,_
     /_)              /| /
    /   i e t e r    / |/ a g e l
    http://www.nagel.co.za