RCP/Database/Result/ItemStat.pm

filter: Statementstmt 100% 23 / 23 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 100% 1 / 1 totaltotal 100% 28 / 28 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« RCP/Database/Result/ItemCategory.pm ↑ Summary RCP/Database/Result/ItemUsage.pm »
1 package Games::Framework::RCP::Database::Result::ItemStat;
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  
6 3 our $VERSION = '0.22';
7  
8 3 ▶use base qw/DBIx::Class/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 3 __PACKAGE__->load_components(qw/UTF8Columns Core/);
11 3 __PACKAGE__->table('item_stats');
12 3 __PACKAGE__->add_columns(
13 id_item_stat => {
14 data_type => 'integer',
15 is_nullable => 0,
16 is_auto_increment => 1,
17 comments => 'ID of the item stat modifier.',
18 extra => {unsigned => 1},
19 },
20 name => {
21 data_type => 'varchar',
22 size => 32,
23 is_nullable => 0,
24 comments => 'Name of the stat to modify. Usually is a column in the combatants table.',
25 },
26 description => {
27 data_type => 'varchar',
28 size => 256,
29 is_nullable => 1,
30 comments => 'Description of the stat to modify: meant for private.',
31 }
32 );
33  
34 3 __PACKAGE__->utf8_columns(qw/name description/);
35 3 __PACKAGE__->set_primary_key('id_item_stat');
36 3 __PACKAGE__->add_unique_constraint(['name']);
37 3 __PACKAGE__->has_many(items_with_stats => 'Games::Framework::RCP::Database::Result::ItemWithStat', 'fkey_item_stat');
38 3 __PACKAGE__->many_to_many(items => 'items_with_stats', 'item_stats');
39  
40 2 ▶sub sqlt_deploy_hook {
Subroutine sqlt_deploy_hook: called CC=1 SCAR=0.0
Pod documented
41 2 my ($self, $sqlt_table) = @_;
42
43 2 $sqlt_table->options({ENGINE => 'InnoDB'});
44 2 $sqlt_table->options({CHARSET => 'UTF8'});
45 2 $sqlt_table->comments('The list of the various stats that items can modify when used.');
46 }
47  
48 3 1;
49  
50 __END__
« RCP/Database/Result/ItemCategory.pm ↑ Summary RCP/Database/Result/ItemUsage.pm »