On Wednesday 18 June 2008 17:21:00 Werner F. Bruhin wrote:
> Michael Bayer wrote:
> > On Jun 18, 2008, at 4:05 AM, Werner F. Bruhin wrote:
> >> All other tables (including the full version of preferences) are
> >> using "metadata = sa.MetaData()", instead of the "metadataMin" I
> >> use for the prefminimal definition.
> >>
> >> I got this working some month ago, but maybe this is not the
> >> right way to go about it and it bits me now?
> >
> > using two separate MetaData objects, if I correctly understand
> > that's what you're doing, is not going to work at all if that
> > Table has any ForeignKey objects (which it does).   I dont see
> > the use case for two distinct MDs.
>
> What I need to do at start up of the application is to check a
> couple of columns in table "preferences" to check what version the
> database is, then if it is an older version I do the upgrade of the
> database (metadata etc) and update the columns in the table.
>
> I can not read all the columns of the table as there might be
> columns defined for this new release which are not present until
> the upgrade is finished.
>
> Would something like this work for me
> "session.query(Preferences.col1, Preferences.col2)" and have
> columns defined in the model which are not yet present in the
> database?
>
> If the query approach does not work what alternatives would I have?
>

cant u drop the Min-version once u finished using it? thus having only 
one metadata to same engine at same time.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to