db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thoralf Rickert" <thoralf.rick...@cadooz.de>
Subject AW: SQL generated schema
Date Mon, 14 Nov 2005 10:09:48 GMT

> Some template sets for databases do not allow forward 
> declarations on foreign key. So you have to make sure that 
> the referenced table is before the referencing table in the schema.xml

Ah, maybe it's not part of this thread but I remember that I had this
cross reference problem with Torque 3.1 & MySQL (1-2 years ago). At that
time I thought about a general way to avoid this problem. The only
solution that I found, was to change the templates. I knew that it's
possible to create first a simple table with the SQL CREATE statement
and  after creating all tables the template creates ALTER TABLE
statements to change the foreign keys settings...

I made this changes to my Torque 3.1 templates and was able to to create
tables with torque that have cross reference (now my schema isn't sorted
by references but alphabetical by the table name ;-). I don't know, if
it's possible to make this changes to all other database types that
torque supports but maybe for some.

I would send my changes somebody (or to the developer list) if it isn't
already made in the torque 3.2 version (which I didn't tested yet).


To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

View raw message