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? Werner --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
