our $VERSION = '0.04999_12';
__PACKAGE__->mk_classaccessor('_loader_args' => {});
-__PACKAGE__->mk_classaccessors(qw/dump_to_dir _loader_invoked _loader loader_class/);
+__PACKAGE__->mk_classaccessors(qw/
+ dump_to_dir _loader_invoked _loader loader_class naming
+/);
=head1 NAME
$args->{schema_class} = $class;
weaken($args->{schema}) if ref $self;
$args->{dump_directory} ||= $self->dump_to_dir;
+ $args->{naming} = $self->naming;
# XXX this only works for relative storage_type, like ::DBI ...
my $impl = $self->loader_class
sub import {
my $self = shift;
+
return if !@_;
+
+ my $cpkg = (caller)[0];
+
foreach my $opt (@_) {
if($opt =~ m{^dump_to_dir:(.*)$}) {
$self->dump_to_dir($1)
}
elsif($opt eq 'make_schema_at') {
no strict 'refs';
- my $cpkg = (caller)[0];
*{"${cpkg}::make_schema_at"} = \&make_schema_at;
}
+ elsif($opt eq 'naming') {
+ no strict 'refs';
+ *{"${cpkg}::naming"} = sub { $self->naming(@_) };
+ }
}
}
sub rescan { my $self = shift; $self->_loader->rescan($self) }
+=head2 naming
+
+=over 4
+
+=item Arguments: \%opts | $ver
+
+=back
+
+Controls the naming options for backward compatibility, see
+L<DBIx::Class::Schema::Loader::Base/naming> for details.
+
+To upgrade a dynamic schema, use:
+
+ __PACKAGE__->naming('current');
+
+Can be imported into your dump script and called as a function as well:
+
+ naming('v4');
=head1 KNOWN ISSUES