Dammit.  I created a lovely Textmate command and it turns out I should
have upgraded SQLObject.  I really never thought of that.

Thanks Jorge.

Ed

On 3/12/07, Jorge Godoy <[EMAIL PROTECTED]> wrote:
>
> "Ed Singleton" <[EMAIL PROTECTED]> writes:
>
> > It's generally a problem with constraints.  The correct way to do it
> > is to create all your tables, then alter the tables to add in the
> > constraints.  Quite often, if you have two tables that each refer to
> > the other, there is no order you can put them in that works, without
> > moving the constraints out.
>
> That's how SQL Object 0.8 does it.
>
> > I wrote a Textmate command to do this automatically for me.  It takes
> > the output of tg-admin sql sql and moves all constraints to the end.
>
> Upgrading your SQL Object shouldn't be all that hard.  There's only one
> "gotcha" on the upgrade:
>
>       results = model.Class.select()
>       if results:
>          # actions
>
> becomes:
>
>       results = model.Class.select()
>       if results.count():
>          # actions
>
> > It isn't very robust so the sql syntax will need to be precise, and
> > unfortunately tg-admin sql sql often returns broken sql for postgres.
>
> Not with recent versions of SQL Object.  Older versions did that, indeed.
>
> > There is quite often a missing semi-colon at the end of statements, so
> > you HAVE to sanity check your sql before running it through this.
>
> There's no problem with semicolons anymore.
>
>
> --
> Jorge Godoy      <[EMAIL PROTECTED]>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to