Hi,

Since I am currently using mysql with innodb tables for my project and I have foreign keys with 'on update' and 'on delete' constraints. I have modified the templates/sql/base/mysql/foreignkey.vm file from:

-----------
#foreach ($fk in $table.ForeignKeys)
FOREIGN KEY ($fk.LocalColumnNames) REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames),
#end
-----------


to:

-----------
#foreach ($fk in $table.ForeignKeys)
FOREIGN KEY ($fk.LocalColumnNames) REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames)
#if ($fk.hasOnUpdate())
ON UPDATE $fk.OnUpdate
#end
#if ($fk.hasOnDelete())
ON DELETE $fk.OnDelete
#end
,
#end
-----------


This should be compatible with both innodb and myisam tables and with 4.0.x and 3.23.5x versions of mysql (the unsupported options are simply ignored by the db).
In my (few, for the time being) tests it works. Can anyone please tell me if there is some kind of problem in his/her opinion I am overlooking (this is the first time I use torque, hope the question is not too stupid)?
Thanks a lot
Luigi




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to