[elephant-devel] Good practices around adding/deleting class slots.
Ian Eslick
eslick at media.mit.edu
Fri Jan 9 03:21:59 UTC 2009
Hi Yarek,
There are no problems adding or deleting slots. The semantics are
basically the same as redefining slots for standard classes. You can
change the type of a slot (e.g. cached, index, etc) without any data
loss. If you change the name or drop a slot the data associated with
that is lost.
Currently I don't have a mechanism to handle the general case along
the lines of update-instance-for-redefined-class that will work with
objects on the persistent heap (not that there isn't a way to do this,
I just haven't done it yet).
For now, the fool-proof method is to only add slots, copy or modify
any data, then delete them. This is probably a good discipline anyway
if you're making schema changes against live databases.
I'll also be adding some default "are you sure you want to throw away
all your data?" messages into Elephant at appropriate places for 1.0.
This will help you be conscious about when you are likely to be
throwing data away.
Ian
On Jan 8, 2009, at 7:31 PM, Yarek Kowalik wrote:
> In an evolving site there is a fair chance of adding/changing/
> deleting slots from a class. What are good practices with respect
> to these actions in Elephant? Are there specific steps that need to
> be taken to migrate data from an old class definition to a new class
> definition? Any gotchas one needs to be aware of?
>
> BTW, I've read several emails about data migration going by, can
> someone please clarify what exactly "data migration" is? Is it
> migrating between stores, or different versions of a class?
>
> Yarek
> _______________________________________________
> elephant-devel site list
> elephant-devel at common-lisp.net
> http://common-lisp.net/mailman/listinfo/elephant-devel
More information about the elephant-devel
mailing list