On Apr 14, 4:42 pm, barryhunter <
BarryBHun...@googlemail.com> wrote:
> Seems to me this would be highly specific to your application, and it
Data migration isn't specific to any application, it's specific to
evolving your application logic and changing your data accordingly.
> would relativly easy to write some loops to migrate.
You can't "loop" on appengine as far as I know because you have a
query limit of 1000 rows and a runtime limit for a method of some
200ms.
> However the effectivly freeform datastore, means that many large scale
> migrations not really needed.
I don't believe that, and it is in fact refutable easely. ZODB is a
freeform data store in that it stores objects and their members. You
_do_ perform data migration tasks on data stored on ZODB when you
write code that wouldn't be compatible with the old data.
> 1) You just add it to your model definition, when loading a model that
> doesnt have that value set it will be set the default - the
> application doesnt know (or care) it was not set in the original, next
> time (if) it writtem it will saved.
Which works for a limited use case where that value can have a
constant default, which is not always desirable.
> 2) just remove it from your model definition, loading 'old' data will
> just ignore it, when you save it will be rewitten without
That does take care of members that need no further processing (for
instance if the removal is instead a move to somewhere else).
> 3) create a loop that does that.
As far as I know, impossible on appengine.
> Or write code so its not needed.
That is a bad option. It is bad because it forces you to write
application code that has to care about the past from the beginning of
time, makes your code unrefactorable and buries your essential
application in reams of conditional coding that takes care of the
changes up to the present.
The alternative of refactoring your code and getting rid of the
baggage, and then writing a run once migrate job to take care of the
conversion is much more maintainable.