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 |
8bf3eee1 |
22 | create_install_ddl |
23 | create_update_ddl |
24 | create_ddl_dir |
25 | upgrade_single_step |
26 | }], |
27 | ); |
28 | |
29 | sub _build_deploy_method { |
30 | my $self = shift; |
31 | my $args = { |
32 | schema => $self->schema, |
33 | databases => $self->databases, |
34 | upgrade_directory => $self->upgrade_directory, |
35 | sqltargs => $self->sqltargs, |
8bf3eee1 |
36 | do_backup => $self->do_backup, |
37 | }; |
38 | $args->{backup_directory} = $self->backup_directory |
39 | if $self->has_backup_directory; |
40 | DBIx::Class::DeploymentHandler::SqltDeployMethod->new($args); |
41 | } |
42 | |
43 | 1; |
e051bb00 |
44 | |
45 | __END__ |
46 | |
5e69e635 |
47 | vim: ts=2 sw=2 expandtab |