db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1436761 - in /db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql: outlets/ templates/ddl/ templates/ddl/derby/ templates/ddl/hsqldb/ templates/ddl/mssql/ templates/ddl/mysql/ templates/ddl/oracle/ t...
Date Tue, 22 Jan 2013 06:33:09 GMT
Author: tfischer
Date: Tue Jan 22 06:33:08 2013
New Revision: 1436761

URL: http://svn.apache.org/viewvc?rev=1436761&view=rev
Log:
TORQUE-256: Drop schema missing for create schema

TORQUE-255: onDelete="setnull" not working

Added:
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/dropDatabaseSchema.vm
Modified:
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/foreignKey.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/foreignKey.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/foreignKey.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/foreignKey.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/foreignKey.vm
    db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/foreignKey.vm

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml?rev=1436761&r1=1436760&r2=1436761&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/outlets/ddl.xml
Tue Jan 22 06:33:08 2013
@@ -38,6 +38,9 @@
       <action xsi:type="traverseAllAction" 
           element="all-tables/table" 
           outlet="torque.sql.ddl.dropTableSkipDecider"/>
+      <action xsi:type="traverseAllAction" 
+          element="databaseSchema" 
+          outlet="torque.sql.ddl.dropDatabaseSchema"/>
     </mergepoint>
     <mergepoint name="createSchema">
       <action xsi:type="traverseAllAction" 
@@ -126,6 +129,11 @@
       path="ddl/createDatabaseSchema.vm">
   </outlet>
 
+  <outlet name="torque.sql.ddl.dropDatabaseSchema"
+      xsi:type="velocityOutlet"
+      path="ddl/dropDatabaseSchema.vm">
+  </outlet>
+
   <outlet name="torque.sql.ddl.table"
       xsi:type="velocityOutlet"
       path="ddl/${option:database}/table.vm">

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/foreignKey.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/foreignKey.vm?rev=1436761&r1=1436760&r2=1436761&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/foreignKey.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/derby/foreignKey.vm
Tue Jan 22 06:33:08 2013
@@ -18,12 +18,18 @@ ALTER TABLE $torqueGen.getParent().getAt
     ADD CONSTRAINT $name 
     FOREIGN KEY ($localColumnNames)
     REFERENCES $foreignTable ($foreignColumnNames)##
-#if ($onUpdate)
+#if ($onUpdate == "setnull")
 
-    ON UPDATE $onUpdate##
+    ON UPDATE SET NULL##
+#elseif ($onUpdate)
+
+    ON UPDATE ${onUpdate.toUpperCase()}##
 #end
-#if ($onDelete)
+#if ($onDelete == "setnull")
+
+    ON DELETE SET NULL##
+#elseif ($onDelete)
 
-    ON DELETE $onDelete##
+    ON DELETE ${onDelete.toUpperCase()}##
 #end
 ;

Added: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/dropDatabaseSchema.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/dropDatabaseSchema.vm?rev=1436761&view=auto
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/dropDatabaseSchema.vm
(added)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/dropDatabaseSchema.vm
Tue Jan 22 06:33:08 2013
@@ -0,0 +1,19 @@
+## Licensed to the Apache Software Foundation (ASF) under one
+## or more contributor license agreements.  See the NOTICE file
+## distributed with this work for additional information
+## regarding copyright ownership.  The ASF licenses this file
+## to you under the Apache License, Version 2.0 (the
+## "License"); you may not use this file except in compliance
+## with the License.  You may obtain a copy of the License at
+##
+##   http://www.apache.org/licenses/LICENSE-2.0
+##
+## Unless required by applicable law or agreed to in writing,
+## software distributed under the License is distributed on an
+## "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+## KIND, either express or implied.  See the License for the
+## specific language governing permissions and limitations
+## under the License.
+##
+
+DROP SCHEMA ${name};

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/foreignKey.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/foreignKey.vm?rev=1436761&r1=1436760&r2=1436761&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/foreignKey.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/hsqldb/foreignKey.vm
Tue Jan 22 06:33:08 2013
@@ -18,12 +18,18 @@ ALTER TABLE $torqueGen.getParent().getAt
     ADD CONSTRAINT $name 
     FOREIGN KEY ($localColumnNames)
     REFERENCES $foreignTable ($foreignColumnNames)##
-#if ($onUpdate)
+#if ($onUpdate == "setnull")
 
-    ON UPDATE $onUpdate##
+    ON UPDATE SET NULL##
+#elseif ($onUpdate)
+
+    ON UPDATE ${onUpdate.toUpperCase()}##
 #end
-#if ($onDelete)
+#if ($onDelete == "setnull")
+
+    ON DELETE SET NULL##
+#elseif ($onDelete)
 
-    ON DELETE $onDelete##
+    ON DELETE ${onDelete.toUpperCase()}##
 #end
 ;

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/foreignKey.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/foreignKey.vm?rev=1436761&r1=1436760&r2=1436761&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/foreignKey.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mssql/foreignKey.vm
Tue Jan 22 06:33:08 2013
@@ -20,13 +20,19 @@ ALTER TABLE $tableName
     ADD CONSTRAINT $name
     FOREIGN KEY ($localColumnNames)
     REFERENCES $foreignTable ($foreignColumnNames)##
-#if ($onUpdate)
+#if ($onUpdate == "setnull")
 
-    ON UPDATE $onUpdate
+    ON UPDATE SET NULL##
+#elseif ($onUpdate)
+
+    ON UPDATE ${onUpdate.toUpperCase()}##
 #end
-#if ($onDelete)
+#if ($onDelete == "setnull")
+
+    ON DELETE SET NULL##
+#elseif ($onDelete)
 
-    ON DELETE $onDelete
+    ON DELETE ${onDelete.toUpperCase()}##
 #end
 END
 ;

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/foreignKey.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/foreignKey.vm?rev=1436761&r1=1436760&r2=1436761&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/foreignKey.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/mysql/foreignKey.vm
Tue Jan 22 06:33:08 2013
@@ -18,13 +18,19 @@ ALTER TABLE $torqueGen.getParent().getAt
     ADD CONSTRAINT $name
     FOREIGN KEY ($localColumnNames)
     REFERENCES $foreignTable ($foreignColumnNames)##
-#if ($onUpdate)
+#if ($onUpdate == "setnull")
 
-    ON UPDATE $onUpdate##
+    ON UPDATE SET NULL##
+#elseif ($onUpdate)
+
+    ON UPDATE ${onUpdate.toUpperCase()}##
 #end
-#if ($onDelete)
+#if ($onDelete == "setnull")
+
+    ON DELETE SET NULL##
+#elseif ($onDelete)
 
-    ON DELETE $onDelete##
+    ON DELETE ${onDelete.toUpperCase()}##
 #end
 ;
 

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/foreignKey.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/foreignKey.vm?rev=1436761&r1=1436760&r2=1436761&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/foreignKey.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/oracle/foreignKey.vm
Tue Jan 22 06:33:08 2013
@@ -18,15 +18,18 @@ ALTER TABLE $torqueGen.getParent().getAt
     ADD CONSTRAINT $name
     FOREIGN KEY ($localColumnNames)
     REFERENCES $foreignTable ($foreignColumnNames)##
-#if ($onUpdate && !$onUpdate.equalsIgnoreCase("cascade"))
+#if ($onUpdate == "setnull")
 
-    ON UPDATE $onUpdate##
+    ON UPDATE SET NULL##
+#elseif ($onUpdate)
+
+    ON UPDATE ${onUpdate.toUpperCase()}##
 #end
-#if ($onDelete)
-  #if ( $onDelete.equalsIgnoreCase("setnull") )
-    #set( $onDelete = "SET NULL" )
-  #end
+#if ($onDelete == "setnull")
+
+    ON DELETE SET NULL##
+#elseif ($onDelete)
 
-    ON DELETE $onDelete##
+    ON DELETE ${onDelete.toUpperCase()}##
 #end
 ;

Modified: db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/foreignKey.vm
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/foreignKey.vm?rev=1436761&r1=1436760&r2=1436761&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/foreignKey.vm
(original)
+++ db/torque/torque4/trunk/torque-templates/src/main/resources/org/apache/torque/templates/sql/templates/ddl/postgresql/foreignKey.vm
Tue Jan 22 06:33:08 2013
@@ -18,12 +18,18 @@ ALTER TABLE $torqueGen.getParent().getAt
     ADD CONSTRAINT $name
     FOREIGN KEY ($localColumnNames)
     REFERENCES $foreignTable ($foreignColumnNames)##
-#if ($onUpdate)
+#if ($onUpdate == "setnull")
 
-    ON UPDATE $onUpdate##
+    ON UPDATE SET NULL##
+#elseif ($onUpdate)
+
+    ON UPDATE ${onUpdate.toUpperCase()}##
 #end
-#if ($onDelete)
+#if ($onDelete == "setnull")
+
+    ON DELETE SET NULL##
+#elseif ($onDelete)
 
-    ON DELETE $onDelete##
+    ON DELETE ${onDelete.toUpperCase()}##
 #end
 ;



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message