faster travis builds
[dbsrgits/DBIx-Class-DeploymentHandler.git] / lib / DBIx / Class / DeploymentHandler / VersionStorage / Standard / VersionResultSet.pm
CommitLineData
30c3818a 1package DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResultSet;
12fdd461 2
0fa93773 3# ABSTRACT: Predefined searches to find what you want from the version storage
4
12fdd461 5use strict;
6use warnings;
7
8use parent 'DBIx::Class::ResultSet';
9
10use Try::Tiny;
11
2a9e7b48 12sub version_storage_is_installed {
12fdd461 13 my $self = shift;
456f7571 14 try { $self->count; 1 } catch { undef }
12fdd461 15}
16
2a9e7b48 17sub 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
251;
3d3e2f00 26
e52174e3 27# vim: ts=2 sw=2 expandtab
28
3d3e2f00 29__END__
30
0fa93773 31=method version_storage_is_installed
32
33True if (!!!) the version storage has been installed
34
35=method database_version
36
37The version of the database