line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geoffrey::Action::Constraint::Index; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
725
|
use utf8; |
|
7
|
|
|
|
|
18
|
|
|
7
|
|
|
|
|
39
|
|
4
|
7
|
|
|
7
|
|
280
|
use 5.016; |
|
7
|
|
|
|
|
24
|
|
5
|
7
|
|
|
7
|
|
37
|
use strict; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
173
|
|
6
|
7
|
|
|
7
|
|
37
|
use warnings; |
|
7
|
|
|
|
|
32
|
|
|
7
|
|
|
|
|
230
|
|
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
40
|
use parent 'Geoffrey::Role::Action'; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
43
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$Geoffrey::Action::Constraint::Index::VERSION = '0.000204'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub add { |
13
|
9
|
|
|
9
|
1
|
8668
|
my ( $self, $hr_params ) = @_; |
14
|
9
|
|
|
|
|
69
|
return $self->do( $self->converter->index->add($hr_params) ); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub alter { |
18
|
3
|
|
|
3
|
1
|
84
|
my ( $self, $hr_params ) = @_; |
19
|
3
|
|
|
|
|
13
|
return [ $self->drop($hr_params), $self->add($hr_params) ]; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub drop { |
23
|
7
|
|
|
7
|
1
|
153
|
my ( $self, $hr_params ) = @_; |
24
|
7
|
|
|
|
|
58
|
require Ref::Util; |
25
|
7
|
100
|
|
|
|
39
|
my $s_name = Ref::Util::is_hashref($hr_params) ? $hr_params->{name} : undef; |
26
|
7
|
100
|
|
|
|
26
|
if ( !$s_name ) { |
27
|
1
|
|
|
|
|
7
|
require Geoffrey::Exception::RequiredValue; |
28
|
1
|
|
|
|
|
10
|
Geoffrey::Exception::RequiredValue::throw_index_name('to drop'); |
29
|
|
|
|
|
|
|
} |
30
|
6
|
|
|
|
|
53
|
return $self->do( $self->converter->index->drop($s_name) ); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub list_from_schema { |
34
|
4
|
|
|
4
|
1
|
139
|
my ( $self, $schema ) = @_; |
35
|
4
|
|
|
|
|
26
|
my $converter = $self->converter; |
36
|
4
|
|
|
|
|
26
|
return $converter->index_information( $self->do_arrayref( $converter->index->list($schema) ) ); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |