db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r410651 - in /db/torque: site/trunk/xdocs/changes.xml templates/trunk/src/templates/sql/base/interbase/foreignkey.vm templates/trunk/src/templates/sql/base/interbase/tablefk.vm
Date Wed, 31 May 2006 20:01:09 GMT
Author: tfischer
Date: Wed May 31 13:01:08 2006
New Revision: 410651

URL: http://svn.apache.org/viewvc?rev=410651&view=rev
Log:
Fixed foreignkey constraint generation for firebird (took the foreignkey templates from oracle)
Fixes TORQUE-6
Thanks to Joerg Friedrich for the patch.

Modified:
    db/torque/site/trunk/xdocs/changes.xml
    db/torque/templates/trunk/src/templates/sql/base/interbase/foreignkey.vm
    db/torque/templates/trunk/src/templates/sql/base/interbase/tablefk.vm

Modified: db/torque/site/trunk/xdocs/changes.xml
URL: http://svn.apache.org/viewvc/db/torque/site/trunk/xdocs/changes.xml?rev=410651&r1=410650&r2=410651&view=diff
==============================================================================
--- db/torque/site/trunk/xdocs/changes.xml (original)
+++ db/torque/site/trunk/xdocs/changes.xml Wed May 31 13:01:08 2006
@@ -29,6 +29,9 @@
 
   <release version="3.2.1-dev" date="in SVN">
   
+    <action type="fix" dev="tfischer" issue="TORQUE-6" due-to="Joerg Friedrich">
+      Fixed foreign key constraint generation for Firebird.
+    </action>
     <action type="add" dev="tfischer" issue="TORQUE-18" due-to="Greg Monroe">
       Added createdb-template for MS-SQL.
     </action>

Modified: db/torque/templates/trunk/src/templates/sql/base/interbase/foreignkey.vm
URL: http://svn.apache.org/viewvc/db/torque/templates/trunk/src/templates/sql/base/interbase/foreignkey.vm?rev=410651&r1=410650&r2=410651&view=diff
==============================================================================
--- db/torque/templates/trunk/src/templates/sql/base/interbase/foreignkey.vm (original)
+++ db/torque/templates/trunk/src/templates/sql/base/interbase/foreignkey.vm Wed May 31 13:01:08
2006
@@ -12,5 +12,15 @@
 ## See the License for the specific language governing permissions and
 ## limitations under the License.
 #foreach ($fk in $table.ForeignKeys)
-    FOREIGN KEY ($fk.LocalColumnNames) REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames),
+ALTER TABLE $table.Name
+    ADD CONSTRAINT $fk.Name FOREIGN KEY ($fk.LocalColumnNames)
+    REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames)
+#if ($fk.hasOnUpdate() && !$fk.OnUpdate.equalsIgnoreCase("cascade"))
+ON UPDATE $fk.OnUpdate
+#end
+#if ($fk.hasOnDelete())
+ON DELETE $fk.OnDelete
+#end
+;
+
 #end

Modified: db/torque/templates/trunk/src/templates/sql/base/interbase/tablefk.vm
URL: http://svn.apache.org/viewvc/db/torque/templates/trunk/src/templates/sql/base/interbase/tablefk.vm?rev=410651&r1=410650&r2=410651&view=diff
==============================================================================
--- db/torque/templates/trunk/src/templates/sql/base/interbase/tablefk.vm (original)
+++ db/torque/templates/trunk/src/templates/sql/base/interbase/tablefk.vm Wed May 31 13:01:08
2006
@@ -11,3 +11,5 @@
 ## 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.
+#set ( $fk = $generator.parse("$basepath/foreignkey.vm", "", "table", $tbl) )
+#if ($fk.length()>0)$fk#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