| 1 | package Games::Framework::RCP::Database::Result::FloorItem; | ||
| 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('floor_items'); | |
| 13 | 3 | __PACKAGE__->add_columns( | |
| 14 | id_floor_item => { | ||
| 15 | data_type => 'integer', | ||
| 16 | is_nullable => 0, | ||
| 17 | is_auto_increment => 1, | ||
| 18 | comments => 'ID of the floor item.', | ||
| 19 | extra => {unsigned => 1}, | ||
| 20 | }, | ||
| 21 | fkey_item => { | ||
| 22 | data_type => 'integer', | ||
| 23 | is_nullable => 0, | ||
| 24 | comments => 'ID of the item.', | ||
| 25 | extra => {unsigned => 1}, | ||
| 26 | }, | ||
| 27 | display_name => { | ||
| 28 | data_type => 'varchar', | ||
| 29 | size => 64, | ||
| 30 | is_nullable => 1, | ||
| 31 | default_value => undef, | ||
| 32 | comments => 'Publically displayed name of the item.', | ||
| 33 | }, | ||
| 34 | ammo => { | ||
| 35 | data_type => 'integer', | ||
| 36 | is_nullable => 1, | ||
| 37 | default_value => 1, | ||
| 38 | comments => 'How much of this item is available?', | ||
| 39 | }, | ||
| 40 | ); | ||
| 41 | |||
| 42 | 3 | __PACKAGE__->utf8_columns(qw/display_name/); | |
| 43 | |||
| 44 | 3 | __PACKAGE__->set_primary_key('id_floor_item'); | |
| 45 | |||
| 46 | 3 | __PACKAGE__->belongs_to(items => 'Games::Framework::RCP::Database::Result::Item', 'fkey_item'); | |
| 47 | |||
| 48 | 2 | ▶ | sub sqlt_deploy_hook { |
|
Subroutine
sqlt_deploy_hook: called CC=1 SCAR=0.0
Pod
documented
| |||
| 49 | 2 | my ($self, $sqlt_table) = @_; | |
| 50 | |||
| 51 | 2 | $sqlt_table->options({ENGINE => 'InnoDB'}); | |
| 52 | 2 | $sqlt_table->options({CHARSET => 'UTF8'}); | |
| 53 | 2 | $sqlt_table->comments('All items dropped onto the arena floor.'); | |
| 54 | } | ||
| 55 | |||
| 56 | 3 | 1; | |
| 57 | |||
| 58 | __END__ | ||