File Coverage

blib/lib/KiokuDB/Role/Upgrade/Data.pm
Criterion Covered Total %
statement 6 6 100.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 8 8 100.0


line stmt bran cond sub pod time code
1             package KiokuDB::Role::Upgrade::Data;
2 1     1   7249 use Moose::Role;
  1         4  
  1         7  
3              
4 1     1   4124 use namespace::clean;
  1         2  
  1         7  
5              
6             requires "kiokudb_upgrade_data";
7              
8             # ex: set sw=4 et:
9              
10             __PACKAGE__
11              
12             __END__
13              
14             =pod
15              
16             =head1 NAME
17              
18             KiokuDB::Role::Upgrade::Data - Classes that provide their own upgrade routine.
19              
20             =head1 SYNOPSIS
21              
22             with qw(KiokuDB::Role::Upgrade::Data);
23              
24             sub kiokudb_upgrade_data {
25             my ( $class, %args ) = @_;
26              
27             # convert the data from the old version of the class to the new version
28             # as necessary
29              
30             $args{entry}->derive(
31             class_version => our $VERSION,
32             ...
33             );
34             }
35              
36             =head1 DESCRIPTION
37              
38             This class allows you to take control the data conversion process completely
39             (there is only one handler per class, not one handler per version with this
40             approach).
41              
42             See L<KiokuDB::Role::Upgrade::Handlers::Table> for a more DWIM approach, and
43             L<KiokuDB::TypeMap::Entry::MOP> for more details.