[Nitro] Og evolution

TRANS transfire at gmail.com
Tue Sep 13 12:26:52 EDT 2005


On 9/13/05, George Moschovitis <george.moschovitis at gmail.com> wrote:
> Hello all,
> 
> I added a simple form of schema evolution. This happens in 2 steps:
> 
> 1. You export the original schema:
> 
> og.export

What does this do exactly? Does it return anything useful?

> 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
>   }
> }

Actually, this reminds me of something I'm working on, but for
modules. I imagine it would work for classes too:

  class NewArticle < Article
    rename :ntitle, :title
    rename :nbody, :body
  end

> og.import :evolution => rules
>
> The above example evolves Article into a new Class 'NewArticle'


Is this removing the original Article class from memory altogehter, or
just from Og, or niether?

T.




More information about the Nitro-general mailing list