File Coverage

blib/lib/Bracket/Schema.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition 1 2 50.0
subroutine 5 5 100.0
pod 0 2 0.0
total 25 28 89.2


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