X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator%2FParser%2FXML%2FSQLFairy.pm;h=78d7f15e6172515d7dbe84df4114fb5ba1d8528d;hb=4ab3763d2ad756c236b757306989cafa08e7f35e;hp=7a1213698690d42ec516ffd814ccd371ff6e4dbc;hpb=b178940934ec79968ed16511ec2644f3736c92f2;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator/Parser/XML/SQLFairy.pm b/lib/SQL/Translator/Parser/XML/SQLFairy.pm index 7a12136..78d7f15 100644 --- a/lib/SQL/Translator/Parser/XML/SQLFairy.pm +++ b/lib/SQL/Translator/Parser/XML/SQLFairy.pm @@ -1,8 +1,6 @@ package SQL::Translator::Parser::XML::SQLFairy; # ------------------------------------------------------------------- -# $Id: SQLFairy.pm,v 1.12 2004-11-05 15:03:09 grommit Exp $ -# ------------------------------------------------------------------- # Copyright (C) 2003 Mark Addison , # # This program is free software; you can redistribute it and/or @@ -100,7 +98,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 = '1.59'; $DEBUG = 0 unless defined $DEBUG; use Data::Dumper; @@ -129,9 +127,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 +184,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; } @@ -201,6 +199,16 @@ sub parse { $table->add_index( %data ) or die $table->error; } + + # + # Comments + # + @nodes = $xp->findnodes('sqlf:comments/sqlf:comment',$tblnode); + foreach (@nodes) { + my $data = $_->string_value; + $table->comments( $data ); + } + } # tables loop #