Commit | Line | Data |
---|---|---|
30c3818a | 1 | package DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResultSet; |
12fdd461 | 2 | |
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use parent 'DBIx::Class::ResultSet'; | |
7 | ||
8 | use Try::Tiny; | |
9 | ||
2a9e7b48 | 10 | sub version_storage_is_installed { |
12fdd461 | 11 | my $self = shift; |
3d3e2f00 | 12 | try { $self->next; 1 } catch { undef } |
12fdd461 | 13 | } |
14 | ||
2a9e7b48 | 15 | sub database_version { |
12fdd461 | 16 | my $self = shift; |
17 | $self->search(undef, { | |
3d3e2f00 | 18 | order_by => { -desc => 'id' }, |
12fdd461 | 19 | rows => 1 |
22be40e9 | 20 | })->get_column('version')->next; |
12fdd461 | 21 | } |
22 | ||
23 | 1; | |
3d3e2f00 | 24 | |
25 | __END__ | |
26 | ||
27 | vim: ts=2 sw=2 expandtab |