line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::SchemaChecksum::App; |
2
|
5
|
|
|
5
|
|
21718
|
use 5.010; |
|
5
|
|
|
|
|
22
|
|
3
|
5
|
|
|
5
|
|
2192
|
use MooseX::App 1.21 qw(Config ConfigHome); |
|
5
|
|
|
|
|
861591
|
|
|
5
|
|
|
|
|
34
|
|
4
|
|
|
|
|
|
|
extends qw(DBIx::SchemaChecksum); |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
# ABSTRACT: Manage your datebase schema via checksums |
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
3240607
|
use DBI; |
|
5
|
|
|
|
|
36117
|
|
|
5
|
|
|
|
|
1122
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
option 'dsn' => ( |
11
|
|
|
|
|
|
|
isa => 'Str', |
12
|
|
|
|
|
|
|
is => 'ro', |
13
|
|
|
|
|
|
|
required => 1, |
14
|
|
|
|
|
|
|
documentation => q[DBI Data Source Name] |
15
|
|
|
|
|
|
|
); |
16
|
|
|
|
|
|
|
option 'user' => ( |
17
|
|
|
|
|
|
|
isa => 'Str', |
18
|
|
|
|
|
|
|
is => 'ro', |
19
|
|
|
|
|
|
|
documentation => q[username to connect to database] |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
option 'password' => ( |
22
|
|
|
|
|
|
|
isa => 'Str', |
23
|
|
|
|
|
|
|
is => 'ro', |
24
|
|
|
|
|
|
|
documentation => q[password to connect to database] |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
option [qw(+catalog +schemata +driveropts)] => (); |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
has '+dbh' => ( lazy_build => 1 ); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub _build_dbh { |
31
|
5
|
|
|
5
|
|
16
|
my $self = shift; |
32
|
5
|
|
|
|
|
176
|
return DBI->connect( |
33
|
|
|
|
|
|
|
$self->dsn, $self->user, $self->password, |
34
|
|
|
|
|
|
|
{ RaiseError => 1 } # TODO: set dbi->connect opts via App |
35
|
|
|
|
|
|
|
); |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable(); |
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=pod |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=encoding UTF-8 |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 NAME |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
DBIx::SchemaChecksum::App - Manage your datebase schema via checksums |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 VERSION |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
version 1.102 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 DESCRIPTION |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
Manage your datebase schema via checksums |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=over |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=item * Use C<checksum> to calculate the current checksum of your database. |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=item * Use C<new_changes_file> to generate a new db update script based on the current checksum. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=item * Use C<apply_changes> to apply all update scripts starting from the current checksum. |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=back |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
For more background information, check out the man-page via C<perldoc DBIx::SchemaChecksum> or on L<https://metacpan.org/pod/DBIx::SchemaChecksum> |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 AUTHORS |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=over 4 |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item * |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
Thomas Klausner <domm@cpan.org> |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=item * |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Maroš Kollár <maros@cpan.org> |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=item * |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
Klaus Ita <koki@worstofall.com> |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=back |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
This software is copyright (c) 2012 by Thomas Klausner, Maroš Kollár, Klaus Ita. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
94
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |