Assuming folks think (as I do) that native MySQL primary key columns should
be autoincrementing, here's a patch that implements it.
James
Index: columns.vm
===================================================================
RCS file:
/home/cvspublic/jakarta-turbine-torque/src/templates/sql/base/mysql/columns.vm,v
retrieving revision 1.3
diff -u -r1.3 columns.vm
--- columns.vm 8 Nov 2001 04:31:30 -0000 1.3
+++ columns.vm 4 Jul 2002 06:02:52 -0000
@@ -4,6 +4,11 @@
#set ( $default = $col.DefaultSetting )
#set ( $nullString = $strings.select($col.isNotNull(),
$dbprops.get("NOTNULL"),"") )
#set ( $autoIncrement = $strings.select($col.isAutoIncrement(),
$dbprops.get("AUTOINCREMENT"),"") )
+ #if ((($database.getDefaultIdMethod() == "native") && ($table.getIdMethod() ==
+"")) || ($table.getIdMethod() == "native"))
+ #if ($col.isPrimaryKey() && ($col.Type == "INTEGER"))
+ #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT"))
+ #end
+ #end
#set ( $entry = "$col.Name $type $size $default $nullString $autoIncrement," )
$strings.sub($strings.collapseSpaces($entry)," ,",",")
#end
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>