---------------------------------------------------- #foreach($table in $droptables) DROP TABLE $table.name; #end ---------------------------------------------------- #foreach($table in $tables) CREATE TABLE $table.name ( #set( $dec = '' ) #foreach($col in $table.columns) #notnull($nullString $col) #if($col.type == "TEXT" ) #set($size = '') #else #set($size = "$col.printSize()") #end #set( $dec = "$dec $col.name $col.type$size $nullString,$eol" ) #end #if( $table.primaryKey ) #printcols($cols $table.primaryKey.columns) #set( $dec = "$dec PRIMARY KEY ($cols ),$eol" ) #end #foreach($fk in $table.foreignKeys) #set($dec = "$dec CONSTRAINT ${table.name}_FK${velocityCount} FOREIGN KEY ($fk.localKey) REFERENCES $fk.foreignTable ($fk.foreignKey),$eol" ) #end #foreach($index in $table.indices) #if($index.unique) #printcols($cols $index.columns) #set( $dec = "$dec UNIQUE ($cols ),$eol" ) #end #end #set( $dec = $strings.chop($dec,1) ) $dec ); #end