RCP/Database/Result/CharacterInventory.pm

filter: Statementstmt 100% 25 / 25 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 31 / 31 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« RCP/Database/Result/CharacterCurrency.pm ↑ Summary RCP/Database/Result/CharacterMove.pm »
1 package Games::Framework::RCP::Database::Result::CharacterInventory;
2  
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '0.22';
8  
9 3 ▶use base qw/DBIx::Class/;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 __PACKAGE__->load_components(qw/UTF8Columns Core/);
12 3 __PACKAGE__->table('character_inventory');
13 3 __PACKAGE__->add_columns(
14 id_character_inventory => {
15 data_type => 'integer',
16 is_nullable => 0,
17 is_auto_increment => 1,
18 comments => 'ID of the character / item combination.',
19 extra => {unsigned => 1},
20 },
21 fkey_character => {
22 data_type => 'integer',
23 is_nullable => 0,
24 comments => 'ID of the character.',
25 extra => {unsigned => 1},
26 },
27 fkey_item => {
28 data_type => 'integer',
29 is_nullable => 0,
30 comments => 'ID of the item.',
31 extra => {unsigned => 1},
32 },
33 display_name => {
34 data_type => 'varchar',
35 size => 64,
36 is_nullable => 1,
37 default_value => undef,
38 comments => 'Publically displayed name of the item.',
39 },
40 ammo => {
41 data_type => 'integer',
42 is_nullable => 1,
43 default_value => 1,
44 comments => 'How much of this item does the character have in storage?',
45 },
46 );
47  
48 3 __PACKAGE__->utf8_columns(qw/display_name/);
49  
50 3 __PACKAGE__->set_primary_key('id_character_inventory');
51  
52 3 __PACKAGE__->belongs_to(items => 'Games::Framework::RCP::Database::Result::Item', 'fkey_item');
53  
54 3 __PACKAGE__->belongs_to(characters => 'Games::Framework::RCP::Database::Result::Character', 'fkey_character');
55  
56 2 ▶sub sqlt_deploy_hook {
Subroutine sqlt_deploy_hook: called CC=1 SCAR=0.0
Pod documented
57 2 my ($self, $sqlt_table) = @_;
58
59 2 $sqlt_table->options({ENGINE => 'InnoDB'});
60 2 $sqlt_table->options({CHARSET => 'UTF8'});
61 2 $sqlt_table->comments('Every item a character has in storage.');
62 }
63  
64 3 1;
65  
66 __END__
« RCP/Database/Result/CharacterCurrency.pm ↑ Summary RCP/Database/Result/CharacterMove.pm »