henning 2004/10/30 05:58:36 Modified: src/generator/src/templates/sql/base/postgresql Tag: TORQUE_3_1_BRANCH columns.vm table.vm xdocs Tag: TORQUE_3_1_BRANCH changes.xml Added: src/generator/src/templates/sql/base/postgresql Tag: TORQUE_3_1_BRANCH sequence.vm Log: Streamline the PostgreSQL SQL generation. Generate sequence definitions. Revision Changes Path No revision No revision 1.2.2.1 +2 -6 db-torque/src/generator/src/templates/sql/base/postgresql/columns.vm Index: columns.vm =================================================================== RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/postgresql/columns.vm,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -u -r1.2 -r1.2.2.1 --- columns.vm 7 Aug 2003 21:27:46 -0000 1.2 +++ columns.vm 30 Oct 2004 12:58:36 -0000 1.2.2.1 @@ -9,14 +9,10 @@ #else #set ( $size = "" ) #end - #if (($table.IdMethod == "native") && ($col.isPrimaryKey())) - #set ( $default = "DEFAULT nextval('$table.SequenceName')" ) - #else - #set ( $default = $col.DefaultSetting ) - #end + #set ( $default = $col.DefaultSetting ) #set ( $nullString = $strings.select($col.isNotNull(), $dbprops.get("NOTNULL"),"") ) #set ( $entry = "$col.Name $type $size $default $nullString" ) - #if ($col.isAutoIncrement() && $table.IdMethod == "native") + #if ($col.isAutoIncrement()) #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") ) #else #set ( $autoIncrement = " " ) 1.1.2.2 +3 -0 db-torque/src/generator/src/templates/sql/base/postgresql/table.vm Index: table.vm =================================================================== RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/postgresql/table.vm,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- table.vm 20 Aug 2004 11:47:18 -0000 1.1.2.1 +++ table.vm 30 Oct 2004 12:58:36 -0000 1.1.2.2 @@ -4,6 +4,9 @@ ----------------------------------------------------------------------------- $generator.parse("$basepath/drop.vm", "", "table", $tbl) +#set ( $sequence = $generator.parse("$basepath/sequence.vm", "", "table", $tbl) ) +#if ($sequence.length()>0)$sequence#end + CREATE TABLE $table.Name ( #set ( $cols = $generator.parse("$basepath/columns.vm", "", "table",$tbl) ) No revision Index: table.vm =================================================================== RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/postgresql/table.vm,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- table.vm 20 Aug 2004 11:47:18 -0000 1.1.2.1 +++ table.vm 30 Oct 2004 12:58:36 -0000 1.1.2.2 @@ -4,6 +4,9 @@ ----------------------------------------------------------------------------- $generator.parse("$basepath/drop.vm", "", "table", $tbl) +#set ( $sequence = $generator.parse("$basepath/sequence.vm", "", "table", $tbl) ) +#if ($sequence.length()>0)$sequence#end + CREATE TABLE $table.Name ( #set ( $cols = $generator.parse("$basepath/columns.vm", "", "table",$tbl) ) No revision Index: table.vm =================================================================== RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/postgresql/table.vm,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -r1.1.2.1 -r1.1.2.2 --- table.vm 20 Aug 2004 11:47:18 -0000 1.1.2.1 +++ table.vm 30 Oct 2004 12:58:36 -0000 1.1.2.2 @@ -4,6 +4,9 @@ ----------------------------------------------------------------------------- $generator.parse("$basepath/drop.vm", "", "table", $tbl) +#set ( $sequence = $generator.parse("$basepath/sequence.vm", "", "table", $tbl) ) +#if ($sequence.length()>0)$sequence#end + CREATE TABLE $table.Name ( #set ( $cols = $generator.parse("$basepath/columns.vm", "", "table",$tbl) ) 1.1.2.2 +1 -1 db-torque/src/generator/src/templates/sql/base/postgresql/Attic/sequence.vm No revision No revision 1.140.2.19 +5 -0 db-torque/xdocs/changes.xml Index: changes.xml =================================================================== RCS file: /home/cvs/db-torque/xdocs/changes.xml,v retrieving revision 1.140.2.18 retrieving revision 1.140.2.19 diff -u -r1.140.2.18 -r1.140.2.19 --- changes.xml 30 Oct 2004 12:10:32 -0000 1.140.2.18 +++ changes.xml 30 Oct 2004 12:58:36 -0000 1.140.2.19 @@ -32,6 +32,11 @@ By setting <code>torque.correctGetters</code> to true, this can be changed. This is a generator-only change, the resulting peers still run with the 3.1.1 runtime. </action> + <action type="update" dev="henning"> + SQL generation for PostgreSQL now generates ID columns without default values, inserting + the sequence values through the ID generator. The generated SQL now also contains sequence + definitions for the tables. + </action> </release> <release version="3.1.1" date="2004-10-26">
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]