[Nitro] schema_inheritance - the neverending story...

Michael Fellinger m.fellinger at gmail.com
Fri Jan 27 00:01:36 EST 2006

Hi list, hey george,

We've found a problem/bug with schema_inheritance while upgrading from 0.25 to 
Now, i don't really have an idea what exactly is going different now, but the 
main-problem seems to be that evolve_schema seems to cause problems.
After a bit of playing around and trying to find out what is going wrong, we 
found that evolve_schema first drops the useless fields of the Class that 
will later be inherited - that looks like that:

class Foo
  property :bar

class Bar < Foo
  property :foo

class FooBar < Foo
  property :foobar

Og.setup(evolve_schema => true)

produces a table that first looks like


now the inheritance kicks in and it becomes


but... the problem is that when you store data in there like:

|oid|foo|bar |foobar|ogtype|
|0  |1  |NULL|NULL  |foo   |
|1  |1  |1   |NULL  |bar   |
|2  |1  |NULL|1     |foobar|

it will be rebuilt on a restart, looking like that, at first:

|0  |1  |foo   |
|1  |1  |bar   |
|2  |1  |foobar|

and after inheritance kicks in - evolves to:

|oid|foo|bar |foobar|ogtype|
|0  |1  |NULL|NULL  |foo   |
|1  |1  |NULL|NULL  |bar   |
|2  |1  |NULL|NULL  |foobar|

so, we loose all our data of these two object-specific fields, wich is _very_ 
bad, and i'm glad i found that bug before we upgraded our main tree...

However, i have no idea how to solve it... maybe some og-guru can help me out 

The store i'm using is psql - not yet tested with anything else because this 
is where our data is stored - so if psql doesn't work we hit a wall...

Thx in prev,

More information about the Nitro-general mailing list