use strict;
use warnings;
-use Class::C3;
+use base 'DBIx::Class::Schema::Loader::DBI';
+use mro 'c3';
-our $VERSION = '0.07000';
+our $VERSION = '0.07048_01';
=head1 NAME
my $self = shift;
my ($table) = @_;
- my $result = $self->next::method(@_);
+ my ($result,$raw) = $self->next::method(@_);
while (my ($col, $info) = each %$result) {
if (my $def = $info->{default_value}) {
if ($def =~ /^["'](.*?)['"](?:::[\w\s]+)?\z/) {
$info->{default_value} = $1;
}
+# Some DBs (eg. Pg) put parenthesis around negative number defaults
+ elsif ($def =~ /^\((-?\d.*?)\)(?:::[\w\s]+)?\z/) {
+ $info->{default_value} = $1;
+ }
+ elsif ($def =~ /^(-?\d.*?)(?:::[\w\s]+)?\z/) {
+ $info->{default_value} = $1;
+ }
+ elsif ($def =~ /^NULL:?/i) {
+ my $null = 'null';
+ $info->{default_value} = \$null;
+ }
else {
- # Some DBs (eg. Pg) put brackets around negative number defaults
- $info->{default_value} = $def =~ /^\(?(-?\d.*?)\)?$/ ? $1 : \$def;
+ $info->{default_value} = \$def;
}
}
}
- return $result;
+ return wantarray ? ($result, $raw) : $result;
}
1;
L<DBIx::Class::Schema::Loader>, L<DBIx::Class::Schema::Loader::Base>,
L<DBIx::Class::Schema::Loader::DBI>
-=head1 AUTHOR
+=head1 AUTHORS
-See L<DBIx::Class::Schema::Loader/AUTHOR> and L<DBIx::Class::Schema::Loader/CONTRIBUTORS>.
+See L<DBIx::Class::Schema::Loader/AUTHORS>.
=head1 LICENSE