You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Daniel Rall <dl...@finemaltcoding.com> on 2001/12/13 02:12:54 UTC
Re: [PATCH] .../conf/torque/templates/sql/base/mysql/primarykey.vm,v
Hi Travis. I committed a version of this which uses a method I
backported from the stand alone repo.
Travis Low <tr...@dawnstar.org> writes:
> This patch prevents an empty primary key statment from being generated when a table has no primary key (such as a
> mapping table).
>
> Index: primarykey.vm
> ===================================================================
> RCS file: /home/cvspublic/jakarta-turbine/conf/torque/templates/sql/base/mysql/primarykey.vm,v
> retrieving revision 1.3
> diff -u -r1.3 primarykey.vm
> --- primarykey.vm 2001/03/20 01:37:06 1.3
> +++ primarykey.vm 2001/04/19 20:34:22
> @@ -1,3 +1,5 @@
> +#set ($pk = $table.printPrimaryKey() )#if ($pk.length() > 0)
> PRIMARY KEY($table.printPrimaryKey()),
> +#end
> #set ($pk = $table.getPrimaryKey())#if ($pk.size() > 1)#foreach ($index in
> $table.getAdditionalIndicesForPrimaryKey()) INDEX($index),
> #end#end
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>