Commit | Line | Data |
---|---|---|
12fdd461 | 1 | package DBIx::Class::DeploymentHandler::VersionResultSet; |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
6 | use parent 'DBIx::Class::ResultSet'; | |
7 | ||
8 | use Try::Tiny; | |
9 | ||
10 | sub is_installed { | |
11 | my $self = shift; | |
12 | try { $self->next; 1} catch { undef } | |
13 | } | |
14 | ||
15 | sub db_version { | |
16 | my $self = shift; | |
17 | $self->search(undef, { | |
18 | order_by => { -desc => 'installed' }, | |
19 | rows => 1 | |
20 | })->get_column('version')->next || 0; | |
21 | } | |
22 | ||
23 | 1; |