RCP/Database/Result/Currency.pm

filter: Statementstmt 100% 26 / 26 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 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/CombinedItem.pm ↑ Summary RCP/Database/Result/FloorItem.pm »
1 package Games::Framework::RCP::Database::Result::Currency;
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('currency');
12 3 __PACKAGE__->add_columns(
13 id_currency => {
14 data_type => 'integer',
15 is_nullable => 0,
16 is_auto_increment => 1,
17 comments => 'ID of the currency.',
18 extra => {unsigned => 1},
19 },
20 name => {
21 data_type => 'varchar',
22 size => 32,
23 is_nullable => 0,
24 comments => 'Name of the currency.',
25 },
26 fkey_color => {
27 data_type => 'integer',
28 is_nullable => 1,
29 comments => 'ID of the color set.',
30 extra => {unsigned => 1},
31 },
32 description => {
33 data_type => 'varchar',
34 size => 256,
35 is_nullable => 1,
36 comments => 'Description of the currency.',
37 },
38 );
39  
40 3 __PACKAGE__->utf8_columns(qw/name description/);
41 3 __PACKAGE__->set_primary_key('id_currency');
42 3 __PACKAGE__->add_unique_constraint(['name']);
43  
44 3 __PACKAGE__->has_many(currency => 'Games::Framework::RCP::Database::Result::CharacterCurrency', 'fkey_currency');
45 3 __PACKAGE__->many_to_many(characters => 'currency', 'character');
46  
47 3 __PACKAGE__->has_many(currency => 'Games::Framework::RCP::Database::Result::CombatantCurrency', 'fkey_currency');
48 3 __PACKAGE__->many_to_many(combatants => 'currency', 'combatant');
49  
50 3 __PACKAGE__->belongs_to(color => 'Games::Framework::RCP::Database::Result::Color', 'fkey_color');
51  
52 2 ▶sub sqlt_deploy_hook {
Subroutine sqlt_deploy_hook: called CC=1 SCAR=0.0
Pod documented
53 2 my ($self, $sqlt_table) = @_;
54
55 2 $sqlt_table->options({ENGINE => 'InnoDB'});
56 2 $sqlt_table->options({CHARSET => 'UTF8'});
57 2 $sqlt_table->comments('The different currencies available.');
58 }
59  
60 3 1;
61  
62 __END__
« RCP/Database/Result/CombinedItem.pm ↑ Summary RCP/Database/Result/FloorItem.pm »