-dump_to_dir needs an overwrite flag, and needs to not overwrite by default
+support multiple/all schemas, instead of just one
+
+support pk/uk/fk info on views, possibly. May or may not be a sane thing to try to do.
-dumping needs to pick up columns_info_for data
+dump_to_dir needs an overwrite flag, and needs to not overwrite by default
Fix up ResultSet Manager / Methods / etc stuff. May require some work in the
main DBIx::Class first.
# Always remember to do all digits for the version even if they're 0
# i.e. first release of 0.XX *must* be 0.XX000. This avoids fBSD ports
# brain damage and presumably various other packaging systems too
-our $VERSION = '0.03003';
+our $VERSION = '0.03004';
__PACKAGE__->mk_classaccessor('dump_to_dir');
__PACKAGE__->mk_classaccessor('loader');
sub _load_classes {
my $self = shift;
- my $schema = $self->schema;
- my $schema_class = $self->schema_class;
-
- my $constraint = $self->constraint;
- my $exclude = $self->exclude;
- my @tables = sort $self->_tables_list;
+ my $schema = $self->schema;
+ my $schema_class = $self->schema_class;
+ my $constraint = $self->constraint;
+ my $exclude = $self->exclude;
+ my @tables = sort $self->_tables_list;
warn "No tables found in database, nothing to load" if !@tables;
local *Class::C3::reinitialize = sub { };
use warnings;
- { no strict 'refs';
- @{"${table_class}::ISA"} = qw/DBIx::Class/;
- }
+ { no strict 'refs'; @{"${table_class}::ISA"} = qw/DBIx::Class/ }
+
$self->_use ($table_class, @{$self->additional_classes});
$self->_inject($table_class, @{$self->additional_base_classes});
$self->_dbic_stmt($table_class,'table',$table);
my $cols = $self->_table_columns($table);
- $self->_dbic_stmt($table_class,'add_columns',@$cols);
+ my $col_info;
+ eval { $col_info = $schema->storage->columns_info_for($table) };
+ if($@) {
+ $self->_dbic_stmt($table_class,'add_columns',@$cols);
+ }
+ else {
+ my %cols_hash;
+ foreach my $col (@$cols) {
+ $cols_hash{$col} = \%{($col_info->{$col})};
+ }
+ $self->_dbic_stmt($table_class,'add_columns',%cols_hash);
+ }
my $pks = $self->_table_pk_info($table) || [];
@$pks ? $self->_dbic_stmt($table_class,'set_primary_key',@$pks)