#set ( $basepath = "sql/base/$targetDatabase" ) #set ( $dbprops = $properties.load("$generator.TemplatePath/sql/base/$targetDatabase/db.props") ) #set ( $fname= "sql/base/$targetDatabase/table.vm" ) #set ( $fnamekeys= "sql/base/$targetDatabase/tablefk.vm" ) #set ( $idname = "sql/id-table/idtable.$targetDatabase" ) #foreach ($dataModel in $dataModels) #set ( $outFile = "${dataModel.name}.sql" ) File to be created: $outFile #set ( $database = $dataModel.database ) #foreach ($tbl in $database.tables) Primary Key:#if ($tbl.hasPrimaryKey()) Yes #else No #end #if (!$tbl.isSkipSql()) $generator.parse($fname,$outFile,"table",$tbl) #end #end #foreach ($tbl in $database.tables) #if (!$tbl.isSkipSql()) $generator.parse($fnamekeys,$outFile,"tablefk",$tbl) #end #end #if ($idmodel) Creating id-table #set ($tbl = $idmodel.database.getTable("ID_TABLE")) $generator.parse($fname,$outFile,"table",$tbl) ## Generate inserts into ID-TABLE for initial ids. #set ( $initialID = 1 ) $generator.parse($idname, $outFile, "tables", $database.tables) #end #end