| 1 | package Games::Framework::RCP::Database::Result::MoveType; | ||
| 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('move_types'); | |
| 12 | 3 | __PACKAGE__->add_columns( | |
| 13 | id_move_type => { | ||
| 14 | data_type => 'integer', | ||
| 15 | is_nullable => 0, | ||
| 16 | is_auto_increment => 1, | ||
| 17 | comments => 'ID of the move type.', | ||
| 18 | extra => {unsigned => 1}, | ||
| 19 | }, | ||
| 20 | name => { | ||
| 21 | data_type => 'varchar', | ||
| 22 | size => 32, | ||
| 23 | is_nullable => 0, | ||
| 24 | comments => 'Name of the move type.', | ||
| 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 move type.', | ||
| 37 | }, | ||
| 38 | ); | ||
| 39 | |||
| 40 | 3 | __PACKAGE__->utf8_columns(qw/name description/); | |
| 41 | 3 | __PACKAGE__->set_primary_key('id_move_type'); | |
| 42 | 3 | __PACKAGE__->add_unique_constraint(['name']); | |
| 43 | 3 | __PACKAGE__->has_one(move => 'Games::Framework::RCP::Database::Result::Move', 'fkey_move_type'); | |
| 44 | 3 | __PACKAGE__->belongs_to(color => 'Games::Framework::RCP::Database::Result::Color', 'fkey_color'); | |
| 45 | |||
| 46 | 2 | ▶ | sub sqlt_deploy_hook { |
|
Subroutine
sqlt_deploy_hook: called CC=1 SCAR=0.0
Pod
documented
| |||
| 47 | 2 | my ($self, $sqlt_table) = @_; | |
| 48 | |||
| 49 | 2 | $sqlt_table->options({ENGINE => 'InnoDB'}); | |
| 50 | 2 | $sqlt_table->options({CHARSET => 'UTF8'}); | |
| 51 | 2 | $sqlt_table->comments('The different move types available.'); | |
| 52 | } | ||
| 53 | |||
| 54 | 3 | 1; | |
| 55 | |||
| 56 | __END__ | ||