package SQL::Translator::Schema::Constraint;
# ----------------------------------------------------------------------
-# $Id: Constraint.pm,v 1.17 2005-06-28 22:55:19 duality72 Exp $
+# $Id: Constraint.pm,v 1.18 2005-06-29 22:02:17 duality72 Exp $
# ----------------------------------------------------------------------
# Copyright (C) 2002-4 SQLFairy Authors
#
use vars qw($VERSION $TABLE_COUNT $VIEW_COUNT);
-$VERSION = sprintf "%d.%02d", q$Revision: 1.17 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.18 $ =~ /(\d+)\.(\d+)/;
my %VALID_CONSTRAINT_TYPE = (
PRIMARY_KEY, 1,
=cut
my $self = shift;
- return wantarray ? @{ $self->{'fields'} || [] } : $self->{'fields'};
+ return wantarray ? @{ $self->{'fields'} || [] } : ($self->{'fields'} || '');
}
# ----------------------------------------------------------------------
return 0 unless $self->SUPER::equals($other);
return 0 unless $case_insensitive ? uc($self->name) eq uc($other->name) : $self->name eq $other->name;
return 0 unless $self->deferrable eq $other->deferrable;
- return 0 unless $self->is_valid eq $other->is_valid;
+ #return 0 unless $self->is_valid eq $other->is_valid;
return 0 unless $case_insensitive ? uc($self->table->name) eq uc($other->table->name)
: $self->table->name eq $other->table->name;
return 0 unless $self->expression eq $other->expression;
return 0 unless $self->_compare_objects(scalar $self->field_names, scalar $other->field_names);
return 0 unless $self->reference_table eq $other->reference_table;
- return 0 unless $self->_compare_objects($self->reference_fields, $other->reference_fields);
+ return 0 unless $self->_compare_objects(scalar $self->reference_fields, scalar $other->reference_fields);
return 0 unless $self->match_type eq $other->match_type;
return 0 unless $self->on_delete eq $other->on_delete;
return 0 unless $self->on_update eq $other->on_update;
- return 0 unless $self->_compare_objects($self->options, $other->options);
- return 0 unless $self->_compare_objects($self->extra, $other->extra);
+ return 0 unless $self->_compare_objects(scalar $self->options, scalar $other->options);
+ return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra);
return 1;
}
package SQL::Translator::Schema::Field;
# ----------------------------------------------------------------------
-# $Id: Field.pm,v 1.23 2005-06-27 21:59:19 duality72 Exp $
+# $Id: Field.pm,v 1.24 2005-06-29 22:02:18 duality72 Exp $
# ----------------------------------------------------------------------
# Copyright (C) 2002-4 SQLFairy Authors
#
use vars qw($VERSION $TABLE_COUNT $VIEW_COUNT);
-$VERSION = sprintf "%d.%02d", q$Revision: 1.23 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.24 $ =~ /(\d+)\.(\d+)/;
# Stringify to our name, being careful not to pass any args through so we don't
# accidentally set it to undef. We also have to tweak bool so the object is
return 0 unless $self->SUPER::equals($other);
return 0 unless $case_insensitive ? uc($self->name) eq uc($other->name) : $self->name eq $other->name;
- return 0 unless $self->is_valid eq $other->is_valid;
+ #return 0 unless $self->is_valid eq $other->is_valid;
return 0 unless $self->data_type eq $other->data_type;
return 0 unless $self->size eq $other->size;
return 0 unless defined $self->default_value eq defined $other->default_value;
return 0 unless $self->is_foreign_key eq $other->is_foreign_key;
return 0 unless $self->is_auto_increment eq $other->is_auto_increment;
# return 0 unless $self->comments eq $other->comments;
- return 0 unless $self->_compare_objects($self->extra, $other->extra);
+ return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra);
return 1;
}
package SQL::Translator::Schema::Index;
# ----------------------------------------------------------------------
-# $Id: Index.pm,v 1.12 2005-06-28 22:56:22 duality72 Exp $
+# $Id: Index.pm,v 1.13 2005-06-29 22:02:29 duality72 Exp $
# ----------------------------------------------------------------------
# Copyright (C) 2002-4 SQLFairy Authors
#
use vars qw($VERSION $TABLE_COUNT $VIEW_COUNT);
-$VERSION = sprintf "%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.13 $ =~ /(\d+)\.(\d+)/;
my %VALID_INDEX_TYPE = (
UNIQUE, 1,
return 0 unless $self->is_valid eq $other->is_valid;
return 0 unless $self->type eq $other->type;
return 0 unless $self->_compare_objects(scalar $self->fields, scalar $other->fields);
- return 0 unless $self->_compare_objects($self->options, $other->options);
- return 0 unless $self->_compare_objects($self->extra, $other->extra);
+ return 0 unless $self->_compare_objects(scalar $self->options, scalar $other->options);
+ return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra);
return 1;
}
package SQL::Translator::Schema::Procedure;
# ----------------------------------------------------------------------
-# $Id: Procedure.pm,v 1.5 2005-06-27 21:59:20 duality72 Exp $
+# $Id: Procedure.pm,v 1.6 2005-06-29 22:02:29 duality72 Exp $
# ----------------------------------------------------------------------
# Copyright (C) 2002-4 SQLFairy Authors
#
use vars qw($VERSION);
-$VERSION = sprintf "%d.%02d", q$Revision: 1.5 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/;
# ----------------------------------------------------------------------
$self->{'parameters'} = \@unique;
}
- return wantarray ? @{ $self->{'parameters'} || [] } : $self->{'parameters'};
+ return wantarray ? @{ $self->{'parameters'} || [] } : ($self->{'parameters'} || '');
}
# ----------------------------------------------------------------------
return 0 unless $self->SUPER::equals($other);
return 0 unless $self->name eq $other->name;
return 0 unless $self->sql eq $other->sql;
- return 0 unless $self->_compare_objects($self->parameters, $other->parameters);
+ return 0 unless $self->_compare_objects(scalar $self->parameters, scalar $other->parameters);
# return 0 unless $self->comments eq $other->comments;
return 0 unless $self->owner eq $other->owner;
- return 0 unless $self->_compare_objects($self->extra, $other->extra);
+ return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra);
return 1;
}
package SQL::Translator::Schema::Table;
# ----------------------------------------------------------------------
-# $Id: Table.pm,v 1.32 2005-06-28 22:58:06 duality72 Exp $
+# $Id: Table.pm,v 1.33 2005-06-29 22:02:29 duality72 Exp $
# ----------------------------------------------------------------------
# Copyright (C) 2002-4 SQLFairy Authors
#
use vars qw( $VERSION $FIELD_ORDER );
-$VERSION = sprintf "%d.%02d", q$Revision: 1.32 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.33 $ =~ /(\d+)\.(\d+)/;
# Stringify to our name, being careful not to pass any args through so we don't
push @{ $self->{'options'} }, @$options;
if ( ref $self->{'options'} ) {
- return wantarray ? @{ $self->{'options'} || [] } : $self->{'options'};
+ return wantarray ? @{ $self->{'options'} || [] } : ($self->{'options'} || '');
}
else {
return wantarray ? () : [];
return 0 unless $self->SUPER::equals($other);
return 0 unless $self->name eq $other->name;
- return 0 unless $self->_compare_objects($self->options, $other->options);
- return 0 unless $self->_compare_objects($self->extra, $other->extra);
+ return 0 unless $self->_compare_objects(scalar $self->options, scalar $other->options);
+ return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra);
# Fields
# Go through our fields
package SQL::Translator::Schema::Trigger;
# ----------------------------------------------------------------------
-# $Id: Trigger.pm,v 1.6 2005-06-27 21:59:20 duality72 Exp $
+# $Id: Trigger.pm,v 1.7 2005-06-29 22:02:29 duality72 Exp $
# ----------------------------------------------------------------------
# Copyright (C) 2002-4 SQLFairy Authors
#
use vars qw($VERSION $TABLE_COUNT $VIEW_COUNT);
-$VERSION = sprintf "%d.%02d", q$Revision: 1.6 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.7 $ =~ /(\d+)\.(\d+)/;
# ----------------------------------------------------------------------
return 0 unless $self->SUPER::equals($other);
return 0 unless $self->name eq $other->name;
- return 0 unless $self->is_valid eq $other->is_valid;
+ #return 0 unless $self->is_valid eq $other->is_valid;
return 0 unless $self->perform_action_when eq $other->perform_action_when;
return 0 unless $self->database_event eq $other->database_event;
return 0 unless $self->on_table eq $other->on_table;
return 0 unless $self->action eq $other->action;
- return 0 unless $self->_compare_objects($self->extra, $other->extra);
+ return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra);
return 1;
}
package SQL::Translator::Schema::View;
# ----------------------------------------------------------------------
-# $Id: View.pm,v 1.10 2005-06-27 21:59:20 duality72 Exp $
+# $Id: View.pm,v 1.11 2005-06-29 22:02:29 duality72 Exp $
# ----------------------------------------------------------------------
# Copyright (C) 2002-4 SQLFairy Authors
#
use vars qw($VERSION $TABLE_COUNT $VIEW_COUNT);
-$VERSION = sprintf "%d.%02d", q$Revision: 1.10 $ =~ /(\d+)\.(\d+)/;
+$VERSION = sprintf "%d.%02d", q$Revision: 1.11 $ =~ /(\d+)\.(\d+)/;
# ----------------------------------------------------------------------
$self->{'fields'} = \@unique;
}
- return wantarray ? @{ $self->{'fields'} || [] } : $self->{'fields'};
+ return wantarray ? @{ $self->{'fields'} || [] } : ($self->{'fields'} || '');
}
# ----------------------------------------------------------------------
return 0 unless $self->SUPER::equals($other);
return 0 unless $self->name eq $other->name;
- return 0 unless $self->is_valid eq $other->is_valid;
+ #return 0 unless $self->is_valid eq $other->is_valid;
return 0 unless $self->sql eq $other->sql;
- return 0 unless $self->_compare_objects($self->fields, $other->fields);
- return 0 unless $self->_compare_objects($self->extra, $other->extra);
+ return 0 unless $self->_compare_objects(scalar $self->fields, scalar $other->fields);
+ return 0 unless $self->_compare_objects(scalar $self->extra, scalar $other->extra);
return 1;
}