Fixed usage docs.
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Parser / XML / SQLFairy.pm
index 7a12136..67a9bfc 100644 (file)
@@ -1,7 +1,7 @@
 package SQL::Translator::Parser::XML::SQLFairy;
 
 # -------------------------------------------------------------------
-# $Id: SQLFairy.pm,v 1.12 2004-11-05 15:03:09 grommit Exp $
+# $Id: SQLFairy.pm,v 1.14 2005-06-28 16:39:41 mwz444 Exp $
 # -------------------------------------------------------------------
 # Copyright (C) 2003 Mark Addison <mark.addison@itn.co.uk>,
 #
@@ -100,7 +100,7 @@ To convert your old format files simply pass them through the translator :)
 use strict;
 
 use vars qw[ $DEBUG $VERSION @EXPORT_OK ];
-$VERSION = sprintf "%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.14 $ =~ /(\d+)\.(\d+)/;
 $DEBUG   = 0 unless defined $DEBUG;
 
 use Data::Dumper;
@@ -129,9 +129,9 @@ sub parse {
     );
     for my $tblnode (
         sort {
-            "".$xp->findvalue('sqlf:order|@order',$a)
+            ("".$xp->findvalue('sqlf:order|@order',$a) || 0)
             <=>
-            "".$xp->findvalue('sqlf:order|@order',$b)
+            ("".$xp->findvalue('sqlf:order|@order',$b) || 0)
         } @nodes
     ) {
         debug "Adding table:".$xp->findvalue('sqlf:name',$tblnode);
@@ -186,7 +186,7 @@ sub parse {
         foreach (@nodes) {
             my %data = get_tagfields($xp, $_, "sqlf:",
                 qw/name type table fields reference_fields reference_table
-                match_type on_delete_do on_update_do extra/
+                match_type on_delete on_update extra/
             );
             $table->add_constraint( %data ) or die $table->error;
         }