| 1 | package Games::Framework::RCP::Database::Result::CharacterMove; | ||
| 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('character_moves'); | |
| 12 | 3 | __PACKAGE__->add_columns( | |
| 13 | id_character_move => { | ||
| 14 | data_type => 'integer', | ||
| 15 | is_nullable => 0, | ||
| 16 | is_auto_increment => 1, | ||
| 17 | comments => 'ID of the character move recorded.', | ||
| 18 | extra => {unsigned => 1}, | ||
| 19 | }, | ||
| 20 | fkey_character => { | ||
| 21 | data_type => 'integer', | ||
| 22 | is_nullable => 0, | ||
| 23 | comments => 'ID of the character.', | ||
| 24 | extra => {unsigned => 1}, | ||
| 25 | }, | ||
| 26 | fkey_class => { | ||
| 27 | data_type => 'integer', | ||
| 28 | is_nullable => 1, | ||
| 29 | comments => 'ID of the class the move belongs to.', | ||
| 30 | extra => {unsigned => 1}, | ||
| 31 | }, | ||
| 32 | fkey_move => { | ||
| 33 | data_type => 'integer', | ||
| 34 | is_nullable => 0, | ||
| 35 | comments => 'ID of the move.', | ||
| 36 | extra => {unsigned => 1}, | ||
| 37 | }, | ||
| 38 | ); | ||
| 39 | |||
| 40 | 3 | __PACKAGE__->set_primary_key('id_character_move'); | |
| 41 | 3 | __PACKAGE__->add_unique_constraint([qw/fkey_character fkey_class fkey_move/]); | |
| 42 | |||
| 43 | 3 | __PACKAGE__->belongs_to(characters => 'Games::Framework::RCP::Database::Result::Character', 'fkey_character'); | |
| 44 | |||
| 45 | 3 | __PACKAGE__->belongs_to(classes => 'Games::Framework::RCP::Database::Result::Class', 'fkey_class'); | |
| 46 | |||
| 47 | 3 | __PACKAGE__->belongs_to(moves => 'Games::Framework::RCP::Database::Result::Move', 'fkey_move'); | |
| 48 | |||
| 49 | 2 | ▶ | sub sqlt_deploy_hook { |
|
Subroutine
sqlt_deploy_hook: called CC=1 SCAR=0.0
Pod
documented
| |||
| 50 | 2 | my ($self, $sqlt_table) = @_; | |
| 51 | |||
| 52 | 2 | $sqlt_table->options({ENGINE => 'InnoDB'}); | |
| 53 | 2 | $sqlt_table->options({CHARSET => 'UTF8'}); | |
| 54 | 2 | $sqlt_table->comments('All of the moves that every character knows.'); | |
| 55 | } | ||
| 56 | |||
| 57 | 3 | 1; | |
| 58 | |||
| 59 | __END__ | ||