[Nitro] Og evolution

George Moschovitis george.moschovitis at gmail.com
Tue Sep 13 06:47:49 EDT 2005


Hello all,

I added a simple form of schema evolution. This happens in 2 steps:

1. You export the original schema:

og.export

2. You import the schema and apply evolution rules if needed:

class NewArticle
  property :ntitle, String
  property :nbody, String
end

rules = {
  :Article => {
    :self => :NewArticle, # rename the class
    :title => :ntitle,
    :body => :nbody
  }
}

og.import :evolution => rules


The above example evolves Article into a new Class 'NewArticle'

Please note that Og evolution automatically takes care of new fields,
dropped fields, or importing into a different store. You only apply
rules if you rename stuff. At the moment if the evolved object
participates in relations you have to provide rules to remap the
relations too. But I think this can be improved.

Does anyone have any further suggestions? Perhaps a better idea?


regards,
George.




-- 
http://www.gmosx.com
http://www.navel.gr
http://www.nitrohq.com




More information about the Nitro-general mailing list