Commit | Line | Data |
---|---|---|
30c3818a | 1 | package DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResultSet; |
12fdd461 | 2 | |
0fa93773 | 3 | # ABSTRACT: Predefined searches to find what you want from the version storage |
4 | ||
12fdd461 | 5 | use strict; |
6 | use warnings; | |
7 | ||
8 | use parent 'DBIx::Class::ResultSet'; | |
9 | ||
10 | use Try::Tiny; | |
11 | ||
2a9e7b48 | 12 | sub version_storage_is_installed { |
12fdd461 | 13 | my $self = shift; |
3d3e2f00 | 14 | try { $self->next; 1 } catch { undef } |
12fdd461 | 15 | } |
16 | ||
2a9e7b48 | 17 | sub database_version { |
12fdd461 | 18 | my $self = shift; |
19 | $self->search(undef, { | |
3d3e2f00 | 20 | order_by => { -desc => 'id' }, |
12fdd461 | 21 | rows => 1 |
22be40e9 | 22 | })->get_column('version')->next; |
12fdd461 | 23 | } |
24 | ||
25 | 1; | |
3d3e2f00 | 26 | |
e52174e3 | 27 | # vim: ts=2 sw=2 expandtab |
28 | ||
3d3e2f00 | 29 | __END__ |
30 | ||
0fa93773 | 31 | =method version_storage_is_installed |
32 | ||
33 | True if (!!!) the version storage has been installed | |
34 | ||
35 | =method database_version | |
36 | ||
37 | The version of the database |