line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DBIx::Schema::Changelog::Action::View; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
=head1 NAME |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
DBIx::Schema::Changelog::Action::View - Handles view actions |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
=head1 VERSION |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
Version 0.8.0 |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
=cut |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
our $VERSION = '0.8.0'; |
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
5
|
|
3646
|
use utf8; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
47
|
|
16
|
5
|
|
|
5
|
|
262
|
use strict; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
232
|
|
17
|
5
|
|
|
5
|
|
30
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
213
|
|
18
|
5
|
|
|
5
|
|
32
|
use Moose; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
48
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
with 'DBIx::Schema::Changelog::Action'; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 SUBROUTINES/METHODS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=over 4 |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=item add |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Add view |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=cut |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub add { |
33
|
3
|
|
|
3
|
1
|
1448
|
my ( $self, $params ) = @_; |
34
|
3
|
|
|
|
|
159
|
my $actions = $self->driver()->actions; |
35
|
3
|
50
|
|
|
|
15
|
die " Create view is not supported!" unless ( $actions->{create_view} ); |
36
|
3
|
|
|
|
|
25
|
my $sql = _replace_spare( $actions->{create_view}, |
37
|
|
|
|
|
|
|
[ $params->{name}, $params->{as} ] ); |
38
|
3
|
|
|
|
|
16
|
$self->_do($sql); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
=item alter |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
Drop view and add new one. |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=cut |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub alter { |
48
|
1
|
|
|
1
|
1
|
3
|
my ( $self, $params ) = @_; |
49
|
1
|
|
|
|
|
5
|
$self->drop($params); |
50
|
1
|
|
|
|
|
88122
|
$self->add($params); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=item drop |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Drop defined view. |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=cut |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub drop { |
60
|
2
|
|
|
2
|
1
|
7
|
my ( $self, $params ) = @_; |
61
|
2
|
|
|
|
|
104
|
my $actions = $self->driver()->actions; |
62
|
2
|
|
|
|
|
14
|
my $sql = _replace_spare( $actions->{drop_view}, [ $params->{name} ] ); |
63
|
2
|
|
|
|
|
8
|
$self->_do($sql); |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
5
|
|
|
5
|
|
38181
|
no Moose; |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
32
|
|
68
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
__END__ |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=back |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 AUTHOR |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Mario Zieschang, C<< <mario.zieschang at combase.de> >> |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
Copyright 2015 Mario Zieschang. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
85
|
|
|
|
|
|
|
under the terms of the the Artistic License (2.0). You may obtain a |
86
|
|
|
|
|
|
|
copy of the full license at: |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
L<http://www.perlfoundation.org/artistic_license_2_0> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
Any use, modification, and distribution of the Standard or Modified |
91
|
|
|
|
|
|
|
Versions is governed by this Artistic License. By using, modifying or |
92
|
|
|
|
|
|
|
distributing the Package, you accept this license. Do not use, modify, |
93
|
|
|
|
|
|
|
or distribute the Package, if you do not accept this license. |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
If your Modified Version has been derived from a Modified Version made |
96
|
|
|
|
|
|
|
by someone other than you, you are nevertheless required to ensure that |
97
|
|
|
|
|
|
|
your Modified Version complies with the requirements of this license. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
This license does not grant you the right to use any trademark, service |
100
|
|
|
|
|
|
|
mark, trade name, or logo of the Copyright Holder. |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
This license includes the non-exclusive, worldwide, free-of-charge |
103
|
|
|
|
|
|
|
patent license to make, have made, use, offer to sell, sell, import and |
104
|
|
|
|
|
|
|
otherwise transfer the Package with respect to any patent claims |
105
|
|
|
|
|
|
|
licensable by the Copyright Holder that are necessarily infringed by the |
106
|
|
|
|
|
|
|
Package. If you institute patent litigation (including a cross-claim or |
107
|
|
|
|
|
|
|
counterclaim) against any party alleging that the Package constitutes |
108
|
|
|
|
|
|
|
direct or contributory patent infringement, then this Artistic License |
109
|
|
|
|
|
|
|
to you shall terminate on the date that such litigation is filed. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER |
112
|
|
|
|
|
|
|
AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. |
113
|
|
|
|
|
|
|
THE IMPLIED WARRANTIES OF MERCHANT ABILITY, FITNESS FOR A PARTICULAR |
114
|
|
|
|
|
|
|
PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY |
115
|
|
|
|
|
|
|
YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR |
116
|
|
|
|
|
|
|
CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR |
117
|
|
|
|
|
|
|
CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, |
118
|
|
|
|
|
|
|
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=cut |