Skip to content
Browse files

2011 Teams loaded

  • Loading branch information...
1 parent 58fe232 commit 1eb7c33b0583eaf35c9714bafbfc91a47f83931d @mateu committed Mar 13, 2011
Showing with 174 additions and 89 deletions.
  1. +5 −5 INSTALL
  2. +2 −5 README
  3. +2 −2 bracket.conf
  4. +165 −77 lib/Bracket/Schema.pm
View
10 INSTALL
@@ -4,16 +4,16 @@
1. Create a database in MySQL or PostgreSQL (call it bracket_2010 if you like)
sql> create database bracket_2010
-1b. If your database fu sucks or is lazy use the SQLite which will
-create the DB for you and require not user/pass
+1b. If your database fu sucks or is lazy then use a SQLite database which will
+create the DB for you and does not require a user or password.
2. Edit bracket.conf to match your database and user/pass (SQLite users do nothing)
-3. Deploy the database, initialize it and create an admin user by running:
- script/deploy_bracket.pl
+3. Deploy the database, initialize it and create an admin user all in one by running:
+ script/deploy_bracket.pl
4. Start it up:
- script/bracket_server.pl
+ script/bracket_server.pl
For production you might want to configure a front-end sever (pimp #catalyst for help)
5. Login with your admin account at:
View
7 README
@@ -1,7 +1,4 @@
-perl Makefile.PL
-make test
-
-Then see INSTALL
-
Description: College Basketball Tournament Bracket Software.
Run your own bracket.
+
+See INSTALL for installation instructions.
View
4 bracket.conf
@@ -1,12 +1,12 @@
name Bracket
-year 2010
+year 2011
# Defaults to a SQLite database, but can be MySQL or PostgreSQL as well.
# You want this configuration to match your database before deploying
# so the deployment knows where to go and what DB account to us.
<Model::DBIC>
<connect_info>
- #dsn dbi:mysql:bracket_2010
+ #dsn dbi:mysql:bracket_2011
dsn dbi:SQLite:bracket.db
user db_user
View
242 lib/Bracket/Schema.pm
@@ -8,18 +8,15 @@ use warnings;
use base 'DBIx::Class::Schema';
-__PACKAGE__->load_namespaces(
- result_namespace => 'Result',
-);
-
+__PACKAGE__->load_namespaces( result_namespace => 'Result', );
# Created by DBIx::Class::Schema::Loader v0.05003 @ 2010-02-28 11:54:30
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9Mvnns/DJ5m0MpQNixu/qQ
# You can replace this text with custom content, and it will be preserved on regeneration
sub create_initial_data {
- my ($schema, $config, $custom_values) = @_;
+ my ( $schema, $config, $custom_values ) = @_;
$custom_values ||= {
admin_first_name => 'Admin',
@@ -34,93 +31,104 @@ sub create_initial_data {
[qw/ email password first_name last_name /],
[ 'no-reply@huntana', 'unknown', 'Perfect', 'Player', ],
[
- $custom_values->{admin_email}, $custom_values->{admin_password},
- $custom_values->{admin_first_name}, $custom_values->{admin_last_name},
+ $custom_values->{admin_email},
+ $custom_values->{admin_password},
+ $custom_values->{admin_first_name},
+ $custom_values->{admin_last_name},
],
]
);
- my @roles = $schema->populate('Role', [ [qw/ role /], ['admin'], ['basic'] ]);
+ my @roles =
+ $schema->populate( 'Role', [ [qw/ role /], ['admin'], ['basic'] ] );
- # Set admin account up with admin role. admins are able to edit the
+ # Set admin account up with admin role. admins are able to edit the
# perfect bracket among other things.
my @player_roles =
- $schema->populate('PlayerRole', [ [qw/role player/], [ $roles[0]->id, $players[1]->id ], ]);
+ $schema->populate( 'PlayerRole',
+ [ [qw/role player/], [ $roles[0]->id, $players[1]->id ], ] );
# Regions
- my @regions =
- $schema->populate('Region',
- [ [qw/ id name /], [ 1, 'Midwest' ], [ 2, 'West' ], [ 3, 'East' ], [ 4, 'South' ], ]);
+ my @regions = $schema->populate(
+ 'Region',
+ [
+ [qw/ id name /],
+ [ 1, 'East' ],
+ [ 2, 'West' ],
+ [ 3, 'SouthWest' ],
+ [ 4, 'SouthEast' ],
+ ]
+ );
# Teams
my @teams = $schema->populate(
'Team',
[
[qw/ id seed name region /],
- [ 1, 1, 'Kansas', 1 ],
- [ 2, 16, 'Lehigh', 1 ],
- [ 3, 8, 'UNLV', 1 ],
- [ 4, 9, 'Northern Iowa', 1 ],
- [ 5, 5, 'Michigan St.', 1 ],
- [ 6, 12, 'New Mexico St.', 1 ],
- [ 7, 4, 'Maryland', 1 ],
- [ 8, 13, 'Houston', 1 ],
- [ 9, 6, 'Tennessee', 1 ],
- [ 10, 11, 'San Diego St.', 1 ],
- [ 11, 3, 'Georgetown', 1 ],
- [ 12, 14, 'Ohio', 1 ],
- [ 13, 7, 'Oklahoma St.', 1 ],
- [ 14, 10, 'Georgia Tech', 1 ],
- [ 15, 2, 'Ohio St.', 1 ],
- [ 16, 15, 'UCSB', 1 ],
- [ 17, 1, 'Syracuse', 2 ],
- [ 18, 16, 'Vermont', 2 ],
- [ 19, 8, 'Gonzaga', 2 ],
- [ 20, 9, 'Florida St.', 2 ],
- [ 21, 5, 'Butler', 2 ],
- [ 22, 12, 'UTEP', 2 ],
- [ 23, 4, 'Vanderbilt', 2 ],
- [ 24, 13, 'Murray St.', 2 ],
- [ 25, 6, 'Xavier', 2 ],
- [ 26, 11, 'Minnesota', 2 ],
- [ 27, 3, 'Pittsburgh', 2 ],
- [ 28, 14, 'Oakland', 2 ],
- [ 29, 7, 'BYU', 2 ],
- [ 30, 10, 'Florida', 2 ],
- [ 31, 2, 'Kansas St.', 2 ],
- [ 32, 15, 'North Texas', 2 ],
- [ 33, 1, 'Kentucky', 3 ],
- [ 34, 16, 'E. Tennessee St.', 3 ],
- [ 35, 8, 'Texas', 3 ],
- [ 36, 9, 'Wake Forest', 3 ],
- [ 37, 5, 'Temple', 3 ],
- [ 38, 12, 'Cornell', 3 ],
- [ 39, 4, 'Wisconsin', 3 ],
- [ 40, 13, 'Wofford', 3 ],
- [ 41, 6, 'Marquette', 3 ],
- [ 42, 11, 'Washington', 3 ],
- [ 43, 3, 'New Mexico', 3 ],
- [ 44, 14, 'Montana', 3 ],
- [ 45, 7, 'Clemson', 3 ],
- [ 46, 10, 'Missouri', 3 ],
- [ 47, 2, 'West Virginia', 3 ],
- [ 48, 15, 'Morgan St.', 3 ],
- [ 49, 1, 'Duke', 4 ],
- [ 50, 16, 'Ark-PB/Winthrop', 4 ],
- [ 51, 8, 'California', 4 ],
- [ 52, 9, 'Louisville', 4 ],
- [ 53, 5, 'Texas A&M', 4 ],
- [ 54, 12, 'Utah St.', 4 ],
- [ 55, 4, 'Purdue', 4 ],
- [ 56, 13, 'Siena', 4 ],
- [ 57, 6, 'Notre Dame', 4 ],
- [ 58, 11, 'Old Dominion', 4 ],
- [ 59, 3, 'Baylor', 4 ],
- [ 60, 14, 'Sam Houston St.', 4 ],
- [ 61, 7, 'Richmond', 4 ],
- [ 62, 10, "St. Mary's", 4 ],
- [ 63, 2, 'Villanova', 4 ],
- [ 64, 15, 'Robert Morris', 4 ],
+ [ 1, 1, 'Ohio St.', 1 ],
+ [ 2, 16, 'UTSA/Bama St', 1 ],
+ [ 3, 8, 'George Mason', 1 ],
+ [ 4, 9, 'Villanova', 1 ],
+ [ 5, 5, 'West Virginia', 1 ],
+ [ 6, 12, 'UAB/Clemson', 1 ],
+ [ 7, 4, 'Kentucky', 1 ],
+ [ 8, 13, 'Princeton', 1 ],
+ [ 9, 6, 'Xavier', 1 ],
+ [ 10, 11, 'Marquette', 1 ],
+ [ 11, 3, 'Syracuse', 1 ],
+ [ 12, 14, 'Indiana St.', 1 ],
+ [ 13, 7, 'Washington', 1 ],
+ [ 14, 10, 'Georgia', 1 ],
+ [ 15, 2, 'North Carolina', 1 ],
+ [ 16, 15, 'Long Island', 1 ],
+ [ 17, 1, 'Duke', 2 ],
+ [ 18, 16, 'Hampton', 2 ],
+ [ 19, 8, 'Michigan', 2 ],
+ [ 20, 9, 'Tennessee', 2 ],
+ [ 21, 5, 'Arizona', 2 ],
+ [ 22, 12, 'Memphis', 2 ],
+ [ 23, 4, 'Texas', 2 ],
+ [ 24, 13, 'Oakland', 2 ],
+ [ 25, 6, 'Cincinnati', 2 ],
+ [ 26, 11, 'Missouri', 2 ],
+ [ 27, 3, 'Connecticut', 2 ],
+ [ 28, 14, 'Bucknell', 2 ],
+ [ 29, 7, 'Temple', 2 ],
+ [ 30, 10, 'Penn St.', 2 ],
+ [ 31, 2, 'San Diego St.', 2 ],
+ [ 32, 15, 'No. Colorado', 2 ],
+ [ 33, 1, 'Kansas', 3 ],
+ [ 34, 16, 'Boston U.', 3 ],
+ [ 35, 8, 'UNLV', 3 ],
+ [ 36, 9, 'Illinois', 3 ],
+ [ 37, 5, 'Vanderbilt', 3 ],
+ [ 38, 12, 'Richmond', 3 ],
+ [ 39, 4, 'Louisville', 3 ],
+ [ 40, 13, 'Morehead St.', 3 ],
+ [ 41, 6, 'Georgetown', 3 ],
+ [ 42, 11, 'USC/VCU', 3 ],
+ [ 43, 3, 'Purdue', 3 ],
+ [ 44, 14, "St. Peter's", 3 ],
+ [ 45, 7, 'Texas A&M', 3 ],
+ [ 46, 10, 'Florida St.', 3 ],
+ [ 47, 2, 'Notre Dame', 3 ],
+ [ 48, 15, 'Akron', 3 ],
+ [ 49, 1, 'Pittsburgh', 4 ],
+ [ 50, 16, 'NC-Ash/Ark-LR', 4 ],
+ [ 51, 8, 'Butler', 4 ],
+ [ 52, 9, 'Old Dominion', 4 ],
+ [ 53, 5, 'Kansas St.', 4 ],
+ [ 54, 12, 'Utah St.', 4 ],
+ [ 55, 4, 'Wisconsin', 4 ],
+ [ 56, 13, 'Belmont', 4 ],
+ [ 57, 6, "St. John's", 4 ],
+ [ 58, 11, 'Gonzaga', 4 ],
+ [ 59, 3, 'BYU', 4 ],
+ [ 60, 14, 'Wofford', 4 ],
+ [ 61, 7, 'UCLA', 4 ],
+ [ 62, 10, "Michigan St.", 4 ],
+ [ 63, 2, 'Florida', 4 ],
+ [ 64, 15, 'UC Santa Barb.', 4 ],
]
);
@@ -197,3 +205,83 @@ sub create_initial_data {
}
1
+
+__END__
+# 2010 data
+ # Regions
+ my @regions =
+ $schema->populate('Region',
+ [ [qw/ id name /], [ 1, 'Midwest' ], [ 2, 'West' ], [ 3, 'East' ], [ 4, 'South' ], ]);
+
+ # Teams
+ my @teams = $schema->populate(
+ 'Team',
+ [
+ [qw/ id seed name region /],
+ [ 1, 1, 'Kansas', 1 ],
+ [ 2, 16, 'Lehigh', 1 ],
+ [ 3, 8, 'UNLV', 1 ],
+ [ 4, 9, 'Northern Iowa', 1 ],
+ [ 5, 5, 'Michigan St.', 1 ],
+ [ 6, 12, 'New Mexico St.', 1 ],
+ [ 7, 4, 'Maryland', 1 ],
+ [ 8, 13, 'Houston', 1 ],
+ [ 9, 6, 'Tennessee', 1 ],
+ [ 10, 11, 'San Diego St.', 1 ],
+ [ 11, 3, 'Georgetown', 1 ],
+ [ 12, 14, 'Ohio', 1 ],
+ [ 13, 7, 'Oklahoma St.', 1 ],
+ [ 14, 10, 'Georgia Tech', 1 ],
+ [ 15, 2, 'Ohio St.', 1 ],
+ [ 16, 15, 'UCSB', 1 ],
+ [ 17, 1, 'Syracuse', 2 ],
+ [ 18, 16, 'Vermont', 2 ],
+ [ 19, 8, 'Gonzaga', 2 ],
+ [ 20, 9, 'Florida St.', 2 ],
+ [ 21, 5, 'Butler', 2 ],
+ [ 22, 12, 'UTEP', 2 ],
+ [ 23, 4, 'Vanderbilt', 2 ],
+ [ 24, 13, 'Murray St.', 2 ],
+ [ 25, 6, 'Xavier', 2 ],
+ [ 26, 11, 'Minnesota', 2 ],
+ [ 27, 3, 'Pittsburgh', 2 ],
+ [ 28, 14, 'Oakland', 2 ],
+ [ 29, 7, 'BYU', 2 ],
+ [ 30, 10, 'Florida', 2 ],
+ [ 31, 2, 'Kansas St.', 2 ],
+ [ 32, 15, 'North Texas', 2 ],
+ [ 33, 1, 'Kentucky', 3 ],
+ [ 34, 16, 'E. Tennessee St.', 3 ],
+ [ 35, 8, 'Texas', 3 ],
+ [ 36, 9, 'Wake Forest', 3 ],
+ [ 37, 5, 'Temple', 3 ],
+ [ 38, 12, 'Cornell', 3 ],
+ [ 39, 4, 'Wisconsin', 3 ],
+ [ 40, 13, 'Wofford', 3 ],
+ [ 41, 6, 'Marquette', 3 ],
+ [ 42, 11, 'Washington', 3 ],
+ [ 43, 3, 'New Mexico', 3 ],
+ [ 44, 14, 'Montana', 3 ],
+ [ 45, 7, 'Clemson', 3 ],
+ [ 46, 10, 'Missouri', 3 ],
+ [ 47, 2, 'West Virginia', 3 ],
+ [ 48, 15, 'Morgan St.', 3 ],
+ [ 49, 1, 'Duke', 4 ],
+ [ 50, 16, 'Ark-PB/Winthrop', 4 ],
+ [ 51, 8, 'California', 4 ],
+ [ 52, 9, 'Louisville', 4 ],
+ [ 53, 5, 'Texas A&M', 4 ],
+ [ 54, 12, 'Utah St.', 4 ],
+ [ 55, 4, 'Purdue', 4 ],
+ [ 56, 13, 'Siena', 4 ],
+ [ 57, 6, 'Notre Dame', 4 ],
+ [ 58, 11, 'Old Dominion', 4 ],
+ [ 59, 3, 'Baylor', 4 ],
+ [ 60, 14, 'Sam Houston St.', 4 ],
+ [ 61, 7, 'Richmond', 4 ],
+ [ 62, 10, "St. Mary's", 4 ],
+ [ 63, 2, 'Villanova', 4 ],
+ [ 64, 15, 'Robert Morris', 4 ],
+ ]
+ );
+

0 comments on commit 1eb7c33

Please sign in to comment.
Something went wrong with that request. Please try again.