RCP/Database/Result/CombatantEquipHistory.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/CombatantCurrency.pm ↑ Summary RCP/Database/Result/CombatantInventory.pm »
1 package Games::Framework::RCP::Database::Result::CombatantEquipHistory;
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/Core/);
12 3 __PACKAGE__->table('combatant_equip_history');
13 3 __PACKAGE__->add_columns(
14 id_combatant_equip_history => {
15 data_type => 'integer',
16 is_nullable => 0,
17 is_auto_increment => 1,
18 comments => 'ID of the combatant / item combination.',
19 extra => {unsigned => 1},
20 },
21 fkey_combatant => {
22 data_type => 'integer',
23 is_nullable => 0,
24 comments => 'ID of the combatant.',
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 equip_time => {
34 data_type => 'datetime',
35 is_nullable => 0,
36 default_value => 'now()',
37 comments => 'Time the item was used ont he combatant.',
38 },
39 fight_length => {
40 data_type => 'integer',
41 is_nullable => 1,
42 comments => 'How far in the battle when the item was equipped.',
43 },
44 );
45  
46 3 __PACKAGE__->set_primary_key('id_combatant_equip_history');
47  
48 3 __PACKAGE__->add_unique_constraint([qw/fkey_combatant fkey_item equip_time/]);
49  
50 3 __PACKAGE__->belongs_to(items => 'Games::Framework::RCP::Database::Result::Item', 'fkey_item');
51  
52 3 __PACKAGE__->belongs_to(combatants => 'Games::Framework::RCP::Database::Result::Combatant', 'fkey_combatant');
53  
54 2 ▶sub sqlt_deploy_hook {
Subroutine sqlt_deploy_hook: called CC=1 SCAR=0.0
Pod documented
55 2 my ($self, $sqlt_table) = @_;
56
57 2 $sqlt_table->options({ENGINE => 'InnoDB'});
58 2 $sqlt_table->options({CHARSET => 'UTF8'});
59 2 $sqlt_table->comments('A history of every item equipped in the battle.');
60 }
61  
62 3 1;
63  
64 __END__
« RCP/Database/Result/CombatantCurrency.pm ↑ Summary RCP/Database/Result/CombatantInventory.pm »