Commit | Line | Data |
8bf3eee1 |
1 | package DBIx::Class::DeploymentHandler::WithSqltDeployMethod; |
2 | use Moose::Role; |
3 | |
45d0d9d5 |
4 | use DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator; |
8bf3eee1 |
5 | |
6 | has deploy_method => ( |
c5eedffc |
7 | |
8 | # < mst> isa => 'DBIx::Class::DeploymentHandler::SqltDeployMethod', |
9 | # < mst> should be |
10 | # < mst> does => <some role> |
11 | # < mst> and that role should supply those methods |
12 | # < mst> then you can pass handles => <some role> as well |
13 | |
45d0d9d5 |
14 | isa => 'DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator', |
8bf3eee1 |
15 | is => 'ro', |
16 | lazy_build => 1, |
17 | handles => [qw{ |
8a7847f1 |
18 | _deploy |
a912450b |
19 | prepare_install |
199410d3 |
20 | prepare_update |
8a7847f1 |
21 | _upgrade_single_step |
8bf3eee1 |
22 | }], |
23 | ); |
24 | |
25 | sub _build_deploy_method { |
a912450b |
26 | my $self = shift; |
27 | my $args = { |
28 | schema => $self->schema, |
29 | databases => $self->databases, |
30 | upgrade_directory => $self->upgrade_directory, |
31 | sqltargs => $self->sqltargs, |
32 | do_backup => $self->do_backup, |
33 | }; |
34 | $args->{backup_directory} = $self->backup_directory |
35 | if $self->has_backup_directory; |
45d0d9d5 |
36 | DBIx::Class::DeploymentHandler::DeployMethod::SQL::Translator->new($args); |
8bf3eee1 |
37 | } |
38 | |
39 | 1; |
e051bb00 |
40 | |
41 | __END__ |
42 | |
5e69e635 |
43 | vim: ts=2 sw=2 expandtab |