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