line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Class::DeploymentHandler::VersionStorage::Standard; |
2
|
|
|
|
|
|
|
$DBIx::Class::DeploymentHandler::VersionStorage::Standard::VERSION = '0.002233'; |
3
|
11
|
|
|
11
|
|
101785
|
use Moose; |
|
11
|
|
|
|
|
381442
|
|
|
11
|
|
|
|
|
77
|
|
4
|
11
|
|
|
11
|
|
64007
|
use DBIx::Class::DeploymentHandler::LogImporter ':log'; |
|
11
|
|
|
|
|
27
|
|
|
11
|
|
|
|
|
104
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Version storage that does the normal stuff |
7
|
|
|
|
|
|
|
|
8
|
11
|
|
|
11
|
|
5372
|
use DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult; |
|
11
|
|
|
|
|
70
|
|
|
11
|
|
|
|
|
3004
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has schema => ( |
11
|
|
|
|
|
|
|
is => 'ro', |
12
|
|
|
|
|
|
|
required => 1, |
13
|
|
|
|
|
|
|
); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has version_source => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
default => '__VERSION', |
18
|
|
|
|
|
|
|
); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has version_class => ( |
21
|
|
|
|
|
|
|
is => 'ro', |
22
|
|
|
|
|
|
|
default => |
23
|
|
|
|
|
|
|
'DBIx::Class::DeploymentHandler::VersionStorage::Standard::VersionResult', |
24
|
|
|
|
|
|
|
); |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has version_rs => ( |
27
|
|
|
|
|
|
|
isa => 'DBIx::Class::ResultSet', |
28
|
|
|
|
|
|
|
is => 'ro', |
29
|
|
|
|
|
|
|
lazy => 1, |
30
|
|
|
|
|
|
|
builder => '_build_version_rs', |
31
|
|
|
|
|
|
|
handles => [qw( database_version version_storage_is_installed )], |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
with 'DBIx::Class::DeploymentHandler::HandlesVersionStorage'; |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub _build_version_rs { |
37
|
33
|
|
|
33
|
|
1176
|
$_[0]->schema->register_class( |
38
|
|
|
|
|
|
|
$_[0]->version_source => $_[0]->version_class )->resultset; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub add_database_version { |
42
|
27
|
|
|
27
|
0
|
4697
|
my $version = $_[1]->{version}; |
43
|
27
|
|
|
0
|
|
227
|
log_debug { "Adding database version $version" }; |
|
0
|
|
|
|
|
0
|
|
44
|
27
|
|
|
|
|
1849
|
$_[0]->version_rs->create($_[1]) |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub delete_database_version { |
48
|
7
|
|
|
7
|
0
|
115
|
my $version = $_[1]->{version}; |
49
|
7
|
|
|
0
|
|
59
|
log_debug { "Deleting database version $version" }; |
|
0
|
|
|
|
|
0
|
|
50
|
7
|
|
|
|
|
505
|
$_[0]->version_rs->search({ version => $version})->delete |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
1; |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# vim: ts=2 sw=2 expandtab |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
__END__ |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=pod |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 NAME |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
DBIx::Class::DeploymentHandler::VersionStorage::Standard - Version storage that does the normal stuff |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 SEE ALSO |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
This class is an implementation of |
70
|
|
|
|
|
|
|
L<DBIx::Class::DeploymentHandler::HandlesVersionStorage>. Pretty much all the |
71
|
|
|
|
|
|
|
documentation is there. |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 AUTHOR |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Arthur Axel "fREW" Schmidt <frioux+cpan@gmail.com> |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
This software is copyright (c) 2019 by Arthur Axel "fREW" Schmidt. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
82
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=cut |