db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: Possible incorrect unique.vm in mysql
Date Thu, 13 Mar 2008 13:36:36 GMT
As far as I know, you CAN define and index name, but you need not. For
example, I have thested the following works with mysql 5.0

CREATE TABLE `test` (`test` VARCHAR( 10 ) NOT NULL , UNIQUE (test))

So in my eyes, the SQL generated by Torque is perfectly valid. Or did I
miss something ?

           Thomas

Peter Fr├╝hberger <Peter.Fruehberger@hte-company.de> schrieb am 13.03.2008
11:46:08:

> I am using version 3.3-RC3 of the torque maven plugin.
>
>
> The following snippet of code:
> <unique name="NAME_IDX">
> <unique-column name="NAME"/>
> </unique>
>
> generates the following mysql code:
>
> Create ...
>    ...
>     UNIQUE (NAME)
> );
>
> The unique index name (NAME_IDX) is missing, it should correctly be:
>
> Create ...
>    UNIQUE NAME_IDX (NAME);
> );
>
>
> changing the unique.vm in sql/base/mysql/unique.vm from
> #foreach ($unique in $table.Unices)
> UNIQUE($unique.ColumnList),
> #end
>
> to
> #foreach ($unique in $table.Unices)
> UNIQUE $unique.Name ($unique.ColumnList),
> #end
>
>
> fixes this problem for me.
>
> Thx
> Peter Fr├╝hberger
> (sorry for sending through an exchange server ;-))
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


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


Mime
View raw message