line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geoffrey::Action::Constraint::Index; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
735
|
use utf8; |
|
7
|
|
|
|
|
16
|
|
|
7
|
|
|
|
|
48
|
|
4
|
7
|
|
|
7
|
|
292
|
use 5.016; |
|
7
|
|
|
|
|
25
|
|
5
|
7
|
|
|
7
|
|
40
|
use strict; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
209
|
|
6
|
7
|
|
|
7
|
|
40
|
use warnings; |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
229
|
|
7
|
|
|
|
|
|
|
|
8
|
7
|
|
|
7
|
|
39
|
use parent 'Geoffrey::Role::Action'; |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
76
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
$Geoffrey::Action::Constraint::Index::VERSION = '0.000203'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub add { |
13
|
9
|
|
|
9
|
1
|
8550
|
my ( $self, $hr_params ) = @_; |
14
|
9
|
|
|
|
|
60
|
return $self->do( $self->converter->index->add($hr_params) ); |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub alter { |
18
|
3
|
|
|
3
|
1
|
59
|
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
|
116
|
my ( $self, $hr_params ) = @_; |
24
|
7
|
|
|
|
|
49
|
require Ref::Util; |
25
|
7
|
100
|
|
|
|
33
|
my $s_name = Ref::Util::is_hashref($hr_params) ? $hr_params->{name} : undef; |
26
|
7
|
100
|
|
|
|
24
|
if ( !$s_name ) { |
27
|
1
|
|
|
|
|
6
|
require Geoffrey::Exception::RequiredValue; |
28
|
1
|
|
|
|
|
7
|
Geoffrey::Exception::RequiredValue::throw_index_name('to drop'); |
29
|
|
|
|
|
|
|
} |
30
|
6
|
|
|
|
|
27
|
return $self->do( $self->converter->index->drop($s_name) ); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
sub list_from_schema { |
34
|
4
|
|
|
4
|
1
|
127
|
my ( $self, $schema ) = @_; |
35
|
4
|
|
|
|
|
24
|
my $converter = $self->converter; |
36
|
4
|
|
|
|
|
23
|
return $converter->index_information( $self->do_arrayref( $converter->index->list($schema) ) ); |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |