X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FDeploymentHandler%2FSqltDeployMethod.pm;h=230790cf33cac810d50df69a18b03c1095d75eba;hb=d23c7c771d9f64d59bff4043b6493c795d9282af;hp=2ad946d3f780e091371b1712f29418682e214869;hpb=334bced5e3d08a9f7fe0688c9c730c48c38e1550;p=dbsrgits%2FDBIx-Class-DeploymentHandler.git diff --git a/lib/DBIx/Class/DeploymentHandler/SqltDeployMethod.pm b/lib/DBIx/Class/DeploymentHandler/SqltDeployMethod.pm index 2ad946d..230790c 100644 --- a/lib/DBIx/Class/DeploymentHandler/SqltDeployMethod.pm +++ b/lib/DBIx/Class/DeploymentHandler/SqltDeployMethod.pm @@ -1,6 +1,10 @@ package DBIx::Class::DeploymentHandler::SqltDeployMethod; use Moose; use Method::Signatures::Simple; +use Try::Tiny; +use SQL::Translator; +require SQL::Translator::Diff; +require DBIx::Class::Storage; # loaded for type constraint use Carp 'carp'; @@ -10,6 +14,12 @@ has storage => ( lazy_build => 1, ); +method _build_storage { + my $s = $self->schema->storage; + $s->_determine_driver; + $s +} + has backup_directory => ( isa => 'Str', is => 'ro', @@ -109,10 +119,6 @@ method deployment_statements { } method deploy { - my $schema = $self->schema; - my $type = undef; - my $sqltargs = $self->sqltargs; - my $dir = $self->upgrade_directory; my $storage = $self->storage; my $deploy = sub { @@ -380,4 +386,9 @@ method apply_statement($statement) { method backup { $self->storage->backup($self->backup_directory) } __PACKAGE__->meta->make_immutable; + 1; + +__END__ + +vim: ts=2 sw=2 expandtab