deploy => {
req => {
- 'SQL::Translator' => '0.11006',
+ 'SQL::Translator' => '0.11016',
},
pod => {
title => 'Storage::DBI::deploy()',
use SQL::Translator::Utils qw(debug normalize_name);
use DBIx::Class::Carp qw/^SQL::Translator|^DBIx::Class|^Try::Tiny/;
use DBIx::Class::Exception;
-use Scalar::Util qw/weaken blessed/;
+use Scalar::Util 'blessed';
use Try::Tiny;
use namespace::clean;
$dbicschema ||= $args->{'package'};
my $limit_sources = $args->{'sources'};
- # this is a hack to prevent schema leaks due to a retarded SQLT implementation
- # DO NOT REMOVE (until SQLT2 is out, the all of this will be rewritten anyway)
- ref $_ and weaken $_
- for $_[1], $dbicschema, @{$args}{qw/DBIx::Schema DBIx::Class::Schema package/};
-
DBIx::Class::Exception->throw('No DBIx::Class::Schema') unless ($dbicschema);
if (!ref $dbicschema) {
eval "require $dbicschema"
# Moo keeps globals around, this is normal
delete $weak_registry->{$slot};
}
- elsif ($slot =~ /^SQL::Translator/) {
- # SQLT is a piece of shit, leaks all over
+ elsif ($slot =~ /^SQL::Translator::Generator::DDL::SQLite/) {
+ # SQLT got much better, but still leaks a little
delete $weak_registry->{$slot};
}
elsif ($slot =~ /^Hash::Merge/) {
## Get the Schema and set the replication storage type
sub init_schema {
- # current SQLT SQLite producer does not handle DROP TABLE IF EXISTS, trap warnings here
- local $SIG{__WARN__} = sub { warn @_ unless $_[0] =~ /no such table.+DROP TABLE/s };
-
- my ($class, $schema_method) = @_;
-
- my $method = "get_schema_$schema_method";
- my $schema = $class->$method;
-
- return $schema;
+ #my ($class, $schema_getter) = @_;
+ shift->${\ ( 'get_schema_' . shift ) };
}
sub get_schema_by_storage_type {