lib/Bracket/Schema.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 87.1% 27 / 31 CC 2 SCAR 2.9
CC
2
Cov
96%
create_initial_data
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« script/deploy_new_year_bracket.pl ↑ Summary lib/Bracket/Form/Register.pm »
1 package Bracket::Schema;
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::Schema';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 4 __PACKAGE__->load_namespaces(result_namespace => 'Result',);
12  
13 # Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-28 11:54:30
14 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9Mvnns/DJ5m0MpQNixu/qQ
15  
16 # You can replace this text with custom content, and it will be preserved on regeneration
17  
18 sub create_initial_data {
19 1 ▶ my ($schema, $config, $custom_values) = @_;
Subroutine create_initial_data: called CC=2 SCAR=7.0
Pod undocumented
20  
21 1 ▶ $custom_values ||= {
Condition50%1/2
$custom_values ||= {"admin_first_name", "Admin", "admin_last_name", "User", "admin_email", "admin\@localhost.org", "admin_password", "admin"}
l!l
01
MC/DC0%0/1
$custom_values ||= {"admin_first_name", "Admin", "admin_last_name", "User", "admin_email", "admin\@localhost.org", "admin_password", "admin"}
$custom_values
Truth table50%1/2
A
A= $custom_values
Aresult
11
00
22 admin_first_name => 'Admin',
23 admin_last_name => 'User',
24 admin_email => "admin\@localhost.org",
25 admin_password => 'admin',
26 };
27  
28 my @players = $schema->populate(
29 'Player',
30 [
31 [qw/ email password first_name last_name /],
32 [ 'no-reply@huntana.com', 'unknown', 'Perfect', 'Player', ],
33 [
34 $custom_values->{admin_email}, $custom_values->{admin_password},
35 $custom_values->{admin_first_name}, $custom_values->{admin_last_name},
36 1 ],
37 ]
38 );
39  
40 1 my @roles = $schema->populate('Role', [ [qw/ role /], ['admin'], ['basic'] ]);
41  
42 # Set admin account up with admin role. admins are able to edit the
43 # perfect bracket among other things.
44 1 my @player_roles =
45 $schema->populate('PlayerRole',
46 [ [qw/role player/], [ $roles[0]->id, $players[1]->id ], ]);
47
48 1 create_new_year_data($schema);
49 }
50  
51 sub create_new_year_data {
52 1 ▶ my ($schema,) = @_;
Subroutine create_new_year_data: called CC=1 SCAR=0.0
Pod undocumented
53  
54 # Regions
55 1 my @regions = $schema->populate(
56 'Region',
57 [
58 [qw/ id name /],
59 [ 1, 'South' ],
60 [ 2, 'West' ],
61 [ 3, 'East' ],
62 [ 4, 'Midwest' ],
63 ]
64 );
65  
66 # Teams
67 1 my @teams = $schema->populate(
68 'Team',
69 [
70 [qw/ id seed name region /],
71 [ 1, 1, 'Kansas', 1 ],
72 [ 2, 16, 'Austin Peay', 1 ],
73 [ 3, 8, 'Colorado', 1 ],
74 [ 4, 9, 'Connecticut', 1 ],
75 [ 5, 5, 'Maryland', 1 ],
76 [ 6, 12, 'South Dakota St.', 1 ],
77 [ 7, 4, 'California', 1 ],
78 [ 8, 13, 'Hawaii', 1 ],
79 [ 9, 6, 'Arizona', 1 ],
80 [ 10, 11, 'Vanderbilt/Wichita St.', 1 ],
81 [ 11, 3, 'Miami', 1 ],
82 [ 12, 14, 'Buffalo', 1 ],
83 [ 13, 7, 'Iowa', 1 ],
84 [ 14, 10, 'Temple', 1 ],
85 [ 15, 2, 'Villanova', 1 ],
86 [ 16, 15, 'UNC Asheville', 1 ],
87  
88 [ 17, 1, 'Oregon', 2 ],
89 [ 18, 16, 'Holy Cross/Southern', 2 ],
90 [ 19, 8, "Saint Joseph's", 2 ],
91 [ 20, 9, 'Cinci', 2 ],
92 [ 21, 5, 'Baylor', 2 ],
93 [ 22, 12, 'Yale', 2 ],
94 [ 23, 4, 'Duke', 2 ],
95 [ 24, 13, 'UNC Wilm.', 2 ],
96 [ 25, 6, 'Texas', 2 ],
97 [ 26, 11, 'Northern Iowa', 2 ],
98 [ 27, 3, 'Texas A&M', 2 ],
99 [ 28, 14, 'Green Bay', 2 ],
100 [ 29, 7, 'Oregon St.', 2 ],
101 [ 30, 10, 'Virginia Commonwealth', 2 ],
102 [ 31, 2, 'Oklahoma', 2 ],
103 [ 32, 15, 'Cal St. Bakersfield', 2 ],
104  
105 [ 33, 1, 'North Carolina', 3 ],
106 [ 34, 16, 'FGCU/Fairleigh Dickinson', 3 ],
107 [ 35, 8, 'USC', 3 ],
108 [ 36, 9, 'Providence', 3 ],
109 [ 37, 5, 'Indiana', 3 ],
110 [ 38, 12, 'Chattanooga', 3 ],
111 [ 39, 4, 'Kentucky', 3 ],
112 [ 40, 13, 'Stony Brook', 3 ],
113 [ 41, 6, 'Notre Dame', 3 ],
114 [ 42, 11, 'Michigan/Tulsa', 3 ],
115 [ 43, 3, 'West Virginia', 3 ],
116 [ 44, 14, 'Stephen F. Austin', 3 ],
117 [ 45, 7, 'Wisconsin', 3 ],
118 [ 46, 10, 'Pittsburgh', 3 ],
119 [ 47, 2, 'Xavier', 3 ],
120 [ 48, 15, 'Weber St.', 3 ],
121  
122 [ 49, 1, 'Virginia', 4 ],
123 [ 50, 16, 'Hampton', 4 ],
124 [ 51, 8, 'Texas Tech', 4 ],
125 [ 52, 9, 'Butler', 4 ],
126 [ 53, 5, 'Purdue', 4 ],
127 [ 54, 12, 'Little Rock', 4 ],
128 [ 55, 4, 'Iowa St.', 4 ],
129 [ 56, 13, 'Iona', 4 ],
130 [ 57, 6, 'Seton Hall', 4 ],
131 [ 58, 11, 'Gonzaga', 4 ],
132 [ 59, 3, 'Utah', 4 ],
133 [ 60, 14, 'Fresno St.', 4 ],
134 [ 61, 7, "Dayton", 4 ],
135 [ 62, 10, 'Syracuse', 4 ],
136 [ 63, 2, 'Michigan St.', 4 ],
137 [ 64, 15, 'Middle Tenn.', 4 ],
138 ]
139 );
140  
141 # Games
142 1 my @games = $schema->populate(
143 'Game',
144 [
145 [qw/ id round /],
146 [ 1, 1 ],
147 [ 2, 1 ],
148 [ 3, 1 ],
149 [ 4, 1 ],
150 [ 5, 1 ],
151 [ 6, 1 ],
152 [ 7, 1 ],
153 [ 8, 1 ],
154 [ 9, 2 ],
155 [ 10, 2 ],
156 [ 11, 2 ],
157 [ 12, 2 ],
158 [ 13, 3 ],
159 [ 14, 3 ],
160 [ 15, 4 ],
161 [ 16, 1 ],
162 [ 17, 1 ],
163 [ 18, 1 ],
164 [ 19, 1 ],
165 [ 20, 1 ],
166 [ 21, 1 ],
167 [ 22, 1 ],
168 [ 23, 1 ],
169 [ 24, 2 ],
170 [ 25, 2 ],
171 [ 26, 2 ],
172 [ 27, 2 ],
173 [ 28, 3 ],
174 [ 29, 3 ],
175 [ 30, 4 ],
176 [ 31, 1 ],
177 [ 32, 1 ],
178 [ 33, 1 ],
179 [ 34, 1 ],
180 [ 35, 1 ],
181 [ 36, 1 ],
182 [ 37, 1 ],
183 [ 38, 1 ],
184 [ 39, 2 ],
185 [ 40, 2 ],
186 [ 41, 2 ],
187 [ 42, 2 ],
188 [ 43, 3 ],
189 [ 44, 3 ],
190 [ 45, 4 ],
191 [ 46, 1 ],
192 [ 47, 1 ],
193 [ 48, 1 ],
194 [ 49, 1 ],
195 [ 50, 1 ],
196 [ 51, 1 ],
197 [ 52, 1 ],
198 [ 53, 1 ],
199 [ 54, 2 ],
200 [ 55, 2 ],
201 [ 56, 2 ],
202 [ 57, 2 ],
203 [ 58, 3 ],
204 [ 59, 3 ],
205 [ 60, 4 ],
206 [ 61, 5 ],
207 [ 62, 5 ],
208 [ 63, 6 ],
209 ]
210 );
211 }
212  
213 4 1
214  
215 __END__
216 # 2014 data
217 my @teams = $schema->populate(
218 'Team',
219 [
220 [qw/ id seed name region /],
221 [ 1, 1, 'Florida', 1 ],
222 [ 2, 16, 'Play-in', 1 ],
223 [ 3, 8, 'Colorado', 1 ],
224 [ 4, 9, 'Pittsburgh', 1 ],
225 [ 5, 5, 'VCU', 1 ],
226 [ 6, 12, 'SF Austin', 1 ],
227 [ 7, 4, 'UCLA', 1 ],
228 [ 8, 13, 'Tulsa', 1 ],
229 [ 9, 6, 'Ohio St', 1 ],
230 [ 10, 11, 'Dayton', 1 ],
231 [ 11, 3, 'Syracuse.', 1 ],
232 [ 12, 14, 'W. Michigan', 1 ],
233 [ 13, 7, 'New Mexico', 1 ],
234 [ 14, 10, 'Stanford', 1 ],
235 [ 15, 2, 'Kansas', 1 ],
236 [ 16, 15, 'Eastern KY', 1 ],
237  
238 [ 17, 1, 'Virginia', 2 ],
239 [ 18, 16, 'Coastal Carolina', 2 ],
240 [ 19, 8, 'Memphis', 2 ],
241 [ 20, 9, 'Geo. Wash.', 2 ],
242 [ 21, 5, 'Cincinnati', 2 ],
243 [ 22, 12, 'Harvard', 2 ],
244 [ 23, 4, 'Michigan St.', 2 ],
245 [ 24, 13, 'Delaware', 2 ],
246 [ 25, 6, 'North Carolina', 2 ],
247 [ 26, 11, 'Providence', 2 ],
248 [ 27, 3, 'Iowa St.', 2 ],
249 [ 28, 14, 'N.C. Central', 2 ],
250 [ 29, 7, 'Connecticut', 2 ],
251 [ 30, 10, 'Saint Joseph', 2 ],
252 [ 31, 2, 'Villanova', 2 ],
253 [ 32, 15, 'UW Milwaukee', 2 ],
254  
255 [ 33, 1, 'Arizona', 3 ],
256 [ 34, 16, 'Weber St.', 3 ],
257 [ 35, 8, 'Gonzaga', 3 ],
258 [ 36, 9, 'Oklahoma St.', 3 ],
259 [ 37, 5, 'Oklahoma', 3 ],
260 [ 38, 12, 'North Dakota St.', 3 ],
261 [ 39, 4, 'San Diego St.', 3 ],
262 [ 40, 13, 'New Mexico St.', 3 ],
263 [ 41, 6, 'Baylor', 3 ],
264 [ 42, 11, 'Nebraska', 3 ],
265 [ 43, 3, 'Creighton', 3 ],
266 [ 44, 14, 'UL Layfayette', 3 ],
267 [ 45, 7, 'Oregon', 3 ],
268 [ 46, 10, 'BYU', 3 ],
269 [ 47, 2, 'Wisconsin', 3 ],
270 [ 48, 15, 'American', 3 ],
271  
272 [ 49, 1, 'Witchita St', 4 ],
273 [ 50, 16, 'Play-in', 4 ],
274 [ 51, 8, 'Kentucky', 4 ],
275 [ 52, 9, 'Kansas St.', 4 ],
276 [ 53, 5, 'Saint Louis', 4 ],
277 [ 54, 12, 'Play-in', 4 ],
278 [ 55, 4, 'Louisiville', 4 ],
279 [ 56, 13, 'Manhattan', 4 ],
280 [ 57, 6, 'UMass', 4 ],
281 [ 58, 11, 'Play-in', 4 ],
282 [ 59, 3, 'Duke', 4 ],
283 [ 60, 14, 'Mercer', 4 ],
284 [ 61, 7, "Texas", 4 ],
285 [ 62, 10, 'Arizona St.', 4 ],
286 [ 63, 2, 'Michigan', 4 ],
287 [ 64, 15, 'Wofford', 4 ],
288 ]
289 );
290 # 2010 data
291 # Regions
292 my @regions =
293 $schema->populate('Region',
294 [ [qw/ id name /], [ 1, 'Midwest' ], [ 2, 'West' ], [ 3, 'East' ], [ 4, 'South' ], ]);
295  
296 # Teams
297 my @teams = $schema->populate(
298 'Team',
299 [
300 [qw/ id seed name region /],
301 [ 1, 1, 'Kansas', 1 ],
302 [ 2, 16, 'Lehigh', 1 ],
303 [ 3, 8, 'UNLV', 1 ],
304 [ 4, 9, 'Northern Iowa', 1 ],
305 [ 5, 5, 'Michigan St.', 1 ],
306 [ 6, 12, 'New Mexico St.', 1 ],
307 [ 7, 4, 'Maryland', 1 ],
308 [ 8, 13, 'Houston', 1 ],
309 [ 9, 6, 'Tennessee', 1 ],
310 [ 10, 11, 'San Diego St.', 1 ],
311 [ 11, 3, 'Georgetown', 1 ],
312 [ 12, 14, 'Ohio', 1 ],
313 [ 13, 7, 'Oklahoma St.', 1 ],
314 [ 14, 10, 'Georgia Tech', 1 ],
315 [ 15, 2, 'Ohio St.', 1 ],
316 [ 16, 15, 'UCSB', 1 ],
317 [ 17, 1, 'Syracuse', 2 ],
318 [ 18, 16, 'Vermont', 2 ],
319 [ 19, 8, 'Gonzaga', 2 ],
320 [ 20, 9, 'Florida St.', 2 ],
321 [ 21, 5, 'Butler', 2 ],
322 [ 22, 12, 'UTEP', 2 ],
323 [ 23, 4, 'Vanderbilt', 2 ],
324 [ 24, 13, 'Murray St.', 2 ],
325 [ 25, 6, 'Xavier', 2 ],
326 [ 26, 11, 'Minnesota', 2 ],
327 [ 27, 3, 'Pittsburgh', 2 ],
328 [ 28, 14, 'Oakland', 2 ],
329 [ 29, 7, 'BYU', 2 ],
330 [ 30, 10, 'Florida', 2 ],
331 [ 31, 2, 'Kansas St.', 2 ],
332 [ 32, 15, 'North Texas', 2 ],
333 [ 33, 1, 'Kentucky', 3 ],
334 [ 34, 16, 'E. Tennessee St.', 3 ],
335 [ 35, 8, 'Texas', 3 ],
336 [ 36, 9, 'Wake Forest', 3 ],
337 [ 37, 5, 'Temple', 3 ],
338 [ 38, 12, 'Cornell', 3 ],
339 [ 39, 4, 'Wisconsin', 3 ],
340 [ 40, 13, 'Wofford', 3 ],
341 [ 41, 6, 'Marquette', 3 ],
342 [ 42, 11, 'Washington', 3 ],
343 [ 43, 3, 'New Mexico', 3 ],
344 [ 44, 14, 'Montana', 3 ],
345 [ 45, 7, 'Clemson', 3 ],
346 [ 46, 10, 'Missouri', 3 ],
347 [ 47, 2, 'West Virginia', 3 ],
348 [ 48, 15, 'Morgan St.', 3 ],
349 [ 49, 1, 'Duke', 4 ],
350 [ 50, 16, 'Ark-PB/Winthrop', 4 ],
351 [ 51, 8, 'California', 4 ],
352 [ 52, 9, 'Louisville', 4 ],
353 [ 53, 5, 'Texas A&M', 4 ],
354 [ 54, 12, 'Utah St.', 4 ],
355 [ 55, 4, 'Purdue', 4 ],
356 [ 56, 13, 'Siena', 4 ],
357 [ 57, 6, 'Notre Dame', 4 ],
358 [ 58, 11, 'Old Dominion', 4 ],
359 [ 59, 3, 'Baylor', 4 ],
360 [ 60, 14, 'Sam Houston St.', 4 ],
361 [ 61, 7, 'Richmond', 4 ],
362 [ 62, 10, "St. Mary's", 4 ],
363 [ 63, 2, 'Villanova', 4 ],
364 [ 64, 15, 'Robert Morris', 4 ],
365 ]
366 );
367  
368 # 2011 Data
369 my @regions = $schema->populate(
370 'Region',
371 [
372 [qw/ id name /],
373 [ 1, 'East' ],
374 [ 2, 'West' ],
375 [ 3, 'SouthWest' ],
376 [ 4, 'SouthEast' ],
377 ]
378 );
379  
380 # Teams
381 my @teams = $schema->populate(
382 'Team',
383 [
384 [qw/ id seed name region /],
385 [ 1, 1, 'Ohio St.', 1 ],
386 [ 2, 16, 'UTSA/Bama St', 1 ],
387 [ 3, 8, 'George Mason', 1 ],
388 [ 4, 9, 'Villanova', 1 ],
389 [ 5, 5, 'West Virginia', 1 ],
390 [ 6, 12, 'UAB/Clemson', 1 ],
391 [ 7, 4, 'Kentucky', 1 ],
392 [ 8, 13, 'Princeton', 1 ],
393 [ 9, 6, 'Xavier', 1 ],
394 [ 10, 11, 'Marquette', 1 ],
395 [ 11, 3, 'Syracuse', 1 ],
396 [ 12, 14, 'Indiana St.', 1 ],
397 [ 13, 7, 'Washington', 1 ],
398 [ 14, 10, 'Georgia', 1 ],
399 [ 15, 2, 'North Carolina', 1 ],
400 [ 16, 15, 'Long Island', 1 ],
401 [ 17, 1, 'Duke', 2 ],
402 [ 18, 16, 'Hampton', 2 ],
403 [ 19, 8, 'Michigan', 2 ],
404 [ 20, 9, 'Tennessee', 2 ],
405 [ 21, 5, 'Arizona', 2 ],
406 [ 22, 12, 'Memphis', 2 ],
407 [ 23, 4, 'Texas', 2 ],
408 [ 24, 13, 'Oakland', 2 ],
409 [ 25, 6, 'Cincinnati', 2 ],
410 [ 26, 11, 'Missouri', 2 ],
411 [ 27, 3, 'Connecticut', 2 ],
412 [ 28, 14, 'Bucknell', 2 ],
413 [ 29, 7, 'Temple', 2 ],
414 [ 30, 10, 'Penn St.', 2 ],
415 [ 31, 2, 'San Diego St.', 2 ],
416 [ 32, 15, 'No. Colorado', 2 ],
417 [ 33, 1, 'Kansas', 3 ],
418 [ 34, 16, 'Boston U.', 3 ],
419 [ 35, 8, 'UNLV', 3 ],
420 [ 36, 9, 'Illinois', 3 ],
421 [ 37, 5, 'Vanderbilt', 3 ],
422 [ 38, 12, 'Richmond', 3 ],
423 [ 39, 4, 'Louisville', 3 ],
424 [ 40, 13, 'Morehead St.', 3 ],
425 [ 41, 6, 'Georgetown', 3 ],
426 [ 42, 11, 'USC/VCU', 3 ],
427 [ 43, 3, 'Purdue', 3 ],
428 [ 44, 14, "St. Peter's", 3 ],
429 [ 45, 7, 'Texas A&M', 3 ],
430 [ 46, 10, 'Florida St.', 3 ],
431 [ 47, 2, 'Notre Dame', 3 ],
432 [ 48, 15, 'Akron', 3 ],
433 [ 49, 1, 'Pittsburgh', 4 ],
434 [ 50, 16, 'NC-Ash/Ark-LR', 4 ],
435 [ 51, 8, 'Butler', 4 ],
436 [ 52, 9, 'Old Dominion', 4 ],
437 [ 53, 5, 'Kansas St.', 4 ],
438 [ 54, 12, 'Utah St.', 4 ],
439 [ 55, 4, 'Wisconsin', 4 ],
440 [ 56, 13, 'Belmont', 4 ],
441 [ 57, 6, "St. John's", 4 ],
442 [ 58, 11, 'Gonzaga', 4 ],
443 [ 59, 3, 'BYU', 4 ],
444 [ 60, 14, 'Wofford', 4 ],
445 [ 61, 7, 'UCLA', 4 ],
446 [ 62, 10, "Michigan St.", 4 ],
447 [ 63, 2, 'Florida', 4 ],
448 [ 64, 15, 'UC Santa Barb.', 4 ],
449 ]
450 );
« script/deploy_new_year_bracket.pl ↑ Summary lib/Bracket/Form/Register.pm »