{
my ($self) = @_;
- weaken (my $w_self = $self );
+ weaken (my $w_storage = $self->storage );
- $self->{vschema} = DBIx::Class::Version->connect(sub { $w_self->storage->dbh });
- my $conn_attrs = $self->storage->_dbic_connect_attributes || {};
+ $self->{vschema} = DBIx::Class::Version->connect(sub { $w_storage->dbh });
+ my $conn_attrs = $w_storage->_dbic_connect_attributes || {};
my $vtable = $self->{vschema}->resultset('Table');
# check for legacy versions table and move to new if exists
unless ($self->_source_exists($vtable)) {
- my $vtable_compat = DBIx::Class::VersionCompat->connect(sub { $w_self->storage->dbh })->resultset('TableCompat');
+ my $vtable_compat = DBIx::Class::VersionCompat->connect(sub { $w_storage->dbh })->resultset('TableCompat');
if ($self->_source_exists($vtable_compat)) {
$self->{vschema}->deploy;
map { $vtable->new_result({ installed => $_->Installed, version => $_->Version })->insert } $vtable_compat->all;
- $self->storage->_get_dbh->do("DROP TABLE " . $vtable_compat->result_source->from);
+ $w_storage->_get_dbh->do("DROP TABLE " . $vtable_compat->result_source->from);
}
}