Commit | Line | Data |
0905dc0e |
1 | package DBIx::Class::DeploymentHandler::VersionStorage::Standard; |
2 | use Moose; |
3 | use Method::Signatures::Simple; |
4 | |
5 | has schema => ( |
6 | isa => 'DBIx::Class::Schema', |
7 | is => 'ro', |
8 | required => 1, |
9 | ); |
10 | |
11 | has version_rs => ( |
12 | isa => 'DBIx::Class::ResultSet', |
13 | is => 'ro', |
14 | lazy_build => 1, # builder comes from another role... |
15 | # which is... probably not how we want it |
16 | handles => [qw( database_version version_storage_is_installed )], |
17 | ); |
18 | |
19 | with 'DBIx::Class::DeploymentHandler::HandlesVersionStorage'; |
20 | |
21 | sub _build_version_rs { |
6bbb6ce7 |
22 | $_[0]->schema->register_class( |
23 | __VERSION => |
24 | 'DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult' |
25 | ); |
26 | $_[0]->schema->resultset('__VERSION') |
0905dc0e |
27 | } |
28 | |
29 | sub add_database_version { $_[0]->version_rs->create($_[1]) } |
30 | |
0905dc0e |
31 | 1; |
32 | |
33 | __END__ |
34 | |
35 | vim: ts=2 sw=2 expandtab |