[Nitro] BUG: schema_inheritance - the neverending story...
bryan.a.soto at gmail.com
Mon Jan 30 01:35:36 EST 2006
The problem outlined by manveru is the same problem Aidan submitted a patch
( http://rubyforge.org/pipermail/nitro-general/2006-January/002424.html )
for and exists in glycerin currently.
Basically, the problem is in og/lib/og/store/sql.rb, search for "def
fields_for_class". During the check for schema inheritance, only the classes
descendants are iterated over, not the full inheritance chain. This causes
schema evolution to kick in with fields being dropped and added and data
potentially being lost as manveru outlined.
Aidan's patch is at available at
Mine is at
Unless we didn't stumble on the correct solution, perhaps one of these
should be applied to glycerin? If so, let me know which and I'll submit the
On 1/27/06, Michael Fellinger <m.fellinger at gmail.com> wrote:
> Hey Bryan,
> Thx a lot for the patch, will try it later...
> In every case we'll need the testcase for schema_inheritance, since it
> far too often in the past.
> You will hear from me how it works
> Am Friday 27 January 2006 15:46 schrieb Bryan Soto:
> > On 1/26/06, Michael Fellinger <m.fellinger at gmail.com> wrote:
> > > Hi list, hey george,
> > Hey manveru, how's Japan? :)
> > We've found a problem/bug with schema_inheritance while upgrading from
> > 0.25to
> > > 0.27.
> > > Now, i don't really have an idea what exactly is going different now,
> > > 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
> > > we
> > > found that evolve_schema first drops the useless fields of the Class
> > > will later be inherited - that looks like that:
> > I've attached a script to duplicate your problem. And a patch, which
> > to make it do what you want.
> > 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...
> > It would actually affect all of them as it's a bug in their super class.
> > Oh, I'm on my WIndows box, so you might need to run dos2unix on the
> > attached files. Hope I got it right. I've never used Single Table
> > Inheritance before.
> > Bryan
> Nitro-general mailing list
> Nitro-general at rubyforge.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Nitro-general