mpoeschl    2002/07/04 08:29:17

  Modified:    src/templates/sql/base/mysql columns.vm
  Log:
  patch by James Turner <[EMAIL PROTECTED]>
  Assuming folks think (as I do) that native MySQL primary key columns should be 
autoincrementing, here's a patch that implements it.
  
  Revision  Changes    Path
  1.4       +5 -0      jakarta-turbine-torque/src/templates/sql/base/mysql/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-turbine-torque/src/templates/sql/base/mysql/columns.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- columns.vm        8 Nov 2001 04:31:30 -0000       1.3
  +++ columns.vm        4 Jul 2002 15:29:17 -0000       1.4
  @@ -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]>

Reply via email to