On Tue, Feb 12, 2008 at 11:53 AM, Paul Johnston <[EMAIL PROTECTED]> wrote: > > Hi, > > > >...and what happens if these methods are called and the tables already > >exist? > > > > > With metadata.create_all, it only creates ones that don't exist. > table.create() will error, or if you use the checkfirst option, will do > nothing. > > > >What if they exist but don't match the spec that SA has created? > > > > > SA doesn't know, so it continues until you hit a problem. > > We should really pull the code in tg-admin sql out into a standalone > script. I think having a model vs database diff function would help you > out a lot. that shouldn't be so hard. the sql command was originally a SQLObject thing which called sqlobject-admin, when TG did the switch someone duplicated the functionality and it's very independent of the core. in fact the code you are looking for is very trivial, honestly I have never used it but I believe the SA sql is far less develop than it's SO counterpart. Anyway here is the code, U can extract it with a couple of minutes of work.
http://trac.turbogears.org/browser/tags/1.0.4.2/turbogears/command/sacommand.py#L53 > > Paul > > > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---