fix method names in VersionResultSet
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / VersionResultSet.pm
CommitLineData
12fdd461 1package DBIx::Class::DeploymentHandler::VersionResultSet;
2
3use strict;
4use warnings;
5
6use parent 'DBIx::Class::ResultSet';
7
8use Try::Tiny;
9
2a9e7b48 10sub version_storage_is_installed {
12fdd461 11 my $self = shift;
12 try { $self->next; 1} catch { undef }
13}
14
2a9e7b48 15sub database_version {
12fdd461 16 my $self = shift;
17 $self->search(undef, {
18 order_by => { -desc => 'installed' },
19 rows => 1
20 })->get_column('version')->next || 0;
21}
22
231;