use strict;
use vars qw($VERSION);
-$VERSION = '0.06';
+$VERSION = '0.07';
=head1 NAME
sub alter_column_callback { {}; }
+=item column_value_needs_quoting COLUMN_OBJ
+
+Optional callback for determining if a column's default value require quoting.
+Returns true if it does, false otherwise.
+
=cut
+sub column_value_needs_quoting {
+ my($proto, $col) = @_;
+ my $class = ref($proto) || $proto;
+
+ # type mapping
+ my %typemap = eval "\%${class}::typemap";
+ my $type = defined( $typemap{uc($col->type)} )
+ ? $typemap{uc($col->type)}
+ : $col->type;
+
+ # false laziness: nicked from FS::Record::_quote
+ $col->default !~ /^\-?\d+(\.\d+)?$/
+ || $type =~ /(char|binary|blob|text)$/i;
+
+}
+
=back
=head1 TYPE MAPPING
=head1 COPYRIGHT
Copyright (c) 2000-2005 Ivan Kohler
-Copyright (c) 2007 Freeside Internet Services, Inc.
+Copyright (c) 2007-2010 Freeside Internet Services, Inc.
All rights reserved.
This program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.