# vim: set ft=perl:
# -------------------------------------------------------------------
-# $Id: sqlt-diff,v 1.9 2005-07-07 21:30:42 mwz444 Exp $
+# $Id: sqlt-diff,v 1.10 2005-07-15 23:36:13 duality72 Exp $
# -------------------------------------------------------------------
# Copyright (C) 2002-4 The SQLFairy Authors
#
use SQL::Translator::Schema::Constants;
use vars qw( $VERSION );
-$VERSION = sprintf "%d.%02d", q$Revision: 1.9 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.10 $ =~ /(\d+)\.(\d+)/;
my ( @input, $list, $help, $debug );
for my $arg ( @ARGV ) {
my $f1_nullable = $t1_field->is_nullable;
my $f1_default = $t1_field->default_value;
my $f1_auto_inc = $t1_field->is_auto_increment;
- my $t2_field = $t2->get_field( $f1_name );
+ my $t2_field = $t2->get_field( $f1_name, $case_insensitive );
my $f1_full_name = "$s1_name.$t1_name.$t1_name";
warn "FIELD '$f1_full_name'\n" if $debug;
package SQL::Translator::Schema::Table;
# ----------------------------------------------------------------------
-# $Id: Table.pm,v 1.33 2005-06-29 22:02:29 duality72 Exp $
+# $Id: Table.pm,v 1.34 2005-07-15 23:36:13 duality72 Exp $
# ----------------------------------------------------------------------
# Copyright (C) 2002-4 SQLFairy Authors
#
use vars qw( $VERSION $FIELD_ORDER );
-$VERSION = sprintf "%d.%02d", q$Revision: 1.33 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.34 $ =~ /(\d+)\.(\d+)/;
# Stringify to our name, being careful not to pass any args through so we don't
my $self = shift;
my $field_name = shift or return $self->error('No field name');
+ my $case_insensitive = shift;
+ if ( $case_insensitive ) {
+ $field_name = uc($field_name);
+ foreach my $field ( keys %{$self->{fields}} ) {
+ return $self->{fields}{$field_name} if $field_name eq uc($field);
+ }
+ return $self->error(qq[Field "$field_name" does not exist]);
+ }
return $self->error( qq[Field "$field_name" does not exist] ) unless
exists $self->{'fields'}{ $field_name };
return $self->{'fields'}{ $field_name };