Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
249 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# encoding: utf-8 | ||
|
||
# note: timezone for games (play_at) is *always* CET (central european time) | ||
|
||
###################################### | ||
## Deutsche Bundesliga 2012/13 | ||
## | ||
## more info => ??? | ||
|
||
|
||
bl = Event.create!( :key => 'de.2012/13', | ||
:title => 'Deutsche Bundesliga 2012/13', | ||
:start_at => Time.cet('2012-07-21 00:00') ) | ||
|
||
|
||
bayern = Team.find_by_key!( 'bayern' ) | ||
frankfurt = Team.find_by_key!( 'frankfurt' ) | ||
schalke = Team.find_by_key!( 'schalke' ) | ||
dortmund = Team.find_by_key!( 'dortmund' ) | ||
hannover = Team.find_by_key!( 'hannover' ) | ||
leverkusen = Team.find_by_key!( 'leverkusen' ) | ||
duesseldorf = Team.find_by_key!( 'duesseldorf' ) | ||
hsv = Team.find_by_key!( 'hsv' ) | ||
mainz = Team.find_by_key!( 'mainz' ) | ||
mgladback = Team.find_by_key!( 'mgladback' ) | ||
freiburg = Team.find_by_key!( 'freiburg' ) | ||
bremen = Team.find_by_key!( 'bremen' ) | ||
hoffenheim = Team.find_by_key!( 'hoffenheim' ) | ||
nuernberg = Team.find_by_key!( 'nuernberg' ) | ||
stuttgart = Team.find_by_key!( 'stuttgart' ) | ||
augsburg = Team.find_by_key!( 'augsburg' ) | ||
wolfsburg = Team.find_by_key!( 'wolfsburg' ) | ||
fuerth = Team.find_by_key!( 'fuerth' ) | ||
|
||
|
||
|
||
bl.teams << bayern | ||
bl.teams << frankfurt | ||
## todo: to be continued | ||
|
||
|
||
bl07 = Round.create!( :event => bl, :pos => 7, :title => '7. Runde', :title2 => '06.+07. Okt 2012 ??' ) | ||
|
||
|
||
## todo: fix game dates | ||
|
||
games_bl07 = [ | ||
[ 1, augsburg, [3,1], bremen, Time.cet('2012-10-06 00:00') ], | ||
[ 2, bayern, [2,0], hoffenheim, Time.cet('2012-10-06 00:00') ], | ||
[ 3, schalke, [3,0], wolfsburg, Time.cet('2012-10-06 00:00') ], | ||
[ 4, freiburg, [3,0], nuernberg, Time.cet('2012-10-06 00:00') ], | ||
[ 5, mainz, [1,0], duesseldorf, Time.cet('2012-10-06 00:00') ], | ||
[ 6, fuerth, [0,1], hsv, Time.cet('2012-10-06 00:00') ], | ||
[ 7, mgladbach, [2,0], frankfurt, Time.cet('2012-10-06 00:00') ], | ||
[ 8, stuttgart, [2,2], leverkusen, Time.cet('2012-10-06 00:00') ], | ||
[ 9, hannover, [1,1], dortmund, Time.cet('2012-10-06 00:00') ] | ||
] | ||
|
||
|
||
Game.create_from_ary!( games_bl07, bl07 ) | ||
|
||
Prop.create!( :key => 'db.de.bl.2012/13.version', :value => '1' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# encoding: utf-8 | ||
|
||
## fix/todo: | ||
## bayern, schalke, etc. already defined in cl | ||
## change create to create_or_update or similar (check for name convention in Rails?) | ||
|
||
|
||
teams = [ | ||
[ 'bayern', 'FC Bayern' ], | ||
[ 'frankfurt', 'E Frankfurt' ], | ||
[ 'schalke', 'FC Schalke 04' ], | ||
[ 'dortmund', 'B Dortmund' ], | ||
[ 'hannover', 'Hannover 96' ], | ||
[ 'leverkusen', 'B Leverkusen' ], | ||
[ 'duesseldorf', 'F Düsseldorf' ], | ||
[ 'hsv', 'Hamburger SV' ], | ||
[ 'mainz', 'Mainz 05' ], | ||
[ 'mgladback', 'B M gladbach' ], | ||
[ 'freiburg', 'SC Freiburg' ], | ||
[ 'bremen', 'W Bremen' ], | ||
[ 'hoffenheim', 'Hoffenheim' ], | ||
[ 'nuernberg', '1 FC Nürnberg' ], | ||
[ 'stuttgart', 'VfB Stuttgart' ], | ||
[ 'augsburg', 'FC Augsburg' ], | ||
[ 'wolfsburg', 'VfL Wolfsburg' ], | ||
[ 'fuerth', 'G Fuerth' ] | ||
] | ||
|
||
Team.create_from_ary!( teams ) | ||
|
||
|
||
Prop.create!( :key => 'db.de.teams.version', :value => '1' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,107 @@ | ||
|
||
# add sport.db SQL Schema here | ||
CREATE TABLE teams ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT | ||
NOT NULL, | ||
title VARCHAR( 255 ) NOT NULL, | ||
title2 VARCHAR( 255 ), | ||
[key] VARCHAR( 255 ) NOT NULL, | ||
tag VARCHAR( 255 ), | ||
created_at DATETIME NOT NULL, | ||
updated_at DATETIME NOT NULL | ||
); | ||
|
||
|
||
CREATE TABLE games ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT | ||
NOT NULL, | ||
round_id INTEGER NOT NULL, | ||
pos INTEGER NOT NULL, | ||
group_id INTEGER, | ||
team1_id INTEGER NOT NULL, | ||
team2_id INTEGER NOT NULL, | ||
play_at DATETIME NOT NULL, | ||
knockout BOOLEAN DEFAULT 'f' | ||
NOT NULL, | ||
home BOOLEAN DEFAULT 't' | ||
NOT NULL, | ||
score1 INTEGER, | ||
score2 INTEGER, | ||
score3 INTEGER, | ||
score4 INTEGER, | ||
score5 INTEGER, | ||
score6 INTEGER, | ||
next_game_id INTEGER, | ||
prev_game_id INTEGER, | ||
toto12x VARCHAR( 255 ), | ||
[key] VARCHAR( 255 ), | ||
created_at DATETIME NOT NULL, | ||
updated_at DATETIME NOT NULL | ||
); | ||
|
||
|
||
CREATE TABLE events ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT | ||
NOT NULL, | ||
title VARCHAR( 255 ) NOT NULL, | ||
[key] VARCHAR( 255 ) NOT NULL, | ||
start_at DATETIME NOT NULL, | ||
created_at DATETIME NOT NULL, | ||
updated_at DATETIME NOT NULL | ||
); | ||
|
||
|
||
CREATE TABLE events_teams ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT | ||
NOT NULL, | ||
event_id INTEGER NOT NULL, | ||
team_id INTEGER NOT NULL, | ||
created_at DATETIME NOT NULL, | ||
updated_at DATETIME NOT NULL | ||
); | ||
|
||
|
||
CREATE TABLE groups ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT | ||
NOT NULL, | ||
event_id INTEGER NOT NULL, | ||
title VARCHAR( 255 ) NOT NULL, | ||
pos INTEGER NOT NULL, | ||
created_at DATETIME NOT NULL, | ||
updated_at DATETIME NOT NULL | ||
); | ||
|
||
|
||
CREATE TABLE groups_teams ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT | ||
NOT NULL, | ||
group_id INTEGER NOT NULL, | ||
team_id INTEGER NOT NULL, | ||
created_at DATETIME NOT NULL, | ||
updated_at DATETIME NOT NULL | ||
); | ||
|
||
|
||
CREATE TABLE rounds ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT | ||
NOT NULL, | ||
event_id INTEGER NOT NULL, | ||
title VARCHAR( 255 ) NOT NULL, | ||
title2 VARCHAR( 255 ), | ||
pos INTEGER NOT NULL, | ||
playoff BOOLEAN DEFAULT 'f' | ||
NOT NULL, | ||
created_at DATETIME NOT NULL, | ||
updated_at DATETIME NOT NULL | ||
); | ||
|
||
|
||
CREATE TABLE props ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT | ||
NOT NULL, | ||
[key] VARCHAR( 255 ) NOT NULL, | ||
value VARCHAR( 255 ) NOT NULL, | ||
created_at DATETIME NOT NULL, | ||
updated_at DATETIME NOT NULL | ||
); | ||
|
||
|