| 1 | package Bracket::Schema::Result::Player; | ||
| 2 | |||
| 3 | # Created by DBIx::Class::Schema::Loader | ||
| 4 | # DO NOT MODIFY THE FIRST PART OF THIS FILE | ||
| 5 | |||
| 6 | 4 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 4 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 4 | ▶ | use base 'DBIx::Class::Core'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | |||
| 12 | =head1 NAME | ||
| 13 | |||
| 14 | Bracket::Schema::Result::Player | ||
| 15 | |||
| 16 | =cut | ||
| 17 | |||
| 18 | 4 | __PACKAGE__->table("player"); | |
| 19 | |||
| 20 | =head1 ACCESSORS | ||
| 21 | |||
| 22 | =head2 id | ||
| 23 | |||
| 24 | data_type: INT | ||
| 25 | default_value: undef | ||
| 26 | is_auto_increment: 1 | ||
| 27 | is_nullable: 0 | ||
| 28 | size: 11 | ||
| 29 | |||
| 30 | =head2 username | ||
| 31 | |||
| 32 | data_type: VARCHAR | ||
| 33 | default_value: undef | ||
| 34 | is_nullable: 1 | ||
| 35 | size: 64 | ||
| 36 | |||
| 37 | =head2 password | ||
| 38 | |||
| 39 | data_type: TEXT | ||
| 40 | default_value: undef | ||
| 41 | is_nullable: 0 | ||
| 42 | size: 65535 | ||
| 43 | |||
| 44 | =head2 first_name | ||
| 45 | |||
| 46 | data_type: VARCHAR | ||
| 47 | default_value: undef | ||
| 48 | is_nullable: 0 | ||
| 49 | size: 16 | ||
| 50 | |||
| 51 | =head2 last_name | ||
| 52 | |||
| 53 | data_type: VARCHAR | ||
| 54 | default_value: undef | ||
| 55 | is_nullable: 0 | ||
| 56 | size: 16 | ||
| 57 | |||
| 58 | =head2 email | ||
| 59 | |||
| 60 | data_type: VARCHAR | ||
| 61 | default_value: undef | ||
| 62 | is_nullable: 0 | ||
| 63 | size: 64 | ||
| 64 | |||
| 65 | =head2 active | ||
| 66 | |||
| 67 | data_type: INT | ||
| 68 | default_value: 1 | ||
| 69 | is_nullable: 0 | ||
| 70 | size: 1 | ||
| 71 | |||
| 72 | =head2 points | ||
| 73 | |||
| 74 | data_type: MEDIUMINT | ||
| 75 | default_value: 0 | ||
| 76 | is_nullable: 0 | ||
| 77 | size: 9 | ||
| 78 | |||
| 79 | =cut | ||
| 80 | |||
| 81 | 4 | __PACKAGE__->add_columns( | |
| 82 | "id", | ||
| 83 | { | ||
| 84 | data_type => "INT", | ||
| 85 | default_value => undef, | ||
| 86 | is_auto_increment => 1, | ||
| 87 | is_nullable => 0, | ||
| 88 | size => 11, | ||
| 89 | }, | ||
| 90 | "username", | ||
| 91 | { | ||
| 92 | data_type => "VARCHAR", | ||
| 93 | default_value => undef, | ||
| 94 | is_nullable => 1, | ||
| 95 | size => 64, | ||
| 96 | }, | ||
| 97 | "password", | ||
| 98 | { | ||
| 99 | data_type => "TEXT", | ||
| 100 | default_value => undef, | ||
| 101 | is_nullable => 0, | ||
| 102 | size => 65535, | ||
| 103 | }, | ||
| 104 | "first_name", | ||
| 105 | { | ||
| 106 | data_type => "VARCHAR", | ||
| 107 | default_value => undef, | ||
| 108 | is_nullable => 0, | ||
| 109 | size => 16, | ||
| 110 | }, | ||
| 111 | "last_name", | ||
| 112 | { | ||
| 113 | data_type => "VARCHAR", | ||
| 114 | default_value => undef, | ||
| 115 | is_nullable => 0, | ||
| 116 | size => 16, | ||
| 117 | }, | ||
| 118 | "email", | ||
| 119 | { | ||
| 120 | data_type => "VARCHAR", | ||
| 121 | default_value => undef, | ||
| 122 | is_nullable => 0, | ||
| 123 | size => 64, | ||
| 124 | }, | ||
| 125 | "active", | ||
| 126 | { data_type => "INT", default_value => 1, is_nullable => 0, size => 1 }, | ||
| 127 | "points", | ||
| 128 | { data_type => "MEDIUMINT", default_value => 0, is_nullable => 0, size => 9 }, | ||
| 129 | ); | ||
| 130 | 4 | __PACKAGE__->set_primary_key("id"); | |
| 131 | 4 | __PACKAGE__->add_unique_constraint("player_email", ["email"]); | |
| 132 | |||
| 133 | =head1 RELATIONS | ||
| 134 | |||
| 135 | =head2 picks | ||
| 136 | |||
| 137 | Type: has_many | ||
| 138 | |||
| 139 | Related object: L<Bracket::Schema::Result::Pick> | ||
| 140 | |||
| 141 | =cut | ||
| 142 | |||
| 143 | 4 | __PACKAGE__->has_many( | |
| 144 | "picks", | ||
| 145 | "Bracket::Schema::Result::Pick", | ||
| 146 | { "foreign.player" => "self.id" }, | ||
| 147 | ); | ||
| 148 | |||
| 149 | =head2 player_roles | ||
| 150 | |||
| 151 | Type: has_many | ||
| 152 | |||
| 153 | Related object: L<Bracket::Schema::Result::PlayerRole> | ||
| 154 | |||
| 155 | =cut | ||
| 156 | |||
| 157 | 4 | __PACKAGE__->has_many( | |
| 158 | "player_roles", | ||
| 159 | "Bracket::Schema::Result::PlayerRole", | ||
| 160 | { "foreign.player" => "self.id" }, | ||
| 161 | ); | ||
| 162 | |||
| 163 | =head2 region_scores | ||
| 164 | |||
| 165 | Type: has_many | ||
| 166 | |||
| 167 | Related object: L<Bracket::Schema::Result::RegionScore> | ||
| 168 | |||
| 169 | =cut | ||
| 170 | |||
| 171 | 4 | __PACKAGE__->has_many( | |
| 172 | "region_scores", | ||
| 173 | "Bracket::Schema::Result::RegionScore", | ||
| 174 | { "foreign.player" => "self.id" }, | ||
| 175 | ); | ||
| 176 | |||
| 177 | =head2 tokens | ||
| 178 | |||
| 179 | Type: has_many | ||
| 180 | |||
| 181 | Related object: L<Bracket::Schema::Result::Token> | ||
| 182 | |||
| 183 | =cut | ||
| 184 | |||
| 185 | 4 | __PACKAGE__->has_many( | |
| 186 | "tokens", | ||
| 187 | "Bracket::Schema::Result::Token", | ||
| 188 | { "foreign.player" => "self.id" }, | ||
| 189 | ); | ||
| 190 | |||
| 191 | |||
| 192 | # Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-03-15 11:45:32 | ||
| 193 | # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:R91hdhwccshwCohquahcNw | ||
| 194 | |||
| 195 | |||
| 196 | # You can replace this text with custom content, and it will be preserved on regeneration | ||
| 197 | 4 | __PACKAGE__->load_components(qw/ EncodedColumn /); | |
| 198 | 4 | __PACKAGE__->add_columns( | |
| 199 | "password", { | ||
| 200 | encode_column => 1, | ||
| 201 | # encode_class => 'Digest', | ||
| 202 | # encode_args => { algorithm => 'SHA-256', format => 'base64' }, | ||
| 203 | # encode_check_method => 'check_password', | ||
| 204 | encode_class => 'Crypt::Eksblowfish::Bcrypt', | ||
| 205 | encode_args => { key_nul => 0, cost => 8 }, | ||
| 206 | encode_check_method => 'check_password', | ||
| 207 | # For some reason deploy() wasn't picking up the type or size | ||
| 208 | # so we set it here again. | ||
| 209 | data_type => 'VARCHAR', | ||
| 210 | size => 256, | ||
| 211 | } | ||
| 212 | ); | ||
| 213 | =head2 player_roles | ||
| 214 | |||
| 215 | Type: has_many | ||
| 216 | Related object: L<Bracket::Schema::Result::PlayerRole> | ||
| 217 | |||
| 218 | =cut | ||
| 219 | |||
| 220 | 4 | __PACKAGE__->has_many( | |
| 221 | "player_roles", | ||
| 222 | "Bracket::Schema::Result::PlayerRole", | ||
| 223 | { "foreign.player" => "self.id" }, | ||
| 224 | ); | ||
| 225 | |||
| 226 | =head2 roles | ||
| 227 | |||
| 228 | Relationship bridge across PlayerRole to Role | ||
| 229 | |||
| 230 | =cut | ||
| 231 | |||
| 232 | 4 | __PACKAGE__->many_to_many('roles', 'player_roles', 'role'); | |
| 233 | 4 | 1; | |