#foreach ($col in $table.Columns) #if ($col.TorqueType.indexOf("BOOLEAN") != -1) #set ( $type = $dbprops.get($col.TorqueType) ) #else #set ( $type = $dbprops.get($col.Type) ) #end #set ( $size = $col.printSize() ) #set ( $default = $col.DefaultSetting ) #set ( $nullString = $strings.select($col.isNotNull(), $dbprops.get("NOTNULL"),"") ) #set ( $entry = "$col.Name $type $size $default $nullString" ) #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") ) #set ( $entry = $strings.select($col.isAutoIncrement(), "$col.Name $autoIncrement", $entry) ) ## ## the following works if you want to inline your foreign keys ## if you turn it on, be sure to comment out foreignkey.vm #if (false) #if ($col.isForeignKey()) #set ($fk = $col.ForeignKey) #set ($entry = "$entry REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames)") #if ($fk.hasOnUpdate()) #set ($entry = "$entry ON UPDATE $fk.OnUpdate ") #end #if ($fk.hasOnDelete()) #set ($entry = "$entry ON DELETE $fk.OnDelete ") #end #end #end #set ( $entry = $strings.collapseSpaces("$entry,") ) $strings.sub($entry," ,",",") ## add a nice comment #if ($col.isForeignKey()) #set ($fk = $col.ForeignKey) -- REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames) #end #end