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